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
GET /eventinterests/1 GET /eventinterests/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_interest }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def index\n @eventinterests = Eventinterest.all\n end", "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interests }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @interest }\n end\n end", "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interest }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "def index\n @interests = Interest.all\n end", "def index\n @interests = Interest.all\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "def set_eventinterest\n @eventinterest = Eventinterest.find(params[:id])\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "def new\n @event_interest = EventInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_interest }\n end\n end", "def index\n \n @interests = Interest.find(@interestsId)\n \n if params[:persona_id] == nil \n @interests = Interest.order(:name) \n end\n \n respond_to do |format|\n format.json { render :json => @interests }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n @interests = Interest.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interest }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def get_interests_by_id\n return filter_by_id(get_interests)\n end", "def interests\n @articles = Article.tagged_with(current_user.interest_list, any: true)\n @articles = @articles.paginate(page: params[:page], per_page: 10).order('pub_date DESC')\n end", "def index\n number_tweets = if params[\"count\"] then params[\"count\"].to_i else 10 end\n tweet_ids = []\n if @user.interests\n for i in 1..number_tweets\n interest = @user.interests.sample\n tweet = Rails.application.config.twitter_client.search(\"#{interest[:hashtag]}\", count: 1).take(1)\n tweet_ids.push(tweet.first.id.to_s)\n end\n end\n\n render json: tweet_ids, status: :ok\n end", "def index\n @user_interests = UserInterest.all\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end", "def index\n render :json => UserInterest.all\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def index\n @interests = Interests.for_person(@person)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @interests }\n end\n end", "def show\n @person_interest = PersonInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @person_interest }\n end\n end", "def interests\n respond_with get_tags_for_contexts([\"interests\", \"reject_interests\"], params[:exclude_tags])\n end", "def index\n @api_v1_mentorship_interests = Api::V1::MentorshipInterest.all\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 @interests = Interests.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interests }\n end\n end", "def eventinterest_params\n params.require(:eventinterest).permit(:isinterest, :user_id, :events_id)\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def get_interests\n\t\t@si = SocietyInterest.where(society_id: self.id)\n\t\t@interests = []\n\t\[email protected] do |s|\n\t\t\t@interests << Interest.find_by_id(s.interest_id)\n\t\tend\n\t\treturn @interests\n end", "def create\n @event_interest = EventInterest.new(params[:event_interest])\n\n respond_to do |format|\n if @event_interest.save\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully created.' }\n format.json { render json: @event_interest, status: :created, location: @event_interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def index\n @interviews = Interview.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interviews }\n end\n end", "def set_interest\n @interest = Interest.find(params[:id]) \n @especifications = Especification.where(\"interest_id = #{params[:id]}\")\n end", "def create\n @interest = Interest.new(params[:interest])\n \n respond_to do |format|\n if @interest.save\n format.json { render :json => @interest,\n :status => :created, :location => @interest }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def user_event_inforamtion\n @user_events = UserEvent.where(event_id: params[:event_id])\n\n render json: @user_events, root: \"user_event_information\", each_serializer: Web::V1::UserEventInformationSerializer\n end", "def current_user_interests\n current_user.interests\n end", "def create\n @eventinterest = Eventinterest.new(eventinterest_params)\n\n respond_to do |format|\n if @eventinterest.save\n format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully created.' }\n format.json { render :show, status: :created, location: @eventinterest }\n else\n format.html { render :new }\n format.json { render json: @eventinterest.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_interest\n begin\n @interest = Interest.find(params[:id])\n rescue\n redirect_to \"/interest\"\n end\n end", "def my_interests\n # Get all interesting articles to current user and sort them by date_time\n @articles = Article.tagged_with(current_user.interest_list, any: true)\n @articles = @articles.paginate(page: params[:page], per_page: 10).order(date_time: :desc)\n\n @page_title = 'My Interests'\n render 'index'\n end", "def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end", "def show_interest_data\n @interests = Interest.find_user_interest(current_user.id)\n @category_name = Array.new\n for i in [email protected] do\n @category_name[i] = EventCategoryMaster.find_category_name(@interests[i].category_id).first\n end\n @subcategory_name = Array.new\n for j in [email protected] do\n @subcategory_name[j] = EventCategoryMaster.find_category_name(@interests[j].subcategory_id).first\n end\n @show_interests = Array.new\n for p in [email protected] do\n @show_interests[p] = {\"category_name\" => \"#{@category_name[p].event_cat_name}\", \"subcategory_name\" => \"#{@subcategory_name[p].event_cat_name}\", \"id\" => \"#{@interests[p].id}\"}\n end\n \n end", "def list_interests # :norobots:\n store_location\n @title = :list_interests_title.t\n notifications = Notification.find_all_by_user_id(@user.id).sort do |a,b|\n result = a.flavor.to_s <=> b.flavor.to_s\n result = a.summary.to_s <=> b.summary.to_s if result == 0\n result\n end\n interests = Interest.find_all_by_user_id(@user.id).sort do |a,b|\n result = a.target_type <=> b.target_type\n result = (a.target ? a.target.text_name : '') <=>\n (b.target ? b.target.text_name : '') if result == 0\n result\n end\n @targets = notifications + interests\n @pages = paginate_numbers(:page, 50)\n @pages.num_total = @targets.length\n @targets = @targets[@[email protected]]\n end", "def eventsinprogress\n @title = \"My Events In Progress\"\n\n puts '====================== events'\n\n @user = User.find(params[:id])\n @events = @user.events.where(complete: 'INPROGRESS').paginate(page: params[:page], :per_page => 50)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> { \n :events=>@events.as_json(\n :include => { \n :users => { :only => [:id, :name, :invitation_token, :notify, :buddy, :gender, :displayname], :methods => [:photo_url] },\n :rounds => { \n :include => { \n :scorecard => { }\n }\n },\n :course => {\n :include => {\n :facility => { :only => [:id, :facility_code, :facility_name, :address, :city, :state, :longitude, :latitude], \n :include => { \n :courses => { :only => [:id, :course_code, :facility_code, :course_name, :hol, :par] }\n }\n }\n } \n } \n }\n )\n } }\n end\n end", "def select_user_interests\n @interests = Interest.all\n # current user interests\n @user_interests = UserInterest.where(:user_id => current_user.id);\n @cur_u = current_user\n\n end", "def index\n @monthly_interests = MonthlyInterest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @monthly_interests }\n end\n end", "def show\n @interview = Interview.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interview }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @media_interests }\n end\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, :notice => 'Interest was successfully created.' }\n format.json { render :json => @interest, :status => :created, :location => @interest }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @event = Event.find(params[:event_id])\n @point_of_interest = PointOfInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @point_of_interest }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n creator = User.find(@interest.user_id)\n creatorName = creator.name\n\n respond_to do |format|\n format.html #show.html.erb\n format.json {render json: @interest}\n end\n end", "def index\n @interest_groups = InterestGroup.all\n end", "def index\n @invitations = Invitation.all\n\n render json: @invitations, except: [:created_at, :updated_at], \n include: [:event => {include: [:host => {except: [:password_digest, :created_at, :updated_at]}]}]\n end", "def index\n @interests = Interest.order(:data_envio) \n end", "def index\n authorize!(:manage, Interest)\n @interests = Interest.onboarding_list_by_position\n end", "def index\n @project_interest_points = ProjectInterestPoint.all\n end", "def show\n @interest_area = InterestArea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interest_area }\n end\n end", "def city_events(city)\n response = RestClient.get('https://app.ticketmaster.com/discovery/v2/events.json?city=' + city + '&apikey=' + $ticket_master_api_key)\n jason_response = JSON.parse(response)\nend", "def show\n @point_of_interest = PointOfInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @point_of_interest }\n format.json { render :json => @point_of_interest.as_json_single() }\n end\n end", "def index\n @interest_on_housing_loans = InterestOnHousingLoan.all\n end", "def show\n @interview = Interview.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interview }\n end\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: 'Interest was successfully created.' }\n format.json { render json: @interest, status: :created, location: @interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n party_results = Event.party(params[:event], params[:location],\n params[:time], params[:category])\n @results = JSON.parse(party_results)\n\n # twitter_results = Event.twitter_search(params[:event])\n # @twitter_results = Event.twitter_search(response)\n # Event.create\n end", "def show\n @monthly_interest = MonthlyInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @monthly_interest }\n end\n end", "def interest_rate\n params['interest_rate'] = params['interest_rate'].to_f\n\n old_rate = @@interest_rate\n @@interest_rate = params['interest_rate']\n json_response(old_rate: old_rate, new_rate: @@interest_rate)\n end", "def show\n @idea_event = IdeaEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idea_event }\n end\n end", "def index\n @invents = Invent.all\n end", "def destroy\n @event_interest = EventInterest.find(params[:id])\n @event_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to event_interests_url }\n format.json { head :no_content }\n end\n end", "def index\n if get_event\n @v1_questions = @event.questions\n render json: @v1_questions\n else\n @v1_questions = V1::Question.all\n render json: @v1_questions\n end\n end", "def add_interest(id)\n SocietyInterest.create(society_id: self.id, interest_id: id)\n end", "def state_events(state)\n api_return = RestClient.get('https://app.ticketmaster.com/discovery/v2/events.json?stateCode=' + state + '&apikey=' + $ticket_master_api_key)\n JSON.parse(api_return)\nend", "def show\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myevent }\n end\n end", "def upcoming_interviews\n future_interviews_count = @interviewer.upcoming_interviews.count\n if [1, 2].include? future_interviews_count\n render json: @interviewer\n else\n render json: {error: \"No Upcoming Interviews found\"}, status: 404\n end\n end", "def details\n get(\"v1/event/#{@id}\")\n end", "def index\n event_id = current_event.id\n event_id = params[:event_id] if params.has_key?(:event_id)\n @entrants = Entrant.all(:conditions => \"event_id = #{event_id}\",\n :order => \"number ASC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entrants }\n end\n end", "def update\n respond_to do |format|\n if @eventinterest.update(eventinterest_params)\n format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully updated.' }\n format.json { render :show, status: :ok, location: @eventinterest }\n else\n format.html { render :edit }\n format.json { render json: @eventinterest.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n\t\t@events = Event.where(\"creator_id = ?\", current_user.id)\n\t\tInvitation.where(\"email = ? and accepted = ?\", current_user.email, true).each do |invitation|\n\t\t\t@events << invitation.event\n\t\tend\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def show\n @object = Interest.find(params[:id])\n end", "def index\n @event = Event.all\n render json: @event\n end", "def my_interviews\n @interviews = Interview.find(:all, :conditions => ['teacher_id = ?', self.current_user.teacher.id])\n \n respond_to do |format|\n format.html # my_interviews.html.erb\n format.json { render json: @interviews }\n end\n end", "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def index\n @users_interests_links = UsersInterestsLink.all\n end", "def new\n @person_interest = PersonInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_interest }\n end\n end", "def show\n \t\t@interested = Interested.find(params[:id])\n\n \t\trespond_to do |format|\n \t\t\tformat.html #show.html.erb\n \t\t\tformat.json { render json: @interested }\n \t\tend\n \tend", "def search\n render json: PersonEvent.first(10)\n end", "def show\n @event = Event.find(params[:id])\n\n render json: @event, include: :talks\n end", "def index\n @interest_points = InterestPoint.search(params[:search_name])\n end", "def index\n if params[:event_id]\n @event = Event.find(params[:event_id])\n @rounds = Round.where(\"event_id = ?\", params[:event_id])\n else\n @rounds = Round.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rounds }\n end\n end", "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @interested = Interested.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interested }\n end\n end", "def index\n @events = Event.all\n\n render json: @events, include: :talks\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interest }\n end\n end", "def interested_in?(interest)\n self.user_interests.find_by_interest_id(interest)\n end", "def index\n @events = Event.all\n\n render json: @events, \n except: [:created_at, :updated_at], \n include: [:reviews => {include: [:attendee => {only: [:first_name, :last_name]}]}, \n :host => {only: [:first_name, :last_name, :id]}]\n\n end" ]
[ "0.744504", "0.71390194", "0.71185654", "0.7068642", "0.7023972", "0.7018341", "0.69449764", "0.68843067", "0.6743654", "0.6743654", "0.6658405", "0.6602967", "0.65270346", "0.65088576", "0.65007055", "0.62919736", "0.62904423", "0.6278622", "0.6273331", "0.6258273", "0.62567496", "0.6229787", "0.62247574", "0.61791646", "0.6164847", "0.61477387", "0.6090317", "0.6083079", "0.6070657", "0.6061439", "0.60542697", "0.6024079", "0.6024079", "0.6024079", "0.6024079", "0.6024079", "0.6007699", "0.5932193", "0.5912883", "0.587012", "0.58545643", "0.5842493", "0.58406353", "0.58314604", "0.58295965", "0.58227944", "0.5805358", "0.57623625", "0.5761225", "0.5758361", "0.57582766", "0.5707623", "0.57047534", "0.5703228", "0.56945556", "0.56859475", "0.5684887", "0.5683188", "0.5676619", "0.5670951", "0.5640519", "0.5639151", "0.5627337", "0.5612383", "0.5612291", "0.56044555", "0.5597942", "0.55907446", "0.55863744", "0.5566259", "0.5553217", "0.55490035", "0.5542243", "0.55394137", "0.5522005", "0.5521768", "0.5513748", "0.5512951", "0.55011886", "0.5500136", "0.5498984", "0.5495468", "0.5480075", "0.5476962", "0.54720205", "0.5463055", "0.5461086", "0.54550153", "0.54531884", "0.54461515", "0.54260063", "0.54242134", "0.5408191", "0.5402241", "0.5398517", "0.5395007", "0.53942704", "0.5391559", "0.53832674", "0.5378405", "0.5375487" ]
0.0
-1
POST /eventinterests POST /eventinterests.json
def create @eventinterest = Eventinterest.new(eventinterest_params) respond_to do |format| if @eventinterest.save format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully created.' } format.json { render :show, status: :created, location: @eventinterest } else format.html { render :new } format.json { render json: @eventinterest.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @event_interest = EventInterest.new(params[:event_interest])\n\n respond_to do |format|\n if @event_interest.save\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully created.' }\n format.json { render json: @event_interest, status: :created, location: @event_interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def eventinterest_params\n params.require(:eventinterest).permit(:isinterest, :user_id, :events_id)\n end", "def create\n @interest = Interest.new(params[:interest])\n \n respond_to do |format|\n if @interest.save\n format.json { render :json => @interest,\n :status => :created, :location => @interest }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, :notice => 'Interest was successfully created.' }\n format.json { render :json => @interest, :status => :created, :location => @interest }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: 'Interest was successfully created.' }\n format.json { render json: @interest, status: :created, location: @interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_eventinterest\n @eventinterest = Eventinterest.find(params[:id])\n end", "def create\n @interest = Interest.new(params[:interest])\n if @interest.save\n redirect_to interests_path\n else\n redirect_to new_interest_path\n end\n end", "def create_interest_params\n params.permit(:yelp_id, :interests => [:min_seats, :max_seats, :datetime])\n end", "def index\n @eventinterests = Eventinterest.all\n end", "def create\n @event = Event.find(params[:event_id])\n @point_of_interest = @event.point_of_interests.new(params[:point_of_interest])\n\n respond_to do |format|\n if @point_of_interest.save\n format.html { redirect_to(@event, :notice => 'Point of interest was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event_point_of_interest }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @point_of_interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create \n @interest = Interest.new(interest_params)\n @interest.save\n end", "def new\n @event_interest = EventInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_interest }\n end\n end", "def add_interest(id)\n SocietyInterest.create(society_id: self.id, interest_id: id)\n end", "def create\n @user = User.find(params[:user])\n @animal = Animal.find(params[:animal])\n @interest = Interest.new(user_id: @user.id, animal_id: @animal.id, date: Date.today)\n\n respond_to do |format|\n if @interest.save\n format.html { redirect_to :back, notice: 'You sent an interest to the animal' }\n format.json { head :no_content }\n else\n format.html { redirect_to animals_url, notice: @interest.errors.full_messages[0] }\n format.json { head :no_content }\n end\n end\n end", "def create\n @interest = Interest.new(interest_params)\n @interest.user_id=current_user.id\n if(@interest.save)\n render json: {\"success\":true,\"message\":\"Done!\"}\n else\n render json: {\"success\":false,\"message\":@interest.errors}\n end\n # respond_to do |format|\n # if @interest.save\n # format.html { redirect_to @interest, notice: 'Interest was successfully created.' }\n # format.json { render :show, status: :created, location: @interest }\n # else\n # format.html { render :new }\n # format.json { render json: @interest.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\n @interest = Interest.new(interest_params)\n authorize @interest\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, notice: t('flash.notice.created') }\n format.json { render :show, status: :created, location: @interest }\n else\n format.html { render :new }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if user_interest_params && @current_user.id == user_interest_params[:user_id].to_i #only create them if the current user = the parameter user\n \n @user_id = user_interest_params[:user_id]\n\n count = 1\n interests_to_add = does_interest_exist(user_interest_params) #only add interests that don't exist yet\n \n if interests_to_add.length >= 1 #only run this if there are interests to add\n interests_to_add.each do |interest|\n @user_interest = UserInterest.new(user_id: @user_id, interest_id: interest)\n \n if @user_interest.save\n if count == interests_to_add.length #show success only for the last one\n render json: { \n status: 200,\n message: \"Successfully added user interests\",\n user_interests: @user_interest\n }.to_json\n end\n else\n render json: {\n status: 500,\n message: \"Couldn't save user interests\",\n errors: @user_interest.errors\n }.to_json\n end\n count += 1\n end\n else #if there are no interests to add, state so.\n render json: {\n status: 200,\n message: \"No interests to add\"\n }.to_json\n end\n else\n render json: {\n status: 400,\n message: \"Invalid authentication\"\n }.to_json\n end\n end", "def create\n @user_interest = UserInterest.new(user_interest_params)\n\n respond_to do |format|\n if @user_interest.save\n format.html { redirect_to @user_interest, notice: 'User interest was successfully created.' }\n format.json { render :show, status: :created, location: @user_interest }\n else\n format.html { render :new }\n format.json { render json: @user_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def interest_params\n params.require(:interest).permit(:user_id, :animal_id, :date)\n end", "def notify(interests, data = {})\n Request.new(\n @eventflit_client,\n :post,\n url(\"/publishes\"),\n {},\n payload(interests, data)\n ).send_sync\n end", "def create\n @interest = Interest.new(params[:interest])\n\n respond_to do |format|\n if @interest.save\n flash[:notice] = 'Interest was successfully created.'\n format.html { redirect_to(@interest) }\n format.xml { render :xml => @interest, :status => :created, :location => @interest }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def create\n @interests = Interests.new(params[:interests])\n @interests.person = @person\n\n respond_to do |format|\n if @interests.save\n flash[:notice] = 'Interests saved.'\n format.html { redirect_to(welcome_path(:id => @person)) }\n format.xml { render :xml => @interests, :status => :created, :location => @interests }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @interests.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @interests }\n end\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interest }\n end\n end", "def index\n @interests = Interest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "def handle_explore_interests\n @explore_interest_ids = []\n tag_ids = params[:tag_ids]\n @interests = Interest.all\n @interests.each do |i_box|\n # Set the interest information from form to instance variable\n @interest_info = i_box.id\n\n if (!tag_ids.nil?) && (tag_ids.include? i_box.id.to_s)\n @explore_interest_ids.push i_box.id\n else\n @explore_interest_ids.delete i_box.id\n end\n end\n redirect_to users_explore_path\n end", "def create\n @student_interest = StudentInterest.new(student_interest_params)\n\n respond_to do |format|\n if @student_interest.save\n format.html { redirect_to @student_interest, notice: 'Student interest was successfully created.' }\n format.json { render action: 'show', status: :created, location: @student_interest }\n else\n format.html { render action: 'new' }\n format.json { render json: @student_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n standard_create(Interest, interest_params)\n end", "def new\n @interest = Interest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def create\n @person_interest = PersonInterest.new(params[:person_interest])\n\n respond_to do |format|\n if @person_interest.save\n format.html { redirect_to @person_interest, notice: 'Person interest was successfully created.' }\n format.json { render json: @person_interest, status: :created, location: @person_interest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @person_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @interests }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @interest }\n end\n end", "def index\n number_tweets = if params[\"count\"] then params[\"count\"].to_i else 10 end\n tweet_ids = []\n if @user.interests\n for i in 1..number_tweets\n interest = @user.interests.sample\n tweet = Rails.application.config.twitter_client.search(\"#{interest[:hashtag]}\", count: 1).take(1)\n tweet_ids.push(tweet.first.id.to_s)\n end\n end\n\n render json: tweet_ids, status: :ok\n end", "def index\n @interests = Interest.all\n end", "def index\n @interests = Interest.all\n end", "def interests\n @articles = Article.tagged_with(current_user.interest_list, any: true)\n @articles = @articles.paginate(page: params[:page], per_page: 10).order('pub_date DESC')\n end", "def interest_params\n params.require(:interest).permit(:name, :interest_category_id, :highlight, :include_on_application, :inactive)\n end", "def interests\n respond_with get_tags_for_contexts([\"interests\", \"reject_interests\"], params[:exclude_tags])\n end", "def create\n respond_to do |format|\n if @interest.save\n format.html { redirect_to @interest, :notice => 'Интересот е успешно додаден.' }\n format.json { render :json => @interest, :status => :created, :location => @interest }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def interest_params\n params.require(:interest).permit(:label, :uri)\n end", "def create\n @invitation_request = InvitationRequest.new(invitation_request_params)\n\n respond_to do |format|\n if @invitation_request.save\n format.html { redirect_to root_path, notice: 'Invitation received. We will notify you soon!' }\n format.json { render :show, status: :created, location: @invitation_request }\n else\n @interests = Interest.all\n format.html { render :new }\n format.json { render json: @invitation_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def set_interest\n @interest = Interest.find(params[:id])\n end", "def update\n respond_to do |format|\n if @eventinterest.update(eventinterest_params)\n format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully updated.' }\n format.json { render :show, status: :ok, location: @eventinterest }\n else\n format.html { render :edit }\n format.json { render json: @eventinterest.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_interest }\n end\n end", "def set_interest\n @interest = Interest.find(params[:id]) \n @especifications = Especification.where(\"interest_id = #{params[:id]}\")\n end", "def interest_params\n params.require(:interest).permit(:name)\n end", "def submit_events_api_call(date, begin_time, end_time, location, itinerary)\n preferences_request = current_user.supplemental_preferences\n designated_preference = preferences_request.sample\n category_request = designated_preference.events_categories.sample\n start_date_time = user_input_to_unix(date, begin_time)\n end_date_time = user_input_to_unix(date, end_time)\n y = YelpResponse.new\n response = y.get_events_response({location: location, categories: category_request, start_date: start_date_time, end_date: end_date_time})\n handle_events_response(response, y, itinerary)\n y.destroy\n end", "def create\n @interest_group = InterestGroup.new(interest_group_params)\n @interest_group.user = current_user\n \n respond_to do |format|\n if @interest_group.save\n format.html { redirect_to @interest_group, notice: 'Interest group was successfully created.' }\n format.json { render :show, status: :created, location: @interest_group }\n else\n format.html { render :new }\n format.json { render json: @interest_group.errors, status: :unprocessable_entity }\n end\n end\n end", "def interest_params\n params.require(:interest).permit(:rating, :comment)\n end", "def user_interest_params\n params.permit(\n :user_id, :interest_id, :value\n )\n end", "def create\n @interest = GtInterest.new(:email => params[:email], :priority_code => params[:priority_code])\n if @interest.save\n @status = 200\n\n # Don't want to email when using this model to test \"subscribe via email\" signups\n unless /subscribe_to_roll:.+/.match(params[:priority_code])\n ShelbyGT_EM.next_tick { GtInterestMailer.interest_autoresponse(@interest.email).deliver }\n end\n else\n render_error(400, \"must have a valid email\")\n end\n end", "def create\n @event = Event.new(event_params)\n\n if @event.save\n @event.enters\n @event.leaves\n\n # highfive_counter = 0\n # if @event[\"event_type\"] == \"highfive\"\n # highfive_counter = highfive_counter + 1\n # return highfive_counter\n # else\n # 0\n # end\n render json: @event, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def set_interest # :norobots:\n pass_query_params\n type = params[:type].to_s\n oid = params[:id].to_i\n state = params[:state].to_i\n uid = params[:user]\n target = Comment.find_object(type, oid)\n if @user\n interest = Interest.find_by_target_type_and_target_id_and_user_id(type, oid, @user.id)\n if uid && @user.id != uid.to_i\n flash_error(:set_interest_user_mismatch.l)\n elsif !target && state != 0\n flash_error(:set_interest_bad_object.l(:type => type, :id => oid))\n else\n if !interest && state != 0\n interest = Interest.new\n interest.target = target\n interest.user = @user\n end\n if state == 0\n name = target ? target.unique_text_name : '--'\n if !interest\n flash_notice(:set_interest_already_deleted.l(:name => name))\n elsif !interest.destroy\n flash_notice(:set_interest_failure.l(:name => name))\n else\n if interest.state\n flash_notice(:set_interest_success_was_on.l(:name => name))\n else\n flash_notice(:set_interest_success_was_off.l(:name => name))\n end\n end\n elsif interest.state == true && state > 0\n flash_notice(:set_interest_already_on.l(:name => target.unique_text_name))\n elsif interest.state == false && state < 0\n flash_notice(:set_interest_already_off.l(:name => target.unique_text_name))\n else\n interest.state = (state > 0)\n interest.updated_at = Time.now\n if !interest.save\n flash_notice(:set_interest_failure.l(:name => target.unique_text_name))\n else\n if state > 0\n flash_notice(:set_interest_success_on.l(:name => target.unique_text_name))\n else\n flash_notice(:set_interest_success_off.l(:name => target.unique_text_name))\n end\n end\n end\n end\n end\n if target\n redirect_back_or_default(:controller => target.show_controller,\n :action => target.show_action, :id => oid,\n :params => query_params)\n else\n redirect_back_or_default(:controller => 'interest',\n :action => 'list_interests')\n end\n end", "def set_interest\n begin\n @interest = Interest.find(params[:id])\n rescue\n redirect_to \"/interest\"\n end\n end", "def followed\n\t\t@interest = Interest.find(params[:id])\n\t\[email protected] = @interest.score + 1\n\t\[email protected]\n\t\tcurrent_user.create_rel(\"HAS_INTEREST\", @interest) \n\t\tif request.xhr?\n\t\t\trender json: { id: @interest.id }\n\t\telse\n\t\t\tredirect_to @user\n\t\tend\n\n\tend", "def new\n @event = Event.find(params[:event_id])\n @point_of_interest = PointOfInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @point_of_interest }\n end\n end", "def index\n \n @interests = Interest.find(@interestsId)\n \n if params[:persona_id] == nil \n @interests = Interest.order(:name) \n end\n \n respond_to do |format|\n format.json { render :json => @interests }\n end\n end", "def notify(interests, data = {})\n Request.new(\n @pusher_client,\n :post,\n url(\"/notifications\"),\n {},\n payload(interests, data)\n ).send_sync\n end", "def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n\n new_tags = params[:tags].split(',')\n\n new_tags.each do |stag|\n @event.tags.create(tag: stag)\n end\n\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def save_interest\n @record_count = Interest.find_all_by_user_id(current_user.id)\n @interest = Interest.new(:category_id => params[:category_id], :subcategory_id => params[:subcategory_id], :user_id => current_user.id)\n @same_pair = Interest.find_same_pair(params[:category_id], params[:subcategory_id], current_user.id)\n if (@same_pair.empty? && @record_count.count != 15)\n @interest.save\n else\n if(!@same_pair.empty?)\n @interest = {:message => \"same pair.\"}\n elsif(@record_count.count == 15)\n @interest = {:message => \"limit exceed.\"}\n end\n end\n respond_to do |format|\n format.json { render :json => @interest }\n end\n end", "def destroy\n @event_interest = EventInterest.find(params[:id])\n @event_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to event_interests_url }\n format.json { head :no_content }\n end\n end", "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @interest }\n end\n end", "def create\n\n # Rails.logger.warn \"====================\"\n # Rails.logger.warn foaf_params[:interests_attributes]\n # Rails.logger.warn \"====================\"\n\n \n @foaf = Foaf.new(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n end\n end\n\n respond_to do |format|\n if @foaf.save \n format.html { redirect_to @foaf, notice: 'Foaf was successfully created.' }\n format.json { render action: 'show', status: :created, location: @foaf }\n else\n format.html { render action: 'new' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "def user_interest_params\n params.require(:user_interest).permit(:person_id, :course_id)\n end", "def create\n @expression_of_interest = ExpressionOfInterest.new(expression_of_interest_params)\n\n respond_to do |format|\n if @expression_of_interest.save\n format.html { redirect_to @expression_of_interest, notice: 'Expression of interest was successfully created.' }\n format.json { render :show, status: :created, location: @expression_of_interest }\n else\n format.html { render :new }\n format.json { render json: @expression_of_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def interest_params\n params.require(:interest).permit(:n_empenho, :aplicacao, :rsrp, :obs, :pregao, :company_id, :emissao, :processo, \n :sims_squad_id, :data_envio, :prazo, :avatar, :user_cadastro, :user_atualiza,\n :especifications_attributes => [:id, :descricao, :type_id, :qtde, :valor_un, :modality_id, :_destroy])\n end", "def index\n party_results = Event.party(params[:event], params[:location],\n params[:time], params[:category])\n @results = JSON.parse(party_results)\n\n # twitter_results = Event.twitter_search(params[:event])\n # @twitter_results = Event.twitter_search(response)\n # Event.create\n end", "def index\n @user_interests = UserInterest.all\n end", "def create\n\n # Rails.logger.warn \"====================\"\n # Rails.logger.warn foaf_params[:interests_attributes]\n # Rails.logger.warn \"====================\"\n\n \n @foaf = Foaf.new(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n end\n end\n\n respond_to do |format|\n if @foaf.save \n format.html { redirect_to @foaf, notice: 'FOAF was successfully created.' }\n format.json { render action: 'show', status: :created, location: @foaf }\n else\n format.html { render action: 'new' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n event_hash = params[:event]\n event_hash[:user_id] = session[:current_user_id]\n event_hash[:rating] = 0\n event_hash[:ratings_count] = 0\n \n @event = Event.new event_hash\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to event_url(@event), notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @interest_area = InterestArea.new(params[:interest_area])\n\n respond_to do |format|\n if @interest_area.save\n format.html { redirect_to @interest_area, notice: 'Interest area was successfully created.' }\n format.json { render json: @interest_area, status: :created, location: @interest_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @interest_area.errors, status: :unprocessable_entity }\n end\n end\n end", "def change_interest\n user = User.find(params[:id])\n if current_user.interested?(user)\n msg = \"I'm <span>interested</span> in this profile\"\n Interest.delay.delete_all([\"user_id = ? and interestable_id = ? and interestable_type = ?\", current_user.id, user.id, \"User\"])\n NetworkUpdate.removeInterestedUpdate(current_user.id, user.id)\n else\n msg = \"Remove <span>interest</span> in profile\"\n current_user.interest!(user)\n NetworkUpdate.delay.createInterestedUpdate(current_user.id, user.id)\n SneakPeekMailer.delay(:queue => 'mailers').interested_email(current_user, user)\n end\n render :text => msg\n end", "def show_interest_data\n @interests = Interest.find_user_interest(current_user.id)\n @category_name = Array.new\n for i in [email protected] do\n @category_name[i] = EventCategoryMaster.find_category_name(@interests[i].category_id).first\n end\n @subcategory_name = Array.new\n for j in [email protected] do\n @subcategory_name[j] = EventCategoryMaster.find_category_name(@interests[j].subcategory_id).first\n end\n @show_interests = Array.new\n for p in [email protected] do\n @show_interests[p] = {\"category_name\" => \"#{@category_name[p].event_cat_name}\", \"subcategory_name\" => \"#{@subcategory_name[p].event_cat_name}\", \"id\" => \"#{@interests[p].id}\"}\n end\n \n end", "def new\n\t\t@interest = Interest.new\t\n\tend", "def create\n @api_v1_mentorship_interest = Api::V1::MentorshipInterest.new(api_v1_mentorship_interest_params)\n\n respond_to do |format|\n if @api_v1_mentorship_interest.save\n format.html { redirect_to @api_v1_mentorship_interest, notice: 'Mentorship interest was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_mentorship_interest }\n else\n format.html { render :new }\n format.json { render json: @api_v1_mentorship_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def api_v1_mentorship_interest_params\n params.fetch(:api_v1_mentorship_interest, {})\n end", "def create\n @mood_datum = MoodDatum.new(mood_datum_params)\n \n respond_to do |format|\n if @mood_datum.save \n params['significant_events'].each do |key,value| \n PatientSignificantEvent.create(:patient_id =>@mood_datum.user_id ,:doctor_id => @mood_datum.doctor_id ,:mood_data_id =>@mood_datum.id ,:comments => value )\n end \n format.html { redirect_to new_mood_datum_path(:patient => current_user.id), notice: 'Mood datum was successfully created.' }\n format.json { render action: 'show', status: :created, location: @mood_datum }\n else\n format.html { render action: 'new' }\n format.json { render json: @mood_datum.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interest }\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html #index.html.erb\n format.json { render json: @interest }\n end\n end", "def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end", "def destroy\n @eventinterest.destroy\n respond_to do |format|\n format.html { redirect_to eventinterests_url, notice: 'Eventinterest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def create\n \t\t@interested = Interested.new(params[:interested])\n\n \t\trespond_to do |format|\n \t\t\tif @interested.save\n \t\t\t\tformat.html{ redirect_to @interested, notice: 'Interested was successfully created.'}\n \t\t\t\tformat.json{ render json: @interested, status: :create, location: @interested }\n \t\t\telse\n \t\t\t\tformat.html { render action: \"new\" }\n \t\t\t\tformat.json { render json: @interested.error, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n \tend", "def list_interests # :norobots:\n store_location\n @title = :list_interests_title.t\n notifications = Notification.find_all_by_user_id(@user.id).sort do |a,b|\n result = a.flavor.to_s <=> b.flavor.to_s\n result = a.summary.to_s <=> b.summary.to_s if result == 0\n result\n end\n interests = Interest.find_all_by_user_id(@user.id).sort do |a,b|\n result = a.target_type <=> b.target_type\n result = (a.target ? a.target.text_name : '') <=>\n (b.target ? b.target.text_name : '') if result == 0\n result\n end\n @targets = notifications + interests\n @pages = paginate_numbers(:page, 50)\n @pages.num_total = @targets.length\n @targets = @targets[@[email protected]]\n end", "def create\n #New itinerary\n @newItinerary = Itinerary.new itin_params\n @newItinerary.save\n #new event and event_itinerary\n @eventArray = event_array\n @eventArray.each do |event|\n event = Event.new(event) #iterate through, add event itinerary to each one with itinerary ID from first save.\n event.save\n @newEventItin = EventItinerary.new(:event_id => event[:id],:itinerary_id => @newItinerary[:id])\n @newEventItin.save\n end\n \n respond_to do |format|\n format.json { render :json => [{:event => @eventArray},{ :itineraries => @newItinerary},{:event_itineraries => @newEventItin} ]}\n end\n end", "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @interest }\n end\n end", "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end", "def interest_rate\n params['interest_rate'] = params['interest_rate'].to_f\n\n old_rate = @@interest_rate\n @@interest_rate = params['interest_rate']\n json_response(old_rate: old_rate, new_rate: @@interest_rate)\n end", "def create \n @idea = Idea.new(idea_params)\n @idea.user_id = current_user.id\n @idea.save!\n if params[:idea][:tags]\n params[:idea][:tags].each do |new_tag|\n tag_title = new_tag[:title]\n tag = Tag.find_by title: tag_title\n if tag.present?\n tag.used = tag.used + 1\n tag.save!\n else\n tag = Tag.new\n tag.title = tag_title.downcase\n tag.used = 1 \n tag.save!\n end\n @idea.tags << tag\n end\n end\n Notification.generate(current_user, @idea)\n Notification.push(@idea) \n render json: @idea.to_json(include: [{user: {only: [:name, :id, :image_url]}}, {comments: {include: {user: {only: [:name, :image_url]}}}}], methods: [:voted])\n end", "def create\n @naievent = Naievent.new(naievent_params)\n\n respond_to do |format|\n if @naievent.save\n format.html { redirect_to @naievent, notice: 'Naievent was successfully created.' }\n format.json { render :show, status: :created, location: @naievent }\n else\n format.html { render :new }\n format.json { render json: @naievent.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @eventslist = Event.create_from_twitter\n \n redirect_to events_url\n \n end", "def new\n @person_interest = PersonInterest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person_interest }\n end\n end", "def create\n @tour_interest_list = TourInterestList.new(tour_interest_list_params)\n\n respond_to do |format|\n if @tour_interest_list.save\n format.html { redirect_to @tour_interest_list, notice: 'Tour interest list was successfully created.' }\n format.json { render :show, status: :created, location: @tour_interest_list }\n else\n format.html { render :new }\n format.json { render json: @tour_interest_list.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.707777", "0.68618846", "0.68135554", "0.65843797", "0.6525929", "0.6335123", "0.6230702", "0.6202513", "0.61847836", "0.6179254", "0.6154558", "0.6091796", "0.60894305", "0.6083123", "0.59956443", "0.5987523", "0.5913445", "0.5896425", "0.5891812", "0.58892655", "0.58678126", "0.58572257", "0.58349854", "0.58166814", "0.5776303", "0.5769624", "0.5754361", "0.5718944", "0.57158417", "0.5705287", "0.57032347", "0.56342655", "0.5630626", "0.56286854", "0.56151426", "0.56151426", "0.55967516", "0.5582699", "0.5567575", "0.554832", "0.55468976", "0.5529548", "0.55004394", "0.55004394", "0.55004394", "0.55004394", "0.55004394", "0.5500216", "0.5484181", "0.5437944", "0.54130435", "0.5405746", "0.5379133", "0.5378931", "0.5377024", "0.53632116", "0.5361413", "0.535815", "0.5356872", "0.5342998", "0.5333366", "0.53190744", "0.5303467", "0.5302746", "0.52990496", "0.52855545", "0.52657735", "0.52494186", "0.5243996", "0.52205026", "0.52068347", "0.5205313", "0.5186183", "0.5169722", "0.51690274", "0.5156162", "0.51324105", "0.5119168", "0.51153153", "0.5101135", "0.5095689", "0.5093879", "0.5079874", "0.5069614", "0.5068632", "0.5063704", "0.50422287", "0.50245786", "0.5019499", "0.5014859", "0.50118625", "0.5005792", "0.500416", "0.4990351", "0.49800354", "0.49660802", "0.49653694", "0.49642026", "0.49614057", "0.4956339" ]
0.70627296
1
PATCH/PUT /eventinterests/1 PATCH/PUT /eventinterests/1.json
def update respond_to do |format| if @eventinterest.update(eventinterest_params) format.html { redirect_to @eventinterest, notice: 'Eventinterest was successfully updated.' } format.json { render :show, status: :ok, location: @eventinterest } else format.html { render :edit } format.json { render json: @eventinterest.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @event_interest = EventInterest.find(params[:id])\n\n respond_to do |format|\n if @event_interest.update_attributes(params[:event_interest])\n format.html { redirect_to @event_interest, notice: 'Event interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n \n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.json { head :ok }\n else\n format.json { render :json => @interest.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n standard_update(Interest, params[:id], interest_params)\n end", "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, notice: 'Interest was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, :notice => 'Interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:event_id])\n @point_of_interest = PointOfInterest.find(params[:id])\n\n respond_to do |format|\n if @point_of_interest.update_attributes(params[:point_of_interest])\n format.html { redirect_to(event_point_of_interest_path, :notice => 'Point of interest was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @point_of_interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n json_body = JSON.parse(request.body.read)\n\n @@event_service.patch_event(json_body, user_id, group_id, event_id)\n\n render status: :ok, text: \"\"\n end", "def update\n respond_to do |format|\n if @interest.update(interest_params)\n format.html { redirect_to @interest, notice: 'Interest was successfully updated.' }\n format.json { render :show, status: :ok, location: @interest }\n else\n format.html { render :edit }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'Foaf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interests = Interests.for_person(@person)[0]\n\n respond_to do |format|\n if @interests.update_attributes(params[:interests])\n flash[:notice] = 'Interests updated.'\n format.html { redirect_to(person_path(:id => @person)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interests.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'FOAF was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_eventinterest\n @eventinterest = Eventinterest.find(params[:id])\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @event.update(event_params)\n render json: @event, status: 201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end", "def update\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n flash[:notice] = 'Interest was successfully updated.'\n format.html { redirect_to(@interest) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @interest.update(interest_params)\n format.html { redirect_to animals_url, notice: 'You sent an interest to the animal' }\n format.json { head :no_content }\n else\n format.html { redirect_to animals_url, notice: @interest.errors.full_messages[0] }\n format.json { head :no_content }\n end\n end\n end", "def update\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n if @myevent.update_attributes(params[:myevent])\n format.html { redirect_to @myevent, notice: 'Myevent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @myevent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @interest.update_attributes(params[:interest])\n format.html { redirect_to @interest, :notice => 'Интересот е успешно ажуриран.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @interest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @person_interest = PersonInterest.find(params[:id])\n\n respond_to do |format|\n if @person_interest.update_attributes(params[:person_interest])\n format.html { redirect_to @person_interest, notice: 'Person interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n# @event.update_eventbrite_event(event_params)\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @interest\n respond_to do |format|\n if @interest.update(interest_params)\n format.html { redirect_to @interest, notice: t('flash.notice.updated.') }\n format.json { render :show, status: :ok, location: @interest }\n else\n format.html { render :edit }\n format.json { render json: @interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @event.update(event_params)\n render json: { location: format_event(@event) }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def update\n return forbidden unless user_is_owner\n return bad_request unless @event.update_attributes(event_params)\n render json: @event, status: :ok\n end", "def update\n\tif @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render json: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @student_interest.update(student_interest_params)\n format.html { redirect_to @student_interest, notice: 'Student interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @student_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @event.update(event_params(params))\n render json: @event, status: 200\n else\n render :json => @event.errors, :status => 422\n end\n end", "def update\n respond_to do |format|\n if @base_event.update(base_event_params)\n format.json { head :no_content }\n else\n format.json { render json: @base_event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #require \"pry\"; binding.pry\n\n update_users\n\n respond_to do |format|\n if @event.update(event_params)\n sync_update @event\n format.html { redirect_to @event, notice: t(\"successfully_updated\", :model => t(\"models.event\")) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_interest.update(user_interest_params)\n format.html { redirect_to @user_interest, notice: 'User interest was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_interest }\n else\n format.html { render :edit }\n format.json { render json: @user_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interest = Interest.find(params[:id])\n if @interest.update_attributes(params[:interest])\n redirect_to interests_path\n else\n redirect_to :action => 'edit', :id => @interest.id\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n @event.update(status: \"Pending\")\n else\n @reopen = true\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.html { render :show }\n end\n end\n end", "def update\r\n @event.update(event_params)\r\n end", "def update\n \n \n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t(:event_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n \n end\n end", "def update\n @idea_event = IdeaEvent.find(params[:id])\n\n respond_to do |format|\n if @idea_event.update_attributes(params[:idea_event])\n format.html { redirect_to @idea_event, notice: 'Idea event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea_event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def pupdate\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(JSON.parse(params[:event]))\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.using(:shard_one).find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n\n\n\n end", "def update\n @event.update(event_params) \n end", "def update\n @interesting = Interesting.find(params[:id])\n\n respond_to do |format|\n if @interesting.update_attributes(params[:interesting])\n format.html { redirect_to @interesting, notice: 'Interesting was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interesting.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def update\n @event_request = EventRequest.find(params[:id])\n\n respond_to do |format|\n if @event_request.update_attributes(params[:event_request])\n format.html { redirect_to @event_request, notice: 'Event request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n @event.tags.clear()\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n if @event.update(params[:event])\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end", "def patch_event(json_body, user_id, group_id, event_id)\n event = Event.find(event_id)\n\n json_body.each do |operation_line|\n if operation_line[\"op\"] == \"add\"\n if operation_line[\"path\"] == \"/voters\"\n email_to_add = operation_line[\"value\"]\n event.voters << Voter.create(email: email_to_add)\n elsif operation_line[\"path\"] == \"/restaurants\"\n\n end\n\n end\n\n end\n end", "def update\n @event.update(event_params)\n end", "def update\n # only the owner can edit his / her profile info\n if current_user.id == @user.id\n respond_to do |format|\n if @user.update(user_params)\n\n # update the user interests, too\n if params[:user_interests]\n\n param_interests = []\n\n # transform the params into integers so they can be compared to the ids\n params[:user_interests].each do |i|\n param_interests << i.to_i\n end\n\n # puts \"INTERESTS PARAMS = \" + param_interests.to_s + \"\\n\"\n\n # get current user_interests\n current_user_interest_ids = current_user.interests.pluck(:id)\n # puts \"CURRENT INTERESTS = \" + current_user_interest_ids.to_s + \"\\n\"\n\n # the ids in params list that are not in current list need to be added\n interests_to_add = param_interests - current_user_interest_ids\n # puts \"INTERESTS TO ADD = \" + interests_to_add.to_s + \"\\n\"\n\n if interests_to_add.count > 0\n interests_to_add.each do |interest_id|\n UserInterest.create(user_id: current_user.id, interest_id: interest_id)\n end\n end\n\n # the ids in current list that are not in params list need to be deleted from user_interests\n interests_to_delete = current_user_interest_ids - param_interests\n # puts \"INTERESTS TO DELETE = \" + interests_to_delete.to_s + \"\\n\"\n\n if interests_to_delete.count > 0\n interests_to_delete.each do |interest_id|\n u = UserInterest.where(user_id: current_user.id, interest_id: interest_id)\n if u\n u.first.destroy\n end\n end\n end\n\n format.json { render :json => {:success=>true, :message=>\"User and user interests was successfully updated.\"} }\n else\n format.json { render :json => {:success=>true, :message=>\"User was successfully updated. No user interests detected.\"} }\n end # end of if params\n else\n format.json { render :json => {:success=>false, :message=>\"User could not be updated.\"} }\n end # end of if .update\n end # end of respond\n else\n respond_to do |format|\n format.json { render :json => {:success=>false, :message=>\"You are not the owner of this profile.\"} }\n end\n end\n end", "def update\n respond_to do |format|\n if @sick_hours_event.update(sick_hours_event_params)\n format.html { redirect_to sick_hours_events_path, notice: 'Sick hours event was successfully updated.' }\n format.json { render :show, status: :ok, location: @sick_hours_event }\n else\n format.html { render :edit }\n format.json { render json: @sick_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n \t\t@interested = Interested.find(params[:id])\n\n \t\trespond_to do |format|\n \t\t\tif @interested.update_attributes(params[:interested])\n \t\t\tformat.html { redirect_to @interested, notice: 'Interested was sucessfully updated.' }\n \t\t\tformat.json {head :no_content }\n \t\t\telse\n \t\t\t\tformat.html { render action: \"edit\" }\n \t\t\t\tformat.json { render json: @interested.error, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n \tend", "def eventinterest_params\n params.require(:eventinterest).permit(:isinterest, :user_id, :events_id)\n end", "def update\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n @event.completion = @event.completedness\n @event.save\n\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #@event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @lunch_event.update(lunch_event_params)\n format.html { redirect_to @lunch_event, notice: 'Lunch event was successfully updated.' }\n format.json { render :show, status: :ok, location: @lunch_event }\n else\n format.html { render :edit }\n format.json { render json: @lunch_event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @interested = Interested.find(params[:id])\n\n respond_to do |format|\n if @interested.update_attributes(params[:interested])\n format.html { redirect_to @interested, notice: 'Interested was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @interested.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n @event.save!\n end\n end", "def update\n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to '/', notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @attend_event.update(attend_event_params)\n format.html { redirect_to events_url, notice: 'Hours successfully updated.' }\n format.json { render :show, status: :ok, location: @attend_event }\n else\n format.html { render :edit }\n format.json { render json: @attend_event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n if @event_event.update_attributes(params[:event_event])\n format.html { redirect_to @event_event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n respond_to do |format|\n if @event.update(event_params)\n\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @event.update(event_params)\r\n format.html { redirect_to @event, notice: 'Event 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: @event.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to edit_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_path, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: events_path(@event) }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @naievent.update(naievent_params)\n format.html { redirect_to @naievent, notice: 'Naievent was successfully updated.' }\n format.json { render :show, status: :ok, location: @naievent }\n else\n format.html { render :edit }\n format.json { render json: @naievent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7378092", "0.7067416", "0.675718", "0.67105275", "0.66952074", "0.66684645", "0.64933866", "0.6488396", "0.64568275", "0.6375166", "0.63739395", "0.6278687", "0.6265169", "0.6237687", "0.6232738", "0.6200686", "0.6192138", "0.6175111", "0.6160488", "0.6145741", "0.61438537", "0.61219394", "0.611962", "0.6113518", "0.6106586", "0.6102043", "0.6089109", "0.6074474", "0.6067463", "0.6037861", "0.60336983", "0.60336983", "0.6029168", "0.60245997", "0.60111237", "0.60076433", "0.6005488", "0.5998395", "0.5997008", "0.5989074", "0.5975696", "0.5967096", "0.59669185", "0.59669185", "0.5957578", "0.59574234", "0.59559214", "0.5953371", "0.59498525", "0.59392625", "0.59318614", "0.59262013", "0.59124285", "0.5898352", "0.58960325", "0.5894556", "0.58929646", "0.5891897", "0.58888334", "0.58888334", "0.58888334", "0.58888334", "0.58888334", "0.58888334", "0.58888334", "0.58888334", "0.58888334", "0.5888586", "0.5886871", "0.5876492", "0.58581656", "0.5855335", "0.5835979", "0.58237976", "0.5819563", "0.58167124", "0.5815549", "0.5813911", "0.58129853", "0.5808793", "0.5808793", "0.5808793", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234", "0.58064234" ]
0.7274615
1
DELETE /eventinterests/1 DELETE /eventinterests/1.json
def destroy @eventinterest.destroy respond_to do |format| format.html { redirect_to eventinterests_url, notice: 'Eventinterest was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @event_interest = EventInterest.find(params[:id])\n @event_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to event_interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end \n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: 'Interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end", "def deleteInterest(interest)\n \n end", "def deleteInterest(interest)\n \n end", "def destroy\n @interesting = Interesting.find(params[:id])\n @interesting.destroy\n\n respond_to do |format|\n format.html { redirect_to interestings_url }\n format.json { head :ok }\n end\n end", "def destroy\n @interests = Interests.find(params[:id])\n @interests.destroy\n flash[:notice] = 'Interests was successfully removed.'\n\n respond_to do |format|\n format.html { redirect_to(interests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @user_interest = UserInterest.find(params[:id])\n @user_interest.destroy\n \n if @user_interest.save\n render json: {\n status: 200,\n message: \"Successfully deleted user interest\",\n user_interests: @user_interest\n }.to_json\n else\n render json: {\n status: 500,\n message: \"Couldn't delete user interest.\",\n errors: @user_interest.errors\n }.to_json\n end\n end", "def destroy\n @myevent = Myevent.find(params[:id])\n @myevent.destroy\n\n respond_to do |format|\n format.html { redirect_to myevents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize @interest\n @interest.destroy\n respond_to do |format|\n format.html { redirect_to interests_url, notice: t('flash.notice.destroied.') }\n format.json { head :no_content }\n end\n end", "def destroy\n @person_interest = PersonInterest.find(params[:id])\n @person_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to person_interests_url }\n format.json { head :no_content }\n end\n end", "def remove_interest\n @interest = Interest.where(\"user_id = ? and property_id= ?\",params[:user_id],params[:property_id])\n @interest.first.destroy\n\n respond_to do |format|\n format.html { redirect_to interests_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @interest = Interest.find(params[:id])\n @interest.destroy\n redirect_to interests_path\n end", "def destroy\n @interest_point.destroy\n respond_to do |format|\n format.html { redirect_to interest_points_url, notice: 'Interest point was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_interest.destroy\n respond_to do |format|\n format.html { redirect_to student_interests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event_request = EventRequest.find(params[:id])\n @event_request.destroy\n\n respond_to do |format|\n format.html { redirect_to event_requests_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_interest.destroy\n respond_to do |format|\n format.html { redirect_to user_interests_url, notice: 'User interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @attend_event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Request successfully rescinded.' }\n format.json { head :no_content }\n end\n end", "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "def destroy\n @idea_event = IdeaEvent.find(params[:id])\n @idea_event.destroy\n\n respond_to do |format|\n format.html { redirect_to idea_events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n \n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to top_index_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @eatvent = Eatvent.find(params[:id])\n @eatvent.destroy\n\n respond_to do |format|\n format.html { redirect_to eatvents_url }\n format.json { head :ok }\n end\n end", "def destroy\n #@event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy_rest\n @page_usage_event = PageUsageEvent.find(params[:id])\n @page_usage_event.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_usage_events_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @hive_event = HiveEvent.find(params[:id])\n @hive_event.destroy\n\n respond_to do |format|\n format.html { redirect_to hive_events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @events = Event.where(event_id: params[:id])\n @events.each.destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete_event\n if params[:id]\n @e = Evento.find(params[:id]).destroy\n end\n render :json => msj = { :status => true, :message => 'ok'}\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to scrappers_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sick_hours_event.destroy\n respond_to do |format|\n format.html { redirect_to sick_hours_events_url, notice: 'Sick hours event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n # @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def delete_event\r\n event = Event.find_by(id: params[:eventid].to_i)\r\n if event.present?\r\n event.update(status: 3)\r\n lt_update_event_status event, 'archived'\r\n render json: SuccessResponse.new(\r\n code: 200,\r\n message: 'Event Deleted.'\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new(\r\n code: 404,\r\n message: 'Event not found!'\r\n ), adapter: :json, status: :not_found\r\n end\r\n\r\n end", "def destroy\n @event_event = Event::Event.find(params[:id])\n @event_event.destroy\n\n respond_to do |format|\n format.html { redirect_to event_events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event.destroy\n\n sync_destroy @event\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def delete_event(event)\n @connection.send(Addressable::URI.parse(events_url + \"/#{event.id}\"), :delete)\n end", "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n\n end", "def destroy\n @invent.destroy\n respond_to do |format|\n format.html { redirect_to invents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_to_client_path(@client) }\n format.json { head :no_content }\n end\n end", "def destroy\n @brochure_interest = BrochureInterest.find(params[:id])\n @brochure_interest.destroy\n\n respond_to do |format|\n format.html { redirect_to(brochure_interests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @interested = Interested.find(params[:id])\n @interested.destroy\n\n respond_to do |format|\n format.html { redirect_to interesteds_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end", "def destroy\n @api_v1_mentorship_interest.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_mentorship_interests_url, notice: 'Mentorship interest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @event_attendance = EventAttendance.find(params[:id])\n @event_attendance.destroy\n\n respond_to do |format|\n format.html { redirect_to event_attendances_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @interest_area = InterestArea.find(params[:id])\n @interest_area.destroy\n\n respond_to do |format|\n format.html { redirect_to interest_areas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @weather_event = WeatherEvent.find(params[:id])\n @weather_event.destroy\n\n respond_to do |format|\n format.html { redirect_to weather_events_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.80704147", "0.75139153", "0.743511", "0.7416739", "0.7384328", "0.72238696", "0.72238696", "0.7210827", "0.7034387", "0.7034387", "0.702601", "0.70212483", "0.70002776", "0.69684386", "0.6940719", "0.69236773", "0.69204783", "0.68932366", "0.68932366", "0.68932366", "0.68875057", "0.6816512", "0.67893016", "0.67831403", "0.6753746", "0.6736826", "0.67298764", "0.6726157", "0.67077696", "0.66865194", "0.6677411", "0.6677133", "0.66755337", "0.6661704", "0.665798", "0.6640174", "0.66353655", "0.6634438", "0.6634229", "0.66317344", "0.66293836", "0.66290385", "0.66226906", "0.66184765", "0.6608257", "0.66060835", "0.6604037", "0.66010106", "0.6597617", "0.659732", "0.6584297", "0.6579321", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.6577244", "0.65754515", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65750396", "0.65706396", "0.65654594", "0.65638167", "0.6563371", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775", "0.6561775" ]
0.7751148
1
Use callbacks to share common setup or constraints between actions.
def set_eventinterest @eventinterest = Eventinterest.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 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 default_action; end", "def my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n 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.6163927", "0.6046165", "0.59465253", "0.59167755", "0.58904207", "0.58346355", "0.577713", "0.5703502", "0.5703502", "0.56531286", "0.56215113", "0.54224145", "0.5410795", "0.5410795", "0.5410795", "0.53924775", "0.5379919", "0.53580743", "0.53401667", "0.53397506", "0.5332605", "0.5312215", "0.5296594", "0.52965283", "0.52957606", "0.5259903", "0.52443177", "0.523896", "0.523896", "0.523896", "0.523896", "0.523896", "0.52329034", "0.52322394", "0.5227445", "0.5222394", "0.5220348", "0.5212759", "0.5207747", "0.5205933", "0.5176468", "0.5173833", "0.5171983", "0.51663405", "0.5159596", "0.5158247", "0.51526845", "0.5152398", "0.5151361", "0.5145775", "0.5140135", "0.51338995", "0.51127726", "0.5112607", "0.5112607", "0.5110613", "0.51067513", "0.5092337", "0.508788", "0.5081578", "0.5080434", "0.50679874", "0.50567716", "0.5051213", "0.5048352", "0.5048352", "0.5035347", "0.5026666", "0.5023127", "0.5016081", "0.50129867", "0.5000684", "0.4999752", "0.49979812", "0.499026", "0.499026", "0.49866846", "0.49800366", "0.49795717", "0.49771172", "0.4968475", "0.4965813", "0.4958072", "0.49561292", "0.4954901", "0.49536785", "0.4953058", "0.49468648", "0.49424478", "0.4932989", "0.49291888", "0.49273813", "0.49271655", "0.4925948", "0.49236968", "0.49203572", "0.49181753", "0.49173692", "0.4916862", "0.49161318", "0.49155986" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def eventinterest_params params.require(:eventinterest).permit(:isinterest, :user_id, :events_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def url_whitelist; end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def permit_request_params\n params.permit(:address)\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.69792545", "0.6781151", "0.67419964", "0.674013", "0.6734356", "0.6591046", "0.6502396", "0.6496313", "0.6480641", "0.6477825", "0.64565", "0.6438387", "0.63791263", "0.63740575", "0.6364131", "0.63192815", "0.62991166", "0.62978333", "0.6292148", "0.6290449", "0.6290076", "0.62894756", "0.6283177", "0.6242471", "0.62382483", "0.6217549", "0.6214457", "0.6209053", "0.6193042", "0.6177802", "0.6174604", "0.61714715", "0.6161512", "0.6151757", "0.6150663", "0.61461", "0.61213595", "0.611406", "0.6106206", "0.6105114", "0.6089039", "0.6081015", "0.6071004", "0.60620916", "0.6019971", "0.601788", "0.6011056", "0.6010898", "0.6005122", "0.6005122", "0.6001556", "0.6001049", "0.59943926", "0.5992201", "0.59909594", "0.5990628", "0.5980841", "0.59669393", "0.59589154", "0.5958826", "0.5957911", "0.5957385", "0.5953072", "0.59526145", "0.5943361", "0.59386164", "0.59375334", "0.59375334", "0.5933856", "0.59292704", "0.59254247", "0.5924164", "0.59167904", "0.59088355", "0.5907542", "0.59064597", "0.5906243", "0.5898226", "0.589687", "0.5896091", "0.5894501", "0.5894289", "0.5891739", "0.58860534", "0.5882406", "0.587974", "0.58738774", "0.5869024", "0.58679986", "0.5867561", "0.5865932", "0.5864461", "0.58639693", "0.58617616", "0.5861436", "0.5860451", "0.58602303", "0.5854586", "0.58537364", "0.5850427", "0.5850199" ]
0.0
-1
GET /fantasy_players GET /fantasy_players.json
def index @fantasy_players = FantasyPlayer.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n player = Player.all\n render json: players, status: 200\n end", "def index\n @players = Player.all\n render json: @players, status: 200\n end", "def index\n @players = Player.all\n render json: @players\n end", "def show\n @team = Team.find(params[:team_id])\n @player = @team.players.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player }\n end\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end", "def show\n respond_to do |format|\n format.json { render json: @player }\n end\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @players }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n render :json => @player\n end", "def show\n render json: @player, status: 200\n end", "def show\n @all_player = AllPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @all_player }\n end\n end", "def show\n @game_player = GamePlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_player }\n end\n end", "def index\n @players = Player.search(params[:team_id], params[:player_forename], params[:player_surename])\n\n respond_to do |format|\n format.html # index.html.erb\n hash = {:players => @players}\n format.json { render :json => hash }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def index\n @players = Player.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @players }\n end\n end", "def list_all_players\n json_output = Player.all.map do |player|\n {\n id: player.id,\n name: player.name,\n image_url: player.image_url,\n }\n end\n\n render :json => json_output\n end", "def player\n fetch('football.players')\n end", "def show\n render json: @player\n end", "def show\n @client_player = ClientPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_player }\n end\n end", "def index\n collection = if request.query_parameters.present?\n Player.where request.query_parameters\n else\n Player.all\n end\n\n @players = collection.order 'first_name'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players.to_json(only: public_attrs) }\n end\n end", "def index\n @players = Player.order(:gamertag_lower).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end", "def show\n @player_game = PlayerGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player_game }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player.to_json(only: public_attrs) }\n end\n end", "def show\n # user = User.find_by_token(params[:token])\n # # @user = User.find(params[:id])\n matches = current_user.matches\n matches.each do |match|\n match['players'] = Array.new(match.users)\n end\n\n render json: {user: current_user, decks: current_user.decks, matches: matches}\n end", "def index\n @players = Player.includes(:team).order('last_name, first_name').paginate(:page=>params[:page], :per_page =>20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end", "def show\n @nfl_team = NflTeam.find(params[:id])\n @team_players = Player.where(\"nfl_team = ?\", @nfl_team.shorthand)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nfl_team }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @player }\n end\n end", "def get_players\n\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @players_prize }\n end\n end", "def show\n render json: @games_leaderboard\n end", "def index\n @players = Player.page params[:page]\n\t respond_with(@players)\n end", "def show\n @pending_players = PendingPlayer.where(\"tournament_id = #{params[:id]}\")\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament }\n end\n end", "def index\n respond_to do |format|\n format.html\n format.json { render json: PlayersDecorator.new(Player.all).all_data }\n end\n end", "def get_players_by_team(team_id)\n response = parse_api_request(\"#{BASE_URL}players/2018/#{team_id}\")[\"players\"]\nend", "def index\n @drafted_players = DraftedPlayer.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @drafted_players }\n end\n end", "def show\n @player_client = PlayerClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_client }\n end\n end", "def index\n players=Player.all\n render json: players, include: [:player_items=>{include:[:item]}, :player_skills=>{include:[:skill]}], except: [:created_at, :updated_at], methods: [:adjusted_stats, :equipped_items, :consumables]\n end", "def show\n @player = Player.where(:uuid => params[:uuid]).first\n if @player\n render :json => { :success => true, :player => @player }\n else\n render :json => { :success => false, :player => {} } , :status => 404\n end\n\n end", "def show\n @player = Player.find(params[:id])\n if @player.games.count >= 1\n @last_team_name = @player.games.find(:last).team_name\n @year = @player.games.first.date.year\n @newest_year = @player.games.last.date.year\n else\n @last_team_name = \"Your team name\"\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @user = User.find(params[:id])\n @teams = TeamPlayer.where(:user_id => params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "def show\n team_decorator = TeamDecorator.new(@player.team)\n respond_to do |format|\n format.html\n format.json do\n render json: {\n player: @player,\n team: team_decorator,\n team_fixtures: team_decorator.fixture_hash,\n position: @player.position\n }\n end\n end\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n end", "def players\n go_fish.players\n end", "def show\n respond_with Player.find(params[:id])\n end", "def sport_players(sport_id, season, **options) = get(\"/sports/#{sport_id}/players\", **options.merge(season:))", "def index\n game = Game.find(params[:game_id])\n @player_games = game.player_games\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @player_games }\n format.json { render :json => @player_games}\n end\n end", "def index\n puts params.inspect\n @api_players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @api_players }\n end\n end", "def show\n @player_game_stat = PlayerGameStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_game_stat }\n end\n end", "def show\n @players = @team.players\n end", "def index\n @players = @game.players\n end", "def index\n @players = @game.players\n end", "def index\n @games = current_user.games\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "def index\n @games_leaderboards = Games::Leaderboard.all\n\n render json: @games_leaderboards\n end", "def index\n\t\t@game = Game.find(params[:game_id])\n\t\t@players = @game.players\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @players }\n\t\tend\n\tend", "def show\n @player_challenge = PlayerChallenge.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player_challenge }\n end\n end", "def show\n @game_tournament = GameTournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_tournament }\n end\n end", "def index\n game = Game.all\n\n render json: game, include: :teams\n end", "def show\n @players = Player.where(team: @team)\n end", "def show\n @gameplay = Gameplay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gameplay }\n end\n end", "def index\n #@turnovers = Turnover.all_season.paginate(:page => params[:page], :per_page => 10) \n @players_found = Player.all \n @players = Array.new\n @players_found.each { |p| \n fantasy = Fantasy.new\n to = Turnover.to_season_by_player(p.id)[0].T_O\n if to.nil? \n next\n else \n fantasy.to = (to * 2)\n end\n gp = Score.gp_season_by_player(p.id)[0].GP\n \n if gp.nil? \n next\n else \n fantasy.gp = gp\n end\n \n p.fantasy = fantasy \n @players.push(p) \n } \n \n @players = @players.paginate(:page => params[:page], :per_page => 10) \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @players }\n end\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def index\n @players = Player.all\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "def get_url(url, params)\n response = @conn.get(url, params)\n JSON.parse(response.body, symbolize_names: true)[:body][:players]\n end", "def show\n\n \t\t\trespond_with @player\n\n \t\tend", "def players\n users\n end", "def index\n @games = Game.available\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @games }\n end\n end", "def show\n @player_promise = PlayerPromise.find(params[:id])\n @player=Player.find(@player_promise.player_id)\n @round=Round.find(ActiveRound.first.round_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_promise }\n end\n end", "def show\n scope = jsonapi_scope(Streak.where(id: params[:id]))\n logger.info \"#{\"*\"*80}IN THE STREAKS CONTROLLER This Here are the team_players: #{instance.team_players.map(&:color).join(\",\")}\"\n instance = scope.resolve.first\n raise JsonapiCompliable::Errors::RecordNotFound unless instance\n render_jsonapi(instance, scope: false)\n end", "def show\n @team_player_day = TeamPlayerDay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team_player_day }\n end\n end", "def show\n @player_record = PlayerRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_record }\n end\n end", "def index\n @players = Player.order 'lower(name)'\n render json: @players, serializer: V1::ApplicationArraySerializer\n end", "def show\n respond_to do |format|\n format.html { @player = Player.find(params[:id]) }\n format.json { render json: Player.find(params[:id]).as_json(:include => [:items, :spells]) }\n end\n end", "def show\n render json: @championship\n end", "def index\n @championships = Championship.all\n\n render json: @championships\n end", "def new\n populate_players\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "def show\n @game = Game.find(params[:id])\n @matches = @game.player_matchups\n @scores = @game.scores\n @match_points = @matches.collect { |mp| @game.match_scores(mp.first, mp.last) }\n @net_points = @game.net_points\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "def create\n @fantasy_team_player = FantasyTeamPlayer.create(team_id: @team.id, player_id: params[:player_id])\n unless @fantasy_team_player.new_record?\n render json: @fantasy_team_player, status: :ok, include: [:player]\n else\n render json: error_messages_on_create, status: :unprocessable_entity\n end\n end", "def index\n @players = @tournament.players\n end", "def index\n @players_prizes = PlayersPrize.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players_prizes }\n end\n end", "def show\n @game = Game.find(params[:game_id])\n @participant = Participant.find(params[:participant_id])\n respond_to do |format|\n format.html\n format.json { render json: @participant }\n end\n end", "def index\n @team_players = TeamPlayer.all\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @players }\n end\n end", "def show\n @user = User.find(params[:user_id]) \n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game }\n end\n end" ]
[ "0.76091397", "0.7530982", "0.74527204", "0.7359775", "0.7333973", "0.7275735", "0.7219038", "0.71818036", "0.71559155", "0.71443516", "0.7123106", "0.7118635", "0.7105937", "0.7105937", "0.7105937", "0.7105937", "0.7105937", "0.709734", "0.7075563", "0.70476687", "0.70268095", "0.69860405", "0.6970574", "0.69374275", "0.69035536", "0.6878135", "0.68661064", "0.68522376", "0.68349767", "0.67799336", "0.67671365", "0.6766986", "0.6755878", "0.6754071", "0.6747307", "0.6745376", "0.6742774", "0.67039984", "0.66697353", "0.6664741", "0.66600645", "0.6654692", "0.66508174", "0.664669", "0.6630371", "0.6600879", "0.65947604", "0.6585821", "0.65752393", "0.6547229", "0.65439904", "0.65388", "0.65346897", "0.65338564", "0.65338564", "0.6509585", "0.64950955", "0.64837873", "0.6477818", "0.6471718", "0.6467037", "0.64652544", "0.64620435", "0.64587176", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6451839", "0.6450353", "0.6448687", "0.6440609", "0.6434473", "0.6430898", "0.6423825", "0.6412535", "0.6405601", "0.6404937", "0.6401421", "0.64013666", "0.63989747", "0.6393067", "0.6392508", "0.639082", "0.6387003", "0.6380459", "0.637257", "0.6365958", "0.63604784", "0.6359077", "0.6344507" ]
0.7201186
7
GET /fantasy_players/1 GET /fantasy_players/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @team = Team.find(params[:team_id])\n @player = @team.players.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player }\n end\n end", "def index\n player = Player.all\n render json: players, status: 200\n end", "def show\n @player = Player.find(params[:id])\n\n render :json => @player\n end", "def index\n @players = Player.all\n render json: @players, status: 200\n end", "def show\n respond_to do |format|\n format.json { render json: @player }\n end\n end", "def index\n @players = Player.all\n render json: @players\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @game_player = GamePlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_player }\n end\n end", "def show\n @all_player = AllPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @all_player }\n end\n end", "def show\n render json: @player, status: 200\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end", "def show\n @client_player = ClientPlayer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client_player }\n end\n end", "def show\n render json: @player\n end", "def show\n @player_game = PlayerGame.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player_game }\n end\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @players }\n end\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player.to_json(only: public_attrs) }\n end\n end", "def show\n @player = Player.where(:uuid => params[:uuid]).first\n if @player\n render :json => { :success => true, :player => @player }\n else\n render :json => { :success => false, :player => {} } , :status => 404\n end\n\n end", "def index\n @fantasy_players = FantasyPlayer.all\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @player }\n end\n end", "def show\n @player_client = PlayerClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_client }\n end\n end", "def show\n @player = Player.find(params[:id])\n if @player.games.count >= 1\n @last_team_name = @player.games.find(:last).team_name\n @year = @player.games.first.date.year\n @newest_year = @player.games.last.date.year\n else\n @last_team_name = \"Your team name\"\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def index\n @players = Player.search(params[:team_id], params[:player_forename], params[:player_surename])\n\n respond_to do |format|\n format.html # index.html.erb\n hash = {:players => @players}\n format.json { render :json => hash }\n end\n end", "def player\n fetch('football.players')\n end", "def index\n @players = Player.all\n auth!\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @players }\n end\n end", "def show\n @nfl_team = NflTeam.find(params[:id])\n @team_players = Player.where(\"nfl_team = ?\", @nfl_team.shorthand)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nfl_team }\n end\n end", "def show\n @pending_players = PendingPlayer.where(\"tournament_id = #{params[:id]}\")\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament }\n end\n end", "def list_all_players\n json_output = Player.all.map do |player|\n {\n id: player.id,\n name: player.name,\n image_url: player.image_url,\n }\n end\n\n render :json => json_output\n end", "def index\n collection = if request.query_parameters.present?\n Player.where request.query_parameters\n else\n Player.all\n end\n\n @players = collection.order 'first_name'\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players.to_json(only: public_attrs) }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @players_prize }\n end\n end", "def show\n @player_game_stat = PlayerGameStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_game_stat }\n end\n end", "def show\n respond_with Player.find(params[:id])\n end", "def index\n @players = Player.order(:gamertag_lower).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end", "def get_players_by_team(team_id)\n response = parse_api_request(\"#{BASE_URL}players/2018/#{team_id}\")[\"players\"]\nend", "def show\n @player_challenge = PlayerChallenge.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @player_challenge }\n end\n end", "def show\n @user = User.find(params[:id])\n @teams = TeamPlayer.where(:user_id => params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end", "def show\n @gameplay = Gameplay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gameplay }\n end\n end", "def show\n render json: @games_leaderboard\n end", "def show\n @player_record = PlayerRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_record }\n end\n end", "def show\n @player_promise = PlayerPromise.find(params[:id])\n @player=Player.find(@player_promise.player_id)\n @round=Round.find(ActiveRound.first.round_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_promise }\n end\n end", "def show\n team_decorator = TeamDecorator.new(@player.team)\n respond_to do |format|\n format.html\n format.json do\n render json: {\n player: @player,\n team: team_decorator,\n team_fixtures: team_decorator.fixture_hash,\n position: @player.position\n }\n end\n end\n end", "def index\n @players = Player.includes(:team).order('last_name, first_name').paginate(:page=>params[:page], :per_page =>20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end", "def show\n @game_tournament = GameTournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_tournament }\n end\n end", "def show\n scope = jsonapi_scope(Streak.where(id: params[:id]))\n logger.info \"#{\"*\"*80}IN THE STREAKS CONTROLLER This Here are the team_players: #{instance.team_players.map(&:color).join(\",\")}\"\n instance = scope.resolve.first\n raise JsonapiCompliable::Errors::RecordNotFound unless instance\n render_jsonapi(instance, scope: false)\n end", "def show\n # user = User.find_by_token(params[:token])\n # # @user = User.find(params[:id])\n matches = current_user.matches\n matches.each do |match|\n match['players'] = Array.new(match.users)\n end\n\n render json: {user: current_user, decks: current_user.decks, matches: matches}\n end", "def index\n respond_to do |format|\n format.html\n format.json { render json: PlayersDecorator.new(Player.all).all_data }\n end\n end", "def index\n @players = Player.page params[:page]\n\t respond_with(@players)\n end", "def show\n render json: Game.find(params[:id])\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @player = Player.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player }\n end\n end", "def show\n @game = Game.find(params[:game_id])\n @participant = Participant.find(params[:participant_id])\n respond_to do |format|\n format.html\n format.json { render json: @participant }\n end\n end", "def show\n @game = Game.find(params[:id])\n render json: @game, status: 200\n end", "def show\n @team = Team.find(params[:id])\n\n render json: @team\n end", "def show\n @championship = Championship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @championship }\n end\n end", "def show\n respond_to do |format|\n format.html { @player = Player.find(params[:id]) }\n format.json { render json: Player.find(params[:id]).as_json(:include => [:items, :spells]) }\n end\n end", "def index\n @players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def index\n @team = Team.find(params[:team_id])\n @players = @team.players\n end", "def show\n @ultimate_team = UltimateTeam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ultimate_team }\n end\n end", "def get_players\n\n end", "def show\n @team_player_day = TeamPlayerDay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @team_player_day }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "def show\n team = Team.find_by(:id => params[:id])\n render :json => team\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def index\n players=Player.all\n render json: players, include: [:player_items=>{include:[:item]}, :player_skills=>{include:[:skill]}], except: [:created_at, :updated_at], methods: [:adjusted_stats, :equipped_items, :consumables]\n end", "def show\n @user = User.find(params[:user_id]) \n @game = @user.games.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game }\n end\n end", "def show\n @tournament = Tournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tournament }\n end\n end", "def create\n @fantasy_team_player = FantasyTeamPlayer.create(team_id: @team.id, player_id: params[:player_id])\n unless @fantasy_team_player.new_record?\n render json: @fantasy_team_player, status: :ok, include: [:player]\n else\n render json: error_messages_on_create, status: :unprocessable_entity\n end\n end", "def show\n @player_statistic = PlayerStatistic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_statistic }\n end\n end", "def show\n\n \t\t\trespond_with @player\n\n \t\tend", "def show\n @player = Player.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n end\n end", "def new\n populate_players\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "def show\n @players = @team.players\n end", "def new\n @all_player = AllPlayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @all_player }\n end\n end", "def index\n @drafted_players = DraftedPlayer.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @drafted_players }\n end\n end", "def index\n @matches = Match.where(\"player2_id IS NOT NULL\").order(\"#{:id} desc\")\n\n respond_to do |format|\n format.html { @matches }\n format.json { render json: @matches}\n end\n end", "def show\n @game_server = Game::Server.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game_server }\n end\n end", "def index\n puts params.inspect\n @api_players = Player.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @api_players }\n end\n end", "def show\n @player = Player.find(params[:id])\n @team\n if params[:team_id]\n @team = Team.find(params[:team_id])\n end \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @player }\n end\n end", "def show\n @player = params[:username].blank? ? current_player : Player.find_by_username(params[:username])\n\n respond_to do |format|\n if @player\n @ratings = @player.ratings\n authorize! :show, @player\n\n format.html # show.html.erb\n format.json { render json: @player }\n else\n format.html { redirect_to root_url, :alert => 'Profile does not exist.'}\n format.json { render :nothing => true }\n end\n end\n end", "def show\n @player = Player.includes(:photos,:team).find(params[:id])\n @stats = BattingStat.where('player_id =?', params[:id]).order('batting_year desc')\n \n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player }\n end\n end", "def new\n @client_player = ClientPlayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client_player }\n end\n end", "def show\n @default_player_datum = DefaultPlayerDatum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @default_player_datum }\n end\n end", "def get_url(url, params)\n response = @conn.get(url, params)\n JSON.parse(response.body, symbolize_names: true)[:body][:players]\n end", "def show\n @user = User.find_by_id(params[:id])\n\n if @user\n render json: @user.to_json(include: [:games]), status: 200\n else\n render json: {error: \"User not found\"}, status: 404\n end\n end", "def show\n render json: @championship\n end", "def show\n @opponent = Opponent.find(params[:id])\n render json: @opponent\n end", "def show\n @player = Player.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n end\n end", "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end", "def show\n @game = Game.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @game }\n end\n end" ]
[ "0.7389259", "0.7389208", "0.7374817", "0.73298615", "0.7297435", "0.7257542", "0.7250481", "0.7250481", "0.7250481", "0.7250481", "0.7250481", "0.7191598", "0.7180427", "0.7172236", "0.717068", "0.7164944", "0.69943285", "0.6953005", "0.6947138", "0.6937913", "0.6922101", "0.6904811", "0.6902787", "0.68892306", "0.68796134", "0.687277", "0.68563724", "0.68482804", "0.67931527", "0.67700934", "0.6735472", "0.67168885", "0.6701962", "0.66732305", "0.6668177", "0.66681224", "0.66420364", "0.6615396", "0.66040117", "0.6590531", "0.65890044", "0.65888107", "0.6558954", "0.65439016", "0.6542591", "0.6540807", "0.6537364", "0.6521599", "0.6506501", "0.6498059", "0.6487781", "0.648397", "0.648397", "0.648397", "0.648397", "0.648397", "0.648397", "0.648397", "0.648397", "0.648397", "0.648397", "0.6479901", "0.64758", "0.6473243", "0.64667344", "0.64559025", "0.6454604", "0.64497036", "0.64487803", "0.64484644", "0.64346117", "0.6429068", "0.64190286", "0.64144576", "0.64071494", "0.6404296", "0.64040124", "0.6401211", "0.63949454", "0.6392382", "0.63821447", "0.6378812", "0.6376959", "0.6371423", "0.6371208", "0.6365551", "0.6360863", "0.6360444", "0.63521963", "0.63484126", "0.6347694", "0.63442826", "0.634359", "0.63420814", "0.6341318", "0.63394403", "0.63336843", "0.63326836", "0.6329592", "0.6329592", "0.6329592" ]
0.0
-1
POST /fantasy_players POST /fantasy_players.json
def create @fantasy_player = FantasyPlayer.new(fantasy_player_params) # raise @fantasy_player.to_yaml respond_to do |format| if @fantasy_player.save Pusher['dashboard'].trigger('refresh_dashboard', { message: 'refreshing dashboard' }) fantasy_draft = FantasyDraft.find(@fantasy_player.fantasy_draft_id) fantasy_draft.player_id = nil fantasy_draft.save format.html { redirect_to fantasy_league_fantasy_draft_manager_path(@fantasy_player.fantasy_league_id, @fantasy_player.fantasy_draft_id), notice: 'Fantasy player was successfully created.' } format.json { render :show, status: :created, location: @fantasy_player } else format.html { render :new } format.json { render json: @fantasy_player.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @fantasy_team_player = FantasyTeamPlayer.create(team_id: @team.id, player_id: params[:player_id])\n unless @fantasy_team_player.new_record?\n render json: @fantasy_team_player, status: :ok, include: [:player]\n else\n render json: error_messages_on_create, status: :unprocessable_entity\n end\n end", "def create\n player = Player.create(player_params)\n render json: player, status: 201\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n @players = Player.all\n @players.each do |p|\n if p.id != @player.id\n @team = Team.create(name: p.name[0, 3] + @player.name[0, 3] + (p.id + @player.id).to_s, player_ids: [p.id, @player.id])\n else\n end\n end\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n json = ActiveSupport::JSON.decode(params[:player])\n @player = Player.new\n @player.gender = json[\"gender\"]\n @player.username = json[\"username\"]\n @player.uuid = json[\"uuid\"]\n @player.last_location = json[\"location\"]\n @player.player_monsters = [ PlayerMonster.new({ :nickname => json[\"starting_monster\"][\"nickname\"],\n :monster_id => json[\"starting_monster\"][\"id\"],\n :caught_location => json[\"location\"]\n }) ]\n if @player.save\n render :json => { :success => true, :player => @player } , :status => 200\n else\n render :json => { :success => false, :message => @player.errors } , :status => 400\n end\n end", "def create\n @player = Player.new(params[:player])\n \n if @player.save\n render :json => @player, :status => :created, :location => @player\n else\n render :json => @player.errors, :status => :unprocessable_entity\n end\n end", "def create\n @player = Player.new(player_params)\n\n if @player.save\n render json: @player, status: :created, location: @player\n else\n render json: {errors: @player.errors}, status: :unprocessable_entity\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n# ToDo 0 => Wenn Spieler erstellt wurde, schließe das Fenster und aktualisiere die Spielerliste bzw. die Spielerübersicht\n format.html { redirect_to home_path, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n puts(params);\n @player = Player.new(player_params)\n \n respond_to do |format|\n if @player.save\n # Tell the playerMailer to send a welcome email after save\n # @user_player = Userplayer.new(user_id: @user.id, player_id: @player_id)\n # if @user_player.save\n @tournament.players << @player\n # @tournament.update_attribute(num_players: @tournament.num_players + 1)\n format.html { redirect_to(root_path, notice: 'player was successfully added.') }\n format.json { render json: @player, status: :created, location: @player }\n # end\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.json { render json: @player, status: :created }\n else\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n player = Player.new(player_params)\n if player.save\n render json: player, status: 201, location: [:api, player]\n else\n failed_to_create(player, \"player\")\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to \"/players/new\", notice: (@player.name + ' was successfully created.') }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to root_path, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.find(params[:team_id])\n @player = @team.players.build(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to([@player.team, @player], :notice => 'Player was successfully created.') }\n format.json { render :json => @player, :status => :created, :location => [@player.team, @player] }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @teams_player = TeamsPlayer.new(teams_player_params)\n\n respond_to do |format|\n if @teams_player.save\n format.html { redirect_to @teams_player, notice: 'Teams player was successfully created.' }\n format.json { render :show, status: :created, location: @teams_player }\n else\n format.html { render :new }\n format.json { render json: @teams_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.create!(player_params) # anticipated possible exceptions rescued in BaseController\n render json: @player, status: :created\n end", "def create\n @team_player = TeamPlayer.new(team_player_params)\n\n respond_to do |format|\n if @team_player.save\n format.html { redirect_to @team_player, notice: 'Team player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_player }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @game = Game.new(game_params)\n\n params[:players].each do |player_name|\n p = Player.new\n p.name = player_name\n p.game = @game\n p.save!\n end\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n \t\t\t@player = Player.new player_params\n\n \t\t\tif @player.save\n\n \t\t\t\trender json: @player,status: :created\n\n \t\t\telse\n\n \t\t\t\trender json: {error: true,errors: @player.errors},status: :unprocessable_entity\n\n \t\t\tend\n\n \t\tend", "def create\n @player = Player.new(player_params)\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: \"Player was successfully created.\" }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n event \"create\", :player, @player.id, description: \"#{current_player.name} created player #{@player.name}\"\n format.html { redirect_to @player, flash: { success: 'Player was successfully created.' } }\n format.json { render json: @player.to_json(only: public_attrs), status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n @player.user = current_user\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @game_player = GamePlayer.new(game_player_params)\n\n respond_to do |format|\n if @game_player.save\n format.html { redirect_to @game_player, notice: \"Game player was successfully created.\" }\n format.json { render :show, status: :created, location: @game_player }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \t#Add player to playground\n @playground = current_playground\n @playgrounds = Playground.all\n #Reset player question variables\n\t@player = Player.find(params[:player_id])\n\[email protected]_attribute(:number_response, 0)\n\[email protected]_attribute(:correct, -1)\n\[email protected]_attribute(:time, 1000)\n\[email protected]_attribute(:winner, -1)\n\t\n\t@game_player = @playground.game_players.build(player: @player)\n\t\n respond_to do |format|\n if @game_player.save\n format.html { redirect_to board_url }\n format.js\n format.json { render json: @game_player, status: :created, location: @game_player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n @player.game = @game\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to game_player_path(id: @player.id), notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n tournament = Tournament.open.last\n\n if tournament\n @player = tournament.players.new name: params[:name],\n key: SecureRandom.uuid\n if @player.valid?\n @player.save!\n message = { :name => @player.name,\n :key => @player.key,\n :message => @player.key }\n else\n message = { :message => \"You must register with a valid and unique player name.\" }\n end\n\n respond_to do |format|\n format.json { render :json => message }\n format.xml { render :xml => message }\n format.html { redirect_to '/pages/registration', :notice => message[:message] }\n end\n else\n respond_to do |format|\n format.json { render_not_found \"The tournament is currently closed.\" }\n format.xml { render_not_found \"The tournament is currently closed.\" }\n format.html { redirect_to '/pages/registration', :alert => \"The tournament is currently closed.\" }\n end\n end\n end", "def fantasy_player_params\n params.require(:fantasy_player).permit(:fantasy_league_id, :fantasy_team_id, :fantasy_draft_id, :player_id, :price)\n end", "def create\n puts params\n game = CreateGame.new(\n max_rounds: params[:max_rounds],\n draw_time: params[:draw_time],\n ).perform\n player = CreatePlayer.new(\n username: params[:username],\n game: game,\n creator: true\n ).perform\n\n if game.persisted? && player.persisted?\n session[:uuid] = player.uuid\n redirect_to player_path\n else\n render json: { ok: 'gra nie zapisana :(' }\n end\n end", "def create\n # The data is only in json-format in this example\n player = Player.new(player_params) # using strong parameters\n\n if player.save\n # ok respond with the created object (team)\n respond_with player, status: :created\n else\n # render or error message\n error = ErrorMessage.new(\"Could not create the resource. Bad parameters?\", \"Could not create the resource!\" )\n render json: error, status: :bad_request # just json in this example\n end\n\n end", "def create\n @player = Player.new(player_params)\n respond_to do |format|\n if @player.save\n EventMailer.new_player(@player).deliver\n format.html { redirect_to page_thank_you_path }\n format.json { render action: 'show', status: :created, location: @player }\n else\n format.html { render action: 'new' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @client_player = ClientPlayer.new(params[:client_player])\n\n respond_to do |format|\n if @client_player.save\n format.html { redirect_to @client_player, notice: 'Client player was successfully created.' }\n format.json { render json: @client_player, status: :created, location: @client_player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @all_player = AllPlayer.new(params[:all_player])\n\n respond_to do |format|\n if @all_player.save\n format.html { redirect_to @all_player, notice: 'All player was successfully created.' }\n format.json { render json: @all_player, status: :created, location: @all_player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @all_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @gameplayer = Gameplayer.new(gameplayer_params)\r\n\r\n respond_to do |format|\r\n if @gameplayer.save\r\n format.html { redirect_to @gameplayer, notice: \"Gameplayer was successfully created.\" }\r\n format.json { render :show, status: :created, location: @gameplayer }\r\n else\r\n format.html { render :new, status: :unprocessable_entity }\r\n format.json { render json: @gameplayer.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def player_params\n params.require(:player).permit(:team_id, :jersey_number, :first_name, :last_name)\n end", "def create\n user = Player.create!(player_params)\n session[:user_id] = user.id\n \n if user.valid?\n render json: player, status: :created\n else\n render json: { errors: user.errors.full_messages }, status: :unprocessable_entity\n end\n end", "def create\n @group_player = GroupPlayer.new(group_player_params)\n\n respond_to do |format|\n if @group_player.save\n format.html { redirect_to @group_player, notice: 'Group player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group_player }\n else\n format.html { render action: 'new' }\n format.json { render json: @group_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n session[:current_player] = @player\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n flash[:notice] = \"Player was created successfully.\" if @player.save\n respond_with @player\n end", "def create\n @attribute_player = AttributePlayer.new(attribute_player_params)\n\n respond_to do |format|\n if @attribute_player.save\n format.html { redirect_to @attribute_player, notice: 'Attribute player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @attribute_player }\n else\n format.html { render action: 'new' }\n format.json { render json: @attribute_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n plan_id = params[:player].delete(:plan_id)\n travel_date_year = params[:player].delete(:travel_date_year)\n travel_date_season = params[:player].delete(:travel_date_season)\n @player = Player.new(player_params)\n @player.plan = Plan.find(plan_id)\n @player.travel_date = \"#{travel_date_season}/#{travel_date_year}\"\n @player.password = params[:player][:email]\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to active_players_path, notice: 'Player was successfully created.' }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n @player.save\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to [:admin, @player], notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player_game = PlayerGame.new(params[:player_game])\n\n respond_to do |format|\n if @player_game.save\n format.html { redirect_to @player_game, :notice => 'Player game was successfully created.' }\n format.json { render :json => @player_game, :status => :created, :location => @player_game }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @player_game.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n flash[:notice] = 'Se guardó el nuevo Player.' if @player.save\n respond_with(@player)\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html {\n redirect_to @player, notice: I18n.t(\"messages.players.create.success\")\n }\n else\n format.html {\n @errors = @player.errors\n render action: \"new\"\n }\n end\n end\n end", "def create\n @game = current_user.games_as_player1.new(params[:game])\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n populate_players\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(player_params)\n\n respond_to do |format|\n if @player.save\n session[:player_id] = @player.id\n session[:new_player] = true\n if session[:creator]\n @player.game.update(creator: @player.id)\n end\n format.turbo_stream\n format.html { redirect_to @player.game, notice: \"Player was successfully created.\" }\n format.json { render :show, status: :created, location: @player }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n player_params = {\"name\"=>room_params[:leader], score: 0, lives: 2}\n \n @room = Room.new(room_params)\n @room.round = 0\n\n respond_to do |format|\n if @room.save\n @player = @room.players.create(player_params)\n if @player.save\n session[:player_id] = @player.id\n format.html { redirect_to @room, notice: 'Room and Player were successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n @player.create_activity :create, owner: current_user\n format.html { redirect_to @player, notice: 'Player was successfully created.' }\n format.json { render json: @player, status: :created, location: @player }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def player_params\n params.require(:player).permit(:name, :initials, :team_id)\n end", "def create\n @player = Player.new(player_params)\n\n if @player.save\n flash[:notice] = 'Player was successfully created.'\n respond_with @player\n else\n render action: :new\n end\n end", "def create\n @game = Game.new\n #create the first player\n first_player = Player.new\n first_player.name = params[:first_player_name]\n first_player.game = @game\n\n #create the second player\n second_player = Player.new\n second_player.name = params[:second_player_name]\n second_player.game = @game\n\n # add first and second players to the game object\n @game.first_player = first_player\n @game.second_player = second_player\n\n respond_to do |format|\n if @game.save\n #create a new game round using a redirect to new_game_round_path\n format.html { redirect_to new_game_round_path(@game), notice: t(\"games.successfully_created\") }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n populate_players\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @game }\n end\n end", "def player_params\n params.require(:player).permit(:first_name, :last_name, :positions, :bats, :throws, :height, :weight, :hometown, :school, :graduation_year, :gpa, :summer_team, :college_interests, :academic_interests, :team_id, :number, :img, :fastball, :breaking_ball, :changeup, :field_velo, :sixty_yd, :thirty_yd, :l_drill, :broad_jump, :med_ball)\n end", "def player_params\n params.require(:player).permit(:first_name, :last_name, :number, :team_id)\n end", "def player_params\n params.require(:player).permit(:first_name, :email, :last_name)\n end", "def player_params\n params.require(:player).permit(:first_name, \n :last_name, \n :phone, \n :email, \n :team_id, \n :password,\n :parent_first_name, \n :parent_last_name, \n :parent_email, \n :parent_email2,\n :parent_cell, \n :emergency_phone, \n :uniform_number,\n :home_town,\n :team_preference,\n :grade,\n :dob)\n end", "def create\n @player = Player.new(player_params)\n @player.user = current_user\n # automatically create a new team for the user if there isn't one already\n unless @player.team || @player.name.blank?\n team = Team.find_or_initialize_by(name: \"#{@player.name}'s Team\", code: @player.name.upcase)\n @player.team = team if team.save\n end\n respond_to do |format|\n if @player.save\n format.html { redirect_to(@player, :notice => 'Player was successfully created.') }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n team.destroy if team\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @player_promise = PlayerPromise.new(params[:player_promise])\n\n respond_to do |format|\n if @player_promise.save\n format.html { redirect_to @player_promise, notice: 'Player promise was successfully created.' }\n format.json { render json: @player_promise, status: :created, location: @player_promise }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player_promise.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.find_by_name(params[:team][:team_name])\n if @team.nil?\n @team = Team.new(captain_id: params[:team][:captain_id],\n\t\t team_name: params[:team][:team_name])\n\n respond_to do |format|\n if @team.save\n format.json { render json: @team, status: :created, location: @team }\n if params[:players]\n \tTeamPlayers.create(params[:players], team_name: @team.name)\n end\n else\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n else \n Team.update(params[:team])\n end\n end", "def player_params\n params.require(:player).permit(\n :name,\n :birthday,\n :cpf,\n :rg,\n :phones,\n :email,\n :address_street,\n :address_number,\n :address_complement,\n :address_neighborhood,\n :address_cep,\n :address_city,\n :address_state,\n :responsible_name,\n :responsible_cpf,\n :responsible_phones,\n :responsible_email,\n :sport_name,\n :headquarter,\n :conclusion_date,\n :signing_situation,\n :signing_value,\n :signing_payment_mode,\n :advisory_situation,\n :advisory_value,\n :advisory_payment_mode,\n :advisory_notes,\n :plan_end_date,\n :platform_payment_mode,\n :platform_payment_mode,\n :platform_parcels,\n :platform_notes,\n :active\n )\n end", "def player_params\n params.require(:player).permit(:name, :email)\n end", "def create\n @game_session_player = GameSessionPlayer.new(game_session_player_params)\n\n respond_to do |format|\n if @game_session_player.save\n format.html { redirect_to @game_session_player, notice: 'Game session player was successfully created.' }\n format.json { render :show, status: :created, location: @game_session_player }\n else\n format.html { render :new }\n format.json { render json: @game_session_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n flash[:notice] = 'Api::Player was successfully created.'\n format.html { redirect_to(@player) }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def player_params\n params.require(:player).permit(:name, :tickets, :raffle_id)\n end", "def player_params\n params.require(:player).permit(:mtu_id, :first_name, :last_name, :nickname, :email, :profile_pic, :remove_profile_pic, :major, :hometown, :position, :height_feet, :height_inches, :years_played, :description, :autocomplete)\n end", "def player_params\n # This is json\n json_params = ActionController::Parameters.new( JSON.parse(request.body.read) )\n json_params.require(:player).permit(:name, :age, :team_id)\n\n end", "def create\n @game = Game.new(params[:game])\n\t\n #First update the players table to indicate who is playing this game\n set_player_availability(params)\n \n #Create a team to hold the home team players\n home_team = Team.new\n home_team.name = params[:home_team_name]\n home_team.save\n @game.home_team_id = home_team.id\n \n #Create a team to hold the away team players\n away_team = Team.new\n away_team.name = params[:away_team_name]\n away_team.save\n @game.away_team_id = away_team.id\n \n #Create home and away teams from available players\n build_teams(home_team, away_team)\n \n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render json: @game, status: :created, location: @game }\n else\n format.html { render action: \"new\" }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_player\n @team.add_player(@player, @jersey)\n\n redirect_to team_path(@team)\n end", "def player_params\n params.require(:player).permit(:first_name, :last_name, :email, :rank)\n end", "def player_params\n params.require(:player).permit(:nombre, :apelidos, :dni, :tarjetaSanitaria, :direccion, :cp, :localidad, :provincia, :telefono, :email, :nombreMadre, :telefonoMadre, :nombrePadre, :telefonoPadre, :direcDuranteActividad, :altura, :peso, :talla, :seNadar, :enfermedades, :alergias, :grupoSanguineo, :problemasAuditivos, :centroEstudios, :categoria, :club, :entrenadorActual, :telefonoEntrenador)\n end", "def create\n @game = Game.find(params[:game_id])\n if @game.password == params[:game_password] then\n @team = Team.new\n @team.name = params[:name]\n @team.game_id = params[:game_id]\n \n @leader = Player.find(params[:leader_id])\n @team.leader_id = @leader.id\n\n respond_to do |format|\n if @team.save\n format.xml { render :xml => @team, :status => :created, :location => @team }\n format.json { render :json => @team, :status => :created, :location => @team }\n @leader.team_id = @team.id\n @leader.save\n else\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n else\n head :unauthorized\n end\n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n format.html { redirect_to(@player, :notice => 'Player was successfully created.') }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def player_params\n params.require(:player).permit(:first_name, :last_name, :nick_name, :dob, :email, :phone_number)\n end", "def new\n @team = Team.find(params[:team_id])\n @player = @team.players.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @player }\n end\n end", "def player_params\n params.require(:player).permit(:gamer_tag, :points, :participations,\n :self_assessment, :tournament_experience, :comment, :best_rank, :wins,\n :losses, :main_characters, :created_at, :updated_at, :canton, :gender,\n :birth_year, :prefix, :discord_username)\n end", "def player_params\n params.require(:player).permit(:game_id, :firstname, :lastname, :position)\n end", "def create\n @drafted_player = DraftedPlayer.new(drafted_player_params)\n\n respond_to do |format|\n if @drafted_player.save\n format.html { redirect_to @drafted_player, notice: 'Drafted player was successfully created.' }\n format.json { render action: 'show', status: :created, location: @drafted_player }\n else\n format.html { render action: 'new' }\n format.json { render json: @drafted_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @team = Team.new(params[:team])\n\t\t\n\t\[email protected] = Player.new(params[:player1]); @team.player2 = Player.new(params[:player2]); @team.player3 = Player.new(params[:player3]);\n\t\[email protected] = Player.new(params[:player4]); @team.player5 = Player.new(params[:player5]); @team.player6 = Player.new(params[:player6]);\n\t\[email protected] = Player.new(params[:player7]); @team.player8 = Player.new(params[:player8]); @team.player9 = Player.new(params[:player9]);\n\t\[email protected] = Player.new(params[:player10]); @team.player11 = Player.new(params[:player11]); @team.player12 = Player.new(params[:player12]);\n\t\[email protected] = Player.new(params[:player13]); @team.player14 = Player.new(params[:player14]); @team.player15 = Player.new(params[:player15]);\n\t\[email protected] = Player.new(params[:player16]); @team.player18 = Player.new(params[:player18]); @team.player19 = Player.new(params[:player19]);\n\t\[email protected] = Player.new(params[:player20]);\n\n respond_to do |format|\n if @team.save\n format.html { redirect_to(@team, :notice => 'Team was successfully created.') }\n format.xml { render :xml => @team, :status => :created, :location => @team }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end", "def createPlayer(params)\n \n # Create a hash\n doc = {:type => \"Person\"}\n \n # Set the name\n doc[:name] = params[\"name\"]\n \n # Set the email\n doc[:email] = params[\"email\"]\n \n # Set the username\n doc[:username] = params[\"username\"]\n \n # Set the guest flag\n doc[:guest] = params[\"guest\"] ? true : false\n \n # Set the current date\n doc[:date] = Time.now.to_i\n \n # Get a new id from the CouchDB server\n uuid = CouchDB.nextUUID @server\n doc[:_id] = uuid\n \n # Put it to the database\n response = CouchRest.put @server + \"/#{CouchDB::DB}/#{uuid}\", doc\n \n return response != false\n \n end", "def create\n @player = Player.new(params[:player])\n\n respond_to do |format|\n if @player.save\n flash[:notice] = 'Dodano nowego zawodnika.'\n format.html { redirect_to(@player) }\n format.xml { render :xml => @player, :status => :created, :location => @player }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @games_player = GamesPlayer.new(params[:games_player])\n\n respond_to do |format|\n if @games_player.save\n format.html { redirect_to(@games_player, :notice => 'Games player was successfully created.') }\n format.xml { render :xml => @games_player, :status => :created, :location => @games_player }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @games_player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @player_action = PlayerAction.new(player_action_params)\n\n respond_to do |format|\n if @player_action.save\n format.html { redirect_to @player_action, notice: 'Player action was successfully created.' }\n format.json { render :show, status: :created, location: @player_action }\n else\n format.html { render :new }\n format.json { render json: @player_action.errors, status: :unprocessable_entity }\n end\n end\n end", "def player_params\n params.require(:player).permit(:name, :email, :avatar, :id, :player_num, :club_id, :password, :password_confirmation)\n end", "def create\n @player_relationship = PlayerRelationship.new(player_relationship_params)\n\n respond_to do |format|\n if @player_relationship.save\n format.html { redirect_to @player_relationship, notice: 'Player relationship was successfully created.' }\n format.json { render action: 'show', status: :created, location: @player_relationship }\n else\n format.html { render action: 'new' }\n format.json { render json: @player_relationship.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @mini_game = MiniGame.new(mini_game_params)\n if @mini_game.save\n render json: @mini_game, status: :ok\n else\n render json: @mini_game.errors, status: :unprocessable_entity\n end\n end" ]
[ "0.76632375", "0.7262531", "0.71538466", "0.7113027", "0.7100474", "0.70951414", "0.70940614", "0.7029797", "0.7010312", "0.69802636", "0.6943458", "0.68993413", "0.68968", "0.68903315", "0.6873749", "0.6871685", "0.68645376", "0.68645376", "0.68645376", "0.68645376", "0.683467", "0.6822313", "0.6801341", "0.67966294", "0.6795985", "0.67910904", "0.67910904", "0.67910904", "0.67910904", "0.67910904", "0.67910904", "0.6779712", "0.6779712", "0.6779712", "0.6779712", "0.6701808", "0.66723233", "0.66566366", "0.66552174", "0.6645001", "0.6633481", "0.661568", "0.6609734", "0.6605559", "0.65869457", "0.6577999", "0.6567184", "0.6566789", "0.65384", "0.65279466", "0.6524748", "0.6523046", "0.651364", "0.6491609", "0.6485919", "0.64822745", "0.64810604", "0.64762974", "0.6473925", "0.64500445", "0.64457494", "0.64257014", "0.6423407", "0.64187354", "0.641188", "0.64089733", "0.6380425", "0.63728654", "0.63724667", "0.6368725", "0.6368275", "0.6363574", "0.6355392", "0.6348159", "0.6319845", "0.63103926", "0.63079846", "0.6298545", "0.6297352", "0.62944245", "0.6288689", "0.62840754", "0.6276794", "0.62739354", "0.62734765", "0.62730336", "0.62717754", "0.6269443", "0.62663025", "0.62552184", "0.62471133", "0.6245035", "0.6242174", "0.6236968", "0.6234393", "0.62168306", "0.6215407", "0.62100303", "0.61974955", "0.619643" ]
0.6743857
35
PATCH/PUT /fantasy_players/1 PATCH/PUT /fantasy_players/1.json
def update respond_to do |format| if @fantasy_player.update(fantasy_player_params) Pusher['dashboard'].trigger('refresh_dashboard', { message: 'refreshing dashboard' }) format.html { redirect_to fantasy_league_fantasy_draft_manager_path(@fantasy_player.fantasy_league_id, @fantasy_player.fantasy_draft_id), notice: 'Fantasy player was successfully updated.' } format.json { render :show, status: :ok, location: @fantasy_player } else format.html { render :edit } format.json { render json: @fantasy_player.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @player.update(player_params)\n render json: @player, status: 200\n end", "def update\n @player.update!(player_params) # anticipated possible exceptions rescued in BaseController\n render json: @player, status: 200\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n# ToDo 0 => Wenn Spieler aktualisiert wurde, schließe das Fenster und aktualisiere die Spielerliste bzw. die Spielerübersicht\n format.html { redirect_to home_path, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:team_id])\n @player = @team.players.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to([@player.team, @player], :notice => 'Player was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.json { render json: @player, status: :ok }\n else\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n \n if @player.save\n render :json => @player, :status => :ok\n else\n render :json => @player.errors, :status => :unprocessable_entity\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team_player.update(team_player_params)\n format.html { redirect_to @team_player, notice: 'Team player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n player = Player.find(params[:id])\n if player.update(player_params)\n render json: player, status: 200, location: [:api, player]\n else\n failed_to_update(player, \"player\")\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client_player = ClientPlayer.find(params[:id])\n\n respond_to do |format|\n if @client_player.update_attributes(params[:client_player])\n format.html { redirect_to @client_player, notice: 'Client player was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:id])\n @player = Player.find(params[:player_id])\n if @player.access_key == params[:access_key] && (@team.leader_id == @player.id || @team.game.owner_id == @player.id) then\n @team.name = params[:name]\n @team.leader_id = params[:leader_id]\n\n respond_to do |format|\n if @team.save\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n format.json { render :json => @team.errors, :status => :unprocessable_entity }\n end\n end\n else\n head :unauthorized\n end\n end", "def update\n @player_promise = PlayerPromise.find(params[:id])\n\n respond_to do |format|\n if @player_promise.update_attributes(params[:player_promise])\n format.html { redirect_to @player_promise, notice: 'Player promise was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player_promise.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @player.update(player_params)\n render json: @player, status: :ok\n else\n render json: {errors: @player.errors}, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @attribute_player.update(attribute_player_params)\n format.html { redirect_to @attribute_player, notice: 'Attribute player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @attribute_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @teams_player.update(teams_player_params)\n format.html { redirect_to @teams_player, notice: 'Teams player was successfully updated.' }\n format.json { render :show, status: :ok, location: @teams_player }\n else\n format.html { render :edit }\n format.json { render json: @teams_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @team = Team.find(params[:team][:team_id])\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n if params[:players]\n TeamPlayers.update(params[:players], team_name: @team.name)\n end\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @all_player = AllPlayer.find(params[:id])\n\n respond_to do |format|\n if @all_player.update_attributes(params[:all_player])\n format.html { redirect_to @all_player, notice: 'All player was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @all_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player_strong.update(player_strong_params)\n format.html { redirect_to project_strong_players_groups_path, notice: 'Zawodnik zmieniony pomyślnie.' }\n format.json { head :no_content} # <- best_in_place required\n else\n format.html { render :edit }\n format.json { render json: @player_strong.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @game_player = GamePlayer.find(params[:id])\n\n respond_to do |format|\n if @game_player.update_attributes(params[:game_player])\n format.html { redirect_to @game_player, notice: 'Game player was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update_attributes(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(player_params)\n event \"update\", :player, @player.id, description: \"#{current_player.name} updated the information for #{@player.name}\"\n format.html { redirect_to @player, flash: { success: 'Player was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n bingo_session = BingoSession.find(params[:bingo_session_id])\n @player = bingo_session.players.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to(@player, :notice => 'Player was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @player}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n format.json { render :json => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @player_client = PlayerClient.find(params[:id])\n\n respond_to do |format|\n if @player_client.update_attributes(params[:player_client])\n format.html { redirect_to @player_client, notice: 'Player client was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player_client.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: \"Player was successfully updated.\" }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to @player, notice: \"Player was successfully updated.\" }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if @player.update(player_params)\n\n render json: @player,status: :ok\n\n else\n\n render json: {error: true,errors: @player.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html { redirect_to(@player, :notice => 'Player was successfully updated.') }\n format.js\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @user= User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:player])\n format.html { redirect_to @player, 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 respond_to do |format|\n if @group_player.update(group_player_params)\n format.html { redirect_to @group_player, notice: 'Group player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n @player.create_activity :update, owner: current_user\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to game_player_path(id: @player.id), notice: 'Player was successfully updated.' }\n format.json { render :show, status: :ok, location: @player }\n else\n format.html { render :edit }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n auth!\n\n respond_to do |format|\n if @player.update_attributes(player_params)\n format.html { redirect_to [hardware, @player], :notice => 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if User.update(current_user.id, :game_id => params[:id])\n format.json { head :no_content }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n params[:player].delete('country')\n params[:player].delete('auth_token')\n if @player.update_attributes(params[:player])\n flash[:notice] = 'Api::Player was successfully updated.'\n format.html { redirect_to(@player) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n game = Game.find(params[:game_id])\n participant = Participant.find(params[:participant_id])\n respond_to do |format|\n if participant.update(participant_params)\n format.html { redirect_to show_participant_path(game, participant) }\n format.json\n else\n format.html { render :edit }\n format.json\n end\n end\n end", "def update\n respond_to do |format|\n if @player.update(player_params)\n # TODO: email the player if there is a team associated\n\t# This email only goes out if the old_value is nil and new_value\n\t# is truthy\n format.html { redirect_to @player, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:draft]\n @player.claimed_by = 1\n elsif params[:remove]\n @player.claimed_by = 0\n else\n raise \"Expecting draft or remove\"\n end\n @player.claim_time = Time.now\n\n @player.save!\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n end\n end", "def update\n @team = Team.find(params[:id])\n\n if @team.update_attributes(params[:team])\n head :no_content\n else\n render json: @team.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @player.update_attributes(player_params)\n format.html { redirect_to(@player, :notice => 'Player was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player_relationship.update(player_relationship_params)\n format.html { redirect_to @player_relationship, notice: 'Player relationship was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player_relationship.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player_game = PlayerGame.find(params[:id])\n\n respond_to do |format|\n if @player_game.update_attributes(params[:player_game])\n format.html { redirect_to @player_game, :notice => 'Player game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @player_game.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @drafted_player.update(drafted_player_params)\n format.html { redirect_to @drafted_player, notice: 'Drafted player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @drafted_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @game_player.update(game_player_params)\n format.html { redirect_to @game_player, notice: \"Game player was successfully updated.\" }\n format.json { render :show, status: :ok, location: @game_player }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @game_player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @fucker = Fucker.find(params[:id])\n\n respond_to do |format|\n if @fucker.update_attributes(params[:fucker])\n format.json { head :no_content }\n else\n format.json { render json: @fucker.errors, status: :internal_server_error }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update(player_params)\n format.html { redirect_to [:admin, @player], notice: 'Player was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n game = Game.find(params[:game_id])\n @player_game = game.player_games.find(params[:id])\n\n respond_to do |format|\n if @player_game.update_attributes(params[:player_game])\n format.html { redirect_to(@player_game, :notice => 'Player game was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => @player_game}\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player_game.errors, :status => :unprocessable_entity }\n format.json { render :json => @player_game}\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n flash[:notice] = 'Player was successfully updated.'\n format.html { redirect_to(@player) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n flash[:notice] = 'Player was successfully updated.'\n format.html { redirect_to(@player) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @gameplayer.update(gameplayer_params)\r\n format.html { redirect_to @gameplayer, notice: \"Gameplayer was successfully updated.\" }\r\n format.json { render :show, status: :ok, location: @gameplayer }\r\n else\r\n format.html { render :edit, status: :unprocessable_entity }\r\n format.json { render json: @gameplayer.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @pet_true.update(pet_true_params)\n format.html { redirect_to @pet_true, notice: 'Pet true was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pet_true.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @jingle.update(jingle_params)\n format.html { redirect_to @jingle, flash: { notice: 'Jingle was successfully updated.' }}\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @jingle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n respond_to do |format|\n if @player.update_attributes(params[:player])\n flash[:notice] = 'Dane zawodnika zostały uaktualnione.'\n format.html { redirect_to player_path(@player) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "def update\n if @player.update_attributes(player_params)\n flash[:notice] = 'Player was successfully updated.'\n respond_with @player\n else\n render action: 'edit'\n end\n end", "def update\n @team = Team.find(params[:id])\n\n respond_to do |format|\n if @team.update_attributes(params.required(:team).permit!)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n flash[:notice] = 'Zmieniono dane zawodnika.'\n format.html { redirect_to(@player) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @games_player = GamesPlayer.find(params[:id])\n\n respond_to do |format|\n if @games_player.update_attributes(params[:games_player])\n format.html { redirect_to(@games_player, :notice => 'Games player was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @games_player.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @fantasy_league_fantasy_team.update(fantasy_league_fantasy_team_params)\n format.html { redirect_to @fantasy_league_fantasy_team, notice: 'Fantasy league fantasy team was successfully updated.' }\n format.json { render :show, status: :ok, location: @fantasy_league_fantasy_team }\n else\n format.html { render :edit }\n format.json { render json: @fantasy_league_fantasy_team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n format.html {\n redirect_to @player, notice: I18n.t(\"messages.players.update.success\")\n }\n else\n format.html {\n @errors = @league.errors\n render action: \"edit\"\n }\n end\n end\n end", "def update\n facade = @kifu.sgf_node_facade\n @kifu.player_black = facade.player_black\n @kifu.player_white = facade.player_white\n @kifu.play_date = facade.date\n\n respond_to do |format|\n if @kifu.update(kifu_params)\n format.html { redirect_to view_context.sec_kifu_path(@kifu), notice: 'Kifu was successfully updated.' }\n format.json { render :show, status: :ok, location: @kifu }\n else\n format.html { render :edit }\n format.json { render json: @kifu.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @thirtyfife.update(thirtyfife_params)\n format.html { redirect_to @thirtyfife, notice: 'Thirtyfive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thirtyfife.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if team.update(team_params)\n format.html { redirect_to team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: team.errors, status: ':unprocessable_entity' }\n end\n end\n end", "def update\n @player = Player.find(params[:id])\n @player.password_confirmation = @player.password\n\n respond_to do |format|\n if @player.update_attributes(params[:player])\n flash[:notice] = 'Player was successfully updated.'\n format.html { redirect_to player_url(@player) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @player.errors.to_xml }\n end\n end\n end", "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "def update\n @leagueplayer = Leagueplayer.find(params[:id])\n \n respond_to do |format|\n if @leagueplayer.update_attributes(params[:leagueplayer])\n format.html { redirect_to(@leagueplayer, :notice => 'Leagueplayer was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @leagueplayer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n team_name = params[:name]\n team_description = params[:description]\n team_id = params[:id]\n\n respond_to do |format|\n if OkrTeam.where(id: team_id).update_all(name: team_name, description: team_description)\n format.json { render json: 'Team is updated successfully!', status: :ok }\n else\n format.json { render json: 'Error!', status: :unprocessable_entity }\n end\n end\n end", "def update\n if :opr == 'edit'\n update\n else\n @team = Team.find_by_id(params[:id])\n @team.update_attributes({:id => params[:id], :name => params[:name], :status => params[:status]})\n\n if request.xhr?\n render :json => @team\n end\n end\n end", "def update\n respond_to do |format|\n if @player_action.update(player_action_params)\n format.html { redirect_to @player_action, notice: 'Player action was successfully updated.' }\n format.json { render :show, status: :ok, location: @player_action }\n else\n format.html { render :edit }\n format.json { render json: @player_action.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @game.update(game_params)\n @games = current_club_player.games\n format.html { redirect_to dashboard_path, notice: 'Game was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @playerprofile = Playerprofile.find(params[:id])\n\n respond_to do |format|\n if @playerprofile.update_attributes(params[:playerprofile])\n format.html { redirect_to @playerprofile, notice: 'Playerprofile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @playerprofile.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @player_record.update(player_record_params)\n format.html { redirect_to @player_record, notice: 'Player record was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @player_record.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to user_path(current_user), notice: 'Team information was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pitcher.update(pitcher_params)\n format.html { redirect_to @pitcher, notice: 'Pitcher was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @pitcher.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n flash[:notice] = 'Se actualizó el Player.' if @player.update_attributes(params[:player])\n respond_with(@player)\n end", "def update\n @player_contact = PlayerContact.find(params[:id])\n respond_to do |format|\n if @player_contact.update_attributes(params[:player_contact])\n format.html { redirect_to root_path, notice: 'Deine Anfrage wurde angepasst.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @player_contact.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n flash[:notice] = \"Player was created successfully.\" if @player.update(player_params)\n respond_with(@player)\n end", "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "def update\n @division = Division.find(params[:id])\n @division.players << Player.find(params[:player_id]) if params[:player_id]\n\n respond_to do |format|\n if @division.update_attributes(params[:division])\n format.html { redirect_to @division, notice: 'Division was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @division.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\n if @team.update(team_params)\n\n render json: @team,status: :ok\n\n else\n\n render json: {error: true,errors: @team.errors},status: :unprocessable_entity\n\n end\n\n \t\tend" ]
[ "0.7154198", "0.7100933", "0.70257366", "0.6917303", "0.6832961", "0.68318737", "0.6795171", "0.6795087", "0.6795087", "0.6795087", "0.6795087", "0.6795087", "0.6795087", "0.6781598", "0.67471886", "0.6724036", "0.6724036", "0.6724036", "0.6724036", "0.67079973", "0.6700316", "0.66913104", "0.6661609", "0.6646728", "0.66462636", "0.66343504", "0.66200155", "0.6604375", "0.65863436", "0.65650153", "0.65466094", "0.6527023", "0.652607", "0.65256435", "0.65256435", "0.65256435", "0.65256435", "0.65256435", "0.65256435", "0.65256435", "0.65251094", "0.65101737", "0.6498421", "0.64903533", "0.64903533", "0.64851433", "0.64727527", "0.6472554", "0.6458423", "0.64582986", "0.64394355", "0.6414798", "0.6409882", "0.6392576", "0.63916516", "0.6375274", "0.6363023", "0.6340953", "0.6333235", "0.63299453", "0.632261", "0.6312471", "0.62823224", "0.62660486", "0.625517", "0.6242439", "0.62380886", "0.62380886", "0.62316597", "0.62229127", "0.621722", "0.62118894", "0.6208088", "0.62075377", "0.6205196", "0.61999464", "0.6182275", "0.6179557", "0.61697996", "0.61638975", "0.61585015", "0.6154324", "0.614476", "0.614264", "0.61378837", "0.6135914", "0.61352545", "0.6132106", "0.61266273", "0.61104333", "0.6100176", "0.6100176", "0.6098229", "0.60965574", "0.60731703", "0.60615325", "0.6056758", "0.6053799", "0.6053741", "0.6050188" ]
0.6598748
28
DELETE /fantasy_players/1 DELETE /fantasy_players/1.json
def destroy @fantasy_player.destroy Pusher['dashboard'].trigger('refresh_dashboard', { message: 'refreshing dashboard' }) respond_to do |format| format.html { redirect_to fantasy_league_fantasy_draft_manager_path(@fantasy_player.fantasy_league_id, @fantasy_player.fantasy_draft_id), notice: 'Fantasy player was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @client_player = ClientPlayer.find(params[:id])\n @client_player.destroy\n\n respond_to do |format|\n format.html { redirect_to client_players_url }\n format.json { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n render :json => \"Ok\", :status => :ok\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @player_client = PlayerClient.find(params[:id])\n @player_client.destroy\n\n respond_to do |format|\n format.html { redirect_to player_clients_url }\n format.json { head :ok }\n end\n end", "def destroy\n player = Player.find(params[:id])\n player.destroy\n head 204\n end", "def destroy\n @all_player = AllPlayer.find(params[:id])\n @all_player.destroy\n\n respond_to do |format|\n format.html { redirect_to all_players_url }\n format.json { head :ok }\n end\n end", "def destroy\n if @fantasy_team_player.destroy\n render json: @fantasy_team_player, status: :ok, include: [:player]\n else\n render json: { message: 'could not delete' }, status: :unprocessable_entity\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(api_players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url(team_id: @player.team.id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @team_player.destroy\n respond_to do |format|\n format.html { redirect_to team_players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game_player = GamePlayer.find(params[:id])\n @game_player.destroy\n\n respond_to do |format|\n format.html { redirect_to game_players_url }\n format.json { head :ok }\n end\n end", "def destroy\n @attribute_player.destroy\n respond_to do |format|\n format.html { redirect_to attribute_players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n render json: @player.as_json.merge(deleted_at: Time.now.utc.iso8601), status: 200\n end", "def destroy\n @player = Player.find(params[:id])\n auth!\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to hardware.players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n team = @player.team\n @player.destroy\n respond_to do |format|\n format.html { redirect_to team }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to game_players_path, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: \"Player was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @championship = Championship.find(params[:id])\n @championship.destroy\n\n respond_to do |format|\n format.html { redirect_to championships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @player_game = PlayerGame.find(params[:id])\n @player_game.destroy\n\n respond_to do |format|\n format.html { redirect_to player_games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.create_activity :destroy, owner: current_user\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @team = Team.find(params[:team_id])\n @player = @team.players.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to team_players_url(@team) }\n format.json { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @nightclub.destroy\n respond_to do |format|\n format.html { redirect_to nightclubs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html {\n redirect_to players_url\n }\n end\n end", "def destroy\n @admin_player.destroy\n respond_to do |format|\n format.html { redirect_to admin_players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @four.destroy\n respond_to do |format|\n format.html { redirect_to fours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n \n @drafted_player.destroy\n respond_to do |format|\n format.html { redirect_to drafted_players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @thirtyfife.destroy\n respond_to do |format|\n format.html { redirect_to thirtyfives_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player = Player.find(params[:id])\n @player.destroy\n event \"delete\", :player, @player.id, description: \"#{current_player.name} deleted player #{@player.name}\"\n\n respond_to do |format|\n format.html { redirect_to players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @teams_player.destroy\n respond_to do |format|\n format.html { redirect_to teams_players_url, notice: 'Teams player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tea_club.destroy\n respond_to do |format|\n format.html { redirect_to tea_clubs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @group_player.destroy\n respond_to do |format|\n format.html { redirect_to group_players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to user_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @game_player.destroy\n respond_to do |format|\n format.html { redirect_to game_players_url, notice: \"Game player was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.user.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n bingo_session = BingoSession.find(params[:bingo_session_id])\n @player = bingo_session.players.find(params[:id])\n @player.destroy\n\n respond_to do |format|\n format.html { redirect_to(players_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def destroy\r\n @gameplayer.destroy\r\n respond_to do |format|\r\n format.html { redirect_to gameplayers_url, notice: \"Gameplayer was successfully destroyed.\" }\r\n format.json { head :no_content }\r\n end\r\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @twentyfour.destroy\n respond_to do |format|\n format.html { redirect_to twentyfours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_with(@player)\n end", "def destroy\n @player_promise = PlayerPromise.find(params[:id])\n @player_promise.destroy\n\n respond_to do |format|\n format.html { redirect_to player_promises_url }\n format.json { head :ok }\n end\n end", "def delete\n render json: User.delete(params[\"id\"])\n end", "def destroy\n @game_server = Game::Server.find(params[:id])\n @game_server.destroy\n\n respond_to do |format|\n format.html { redirect_to game_servers_url }\n format.json { head :ok }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to contest_games_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @player_relationship.destroy\n respond_to do |format|\n format.html { redirect_to player_relationships_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @monkey = Monkey.find(params[:id])\n @monkey.destroy\n\n respond_to do |format|\n format.html { redirect_to monkeys_url }\n format.json { head :no_content }\n end\n end", "def destroy\n\n if @player.destroy\n\n render json: {player: {id: params[:id].to_i}},status: :ok\n\n else\n\n render json: {error: true,errors: @player.errors},status: :unprocessable_entity\n\n end\n\n \t\tend", "def destroy\n # @game = Game.find(params[:id])\n # @game.destroy\n\n respond_to do |format|\n format.html { redirect_to games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n game = @goal.game\n @goal.destroy\n respond_to do |format|\n format.html { redirect_to game_path(game) }\n format.json { head :no_content }\n end\n end", "def destroy\n @club_path = ClubPath.find(params[:id])\n @club_path.destroy\n\n respond_to do |format|\n format.html { redirect_to club_paths_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n @teams = @player.teams\n if @teams.exists?\n @teams.each do |t|\n t.destroy\n end\n end\n respond_to do |format|\n format.html { redirect_to players_url, notice: 'Player was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @player_action.destroy\n respond_to do |format|\n format.html { redirect_to player_actions_url, notice: 'Player action was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @thirtyfour.destroy\n respond_to do |format|\n format.html { redirect_to thirtyfours_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Users.delete(params[\"id\"])\n end", "def destroy\n @playerprofile = Playerprofile.find(params[:id])\n @playerprofile.destroy\n\n respond_to do |format|\n format.html { redirect_to playerprofiles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @games_player = GamesPlayer.find(params[:id])\n @games_player.destroy\n\n respond_to do |format|\n format.html { redirect_to(games_players_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @player_challenge = PlayerChallenge.find(params[:id])\n @player_challenge.destroy\n respond_to do |format|\n format.html { redirect_to player_challenges_url }\n format.json { head :ok }\n end\n end", "def destroy\n id = params[:id].to_i\n UserGame.find(id)\n @user_game.destroy\n respond_to do |format|\n format.html { redirect_to user_games_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player.destroy\n respond_to do |format|\n format.html { redirect_to players_url, notice: t( '.success' ) }\n end\n end", "def destroy\n @unavailable_player.destroy\n respond_to do |format|\n format.html { redirect_to unavailable_players_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game_tournament = GameTournament.find(params[:id])\n @game_tournament.destroy\n\n respond_to do |format|\n format.html { redirect_to game_tournaments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @game.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @fellowship.destroy\n respond_to do |format|\n format.html { redirect_to fellowships_url, notice: 'Fellowship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @championship.destroy\n\n head :no_content\n end", "def destroy\n @tournament.destroy\n respond_to do |format|\n format.html { redirect_to tournaments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @tournament.destroy\n respond_to do |format|\n format.html { redirect_to tournaments_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @jingle.destroy\n respond_to do |format|\n format.html { redirect_to jingles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @player_record.destroy\n respond_to do |format|\n format.html { redirect_to player_records_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7425047", "0.73567504", "0.73567504", "0.73566735", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7352775", "0.7326525", "0.7326525", "0.7326525", "0.7322771", "0.7267264", "0.7267066", "0.7266039", "0.72520286", "0.72147137", "0.7200088", "0.71782935", "0.71770513", "0.716416", "0.7140526", "0.71336514", "0.7103037", "0.7082382", "0.7078906", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074545", "0.7074217", "0.7057804", "0.7054312", "0.7045553", "0.70410526", "0.7031533", "0.7005842", "0.7005842", "0.7005842", "0.7005842", "0.7005842", "0.6979673", "0.6977587", "0.6974", "0.6962914", "0.6961852", "0.6955559", "0.69545853", "0.6947935", "0.693531", "0.6932346", "0.69181144", "0.69070697", "0.69041663", "0.69032997", "0.6897177", "0.68921864", "0.689202", "0.6886468", "0.68845993", "0.6884151", "0.6880979", "0.6880446", "0.68753284", "0.68700343", "0.6866317", "0.68654495", "0.6864664", "0.6864456", "0.6862218", "0.68588823", "0.6856105", "0.6841271", "0.68396544", "0.6838461", "0.68361986", "0.6822325", "0.681949", "0.6811278", "0.68050545", "0.68003196", "0.6799332", "0.6798346", "0.6798346", "0.6797426", "0.6794857", "0.6790514", "0.6790514", "0.6786185", "0.6781874" ]
0.68512523
82
Use callbacks to share common setup or constraints between actions.
def set_fantasy_player @fantasy_player = FantasyPlayer.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 fantasy_player_params params.require(:fantasy_player).permit(:fantasy_league_id, :fantasy_team_id, :fantasy_draft_id, :player_id, :price) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\n end", "def permitted_params\n []\n end", "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def safe_params\n params.require(:user).permit(:name)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def filtering_params\n params.permit(:email)\n end", "def active_code_params\n params[:active_code].permit\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "def url_params\n params[:url].permit(:full)\n end", "def backend_user_params\n params.permit!\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end" ]
[ "0.6978086", "0.6780264", "0.6742658", "0.6738813", "0.67338693", "0.65908474", "0.6501793", "0.6495506", "0.64796513", "0.64755446", "0.6454826", "0.6437561", "0.6377127", "0.63722163", "0.6364058", "0.63178706", "0.62979764", "0.62968165", "0.62913024", "0.6289789", "0.6289145", "0.62875307", "0.6280997", "0.62420976", "0.62388235", "0.6216686", "0.62122375", "0.6208949", "0.619173", "0.6176307", "0.6173907", "0.6170346", "0.616111", "0.6150513", "0.6150023", "0.61446756", "0.6120429", "0.6112975", "0.6104845", "0.6102966", "0.6087884", "0.6079323", "0.60699135", "0.60602236", "0.60191786", "0.60170597", "0.60100305", "0.6009527", "0.60052776", "0.60052776", "0.600042", "0.5999317", "0.59933805", "0.5991528", "0.5991221", "0.5990094", "0.5979497", "0.5966058", "0.5958738", "0.59579456", "0.5957759", "0.5956938", "0.5951788", "0.59511644", "0.59423065", "0.59373474", "0.59361076", "0.59361076", "0.59331447", "0.5928005", "0.5924882", "0.5924011", "0.59169155", "0.5908037", "0.5907541", "0.59061426", "0.59056246", "0.5897408", "0.58960444", "0.58951247", "0.5893136", "0.5892312", "0.5890385", "0.58853275", "0.58801144", "0.58784765", "0.5872648", "0.58682626", "0.5867028", "0.58661693", "0.586578", "0.58643955", "0.5863193", "0.58609086", "0.5859997", "0.5858935", "0.5858632", "0.5853379", "0.5852741", "0.584806", "0.5847703" ]
0.0
-1
Update properties of this object
def update!(**args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @blob_generation = args[:blob_generation] if args.key?(:blob_generation) @blob_id = args[:blob_id] if args.key?(:blob_id) @download_read_handle = args[:download_read_handle] if args.key?(:download_read_handle) @read_token = args[:read_token] if args.key?(:read_token) @upload_metadata_container = args[:upload_metadata_container] if args.key?(:upload_metadata_container) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @blob_ref = args[:blob_ref] if args.key?(:blob_ref) @blobstore2_info = args[:blobstore2_info] if args.key?(:blobstore2_info) @cosmo_binary_reference = args[:cosmo_binary_reference] if args.key?(:cosmo_binary_reference) @crc32c_hash = args[:crc32c_hash] if args.key?(:crc32c_hash) @inline = args[:inline] if args.key?(:inline) @length = args[:length] if args.key?(:length) @md5_hash = args[:md5_hash] if args.key?(:md5_hash) @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop) @path = args[:path] if args.key?(:path) @reference_type = args[:reference_type] if args.key?(:reference_type) @sha1_hash = args[:sha1_hash] if args.key?(:sha1_hash) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @best_guess = args[:best_guess] if args.key?(:best_guess) @from_bytes = args[:from_bytes] if args.key?(:from_bytes) @from_file_name = args[:from_file_name] if args.key?(:from_file_name) @from_header = args[:from_header] if args.key?(:from_header) @from_url_path = args[:from_url_path] if args.key?(:from_url_path) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @checksums_location = args[:checksums_location] if args.key?(:checksums_location) @chunk_size_bytes = args[:chunk_size_bytes] if args.key?(:chunk_size_bytes) @object_location = args[:object_location] if args.key?(:object_location) @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes) @object_version = args[:object_version] if args.key?(:object_version) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @object_location = args[:object_location] if args.key?(:object_location) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @checksums_info = args[:checksums_info] if args.key?(:checksums_info) @object_info = args[:object_info] if args.key?(:object_info) @object_version = args[:object_version] if args.key?(:object_version) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @object_version = args[:object_version] if args.key?(:object_version) @original_object = args[:original_object] if args.key?(:original_object) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes) @object_version = args[:object_version] if args.key?(:object_version) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.5973787
59
Update properties of this object
def update!(**args) @allow_gzip_compression = args[:allow_gzip_compression] if args.key?(:allow_gzip_compression) @ignore_range = args[:ignore_range] if args.key?(:ignore_range) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @algorithm = args[:algorithm] if args.key?(:algorithm) @bigstore_object_ref = args[:bigstore_object_ref] if args.key?(:bigstore_object_ref) @blob_ref = args[:blob_ref] if args.key?(:blob_ref) @blobstore2_info = args[:blobstore2_info] if args.key?(:blobstore2_info) @composite_media = args[:composite_media] if args.key?(:composite_media) @content_type = args[:content_type] if args.key?(:content_type) @content_type_info = args[:content_type_info] if args.key?(:content_type_info) @cosmo_binary_reference = args[:cosmo_binary_reference] if args.key?(:cosmo_binary_reference) @crc32c_hash = args[:crc32c_hash] if args.key?(:crc32c_hash) @diff_checksums_response = args[:diff_checksums_response] if args.key?(:diff_checksums_response) @diff_download_response = args[:diff_download_response] if args.key?(:diff_download_response) @diff_upload_request = args[:diff_upload_request] if args.key?(:diff_upload_request) @diff_upload_response = args[:diff_upload_response] if args.key?(:diff_upload_response) @diff_version_response = args[:diff_version_response] if args.key?(:diff_version_response) @download_parameters = args[:download_parameters] if args.key?(:download_parameters) @filename = args[:filename] if args.key?(:filename) @hash_prop = args[:hash_prop] if args.key?(:hash_prop) @hash_verified = args[:hash_verified] if args.key?(:hash_verified) @inline = args[:inline] if args.key?(:inline) @is_potential_retry = args[:is_potential_retry] if args.key?(:is_potential_retry) @length = args[:length] if args.key?(:length) @md5_hash = args[:md5_hash] if args.key?(:md5_hash) @media_id = args[:media_id] if args.key?(:media_id) @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop) @path = args[:path] if args.key?(:path) @reference_type = args[:reference_type] if args.key?(:reference_type) @sha1_hash = args[:sha1_hash] if args.key?(:sha1_hash) @sha256_hash = args[:sha256_hash] if args.key?(:sha256_hash) @timestamp = args[:timestamp] if args.key?(:timestamp) @token = args[:token] if args.key?(:token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @bucket_name = args[:bucket_name] if args.key?(:bucket_name) @generation = args[:generation] if args.key?(:generation) @object_name = args[:object_name] if args.key?(:object_name) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @create_time = args[:create_time] if args.key?(:create_time) @expire_time = args[:expire_time] if args.key?(:expire_time) @id = args[:id] if args.key?(:id) @name = args[:name] if args.key?(:name) @report_type_id = args[:report_type_id] if args.key?(:report_type_id) @system_managed = args[:system_managed] if args.key?(:system_managed) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @jobs = args[:jobs] if args.key?(:jobs) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) @report_types = args[:report_types] if args.key?(:report_types) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @next_page_token = args[:next_page_token] if args.key?(:next_page_token) @reports = args[:reports] if args.key?(:reports) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @create_time = args[:create_time] if args.key?(:create_time) @download_url = args[:download_url] if args.key?(:download_url) @end_time = args[:end_time] if args.key?(:end_time) @id = args[:id] if args.key?(:id) @job_expire_time = args[:job_expire_time] if args.key?(:job_expire_time) @job_id = args[:job_id] if args.key?(:job_id) @start_time = args[:start_time] if args.key?(:start_time) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Update properties of this object
def update!(**args) @deprecate_time = args[:deprecate_time] if args.key?(:deprecate_time) @id = args[:id] if args.key?(:id) @name = args[:name] if args.key?(:name) @system_managed = args[:system_managed] if args.key?(:system_managed) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end", "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update(attrs)\n super(attrs)\n end", "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end", "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end", "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end", "def update\n # TODO: implement update\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update\n \n end", "def refresh\n set_attributes\n end", "def update(attrs)\n @attrs.update(attrs)\n self\n end", "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end", "def update_resource object, attributes\n object.update attributes\n end", "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end", "def update\n \n end", "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end", "def update\n @objects.map(&:update);\n end", "def update\n raise NotImplementedError\n end", "def update\n raise NotImplementedError\n end", "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end", "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update\n end", "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def modified_properties=(value)\n @modified_properties = value\n end", "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "def update\n\t\t\n\t\tend", "def set_props(props)\n @props.merge!(props)\n end", "def update() end", "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end", "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end", "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end", "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end", "def update_attributes(attrs)\n super({})\n end", "def update\n @dirty = true\n end", "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end", "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end", "def update\n super\n end", "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end", "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end", "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end", "def properties=(value)\n @properties = value\n end", "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end", "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\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 ; end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end", "def update_with(attributes)\n assign_attributes(attributes)\n end", "def update\n # don't need to update; hash is shared\n end", "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end", "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end", "def update\n raise NotImplementedError\n end", "def update_attributes attributes\n @attributes.merge! attributes\n end", "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end", "def update\r\n end", "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end", "def update\n raise NotImplemented\n end", "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end", "def update_values\n end", "def update_values\n end", "def update\n raise NotImplementedError\n end", "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end", "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end", "def update attributes, collection #:nodoc:\n 0\n end", "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end", "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end", "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end", "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end", "def update\n set_deltatime\n set_last_update_at\n end" ]
[ "0.7012263", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.69181895", "0.67403597", "0.6709326", "0.6709326", "0.6696149", "0.6696149", "0.6696149", "0.6696149", "0.6618882", "0.6571848", "0.65386343", "0.65178275", "0.6394807", "0.6389745", "0.6389745", "0.63328", "0.6319025", "0.6283673", "0.6269463", "0.62639254", "0.62410724", "0.62170374", "0.62152076", "0.6210263", "0.6204041", "0.6204041", "0.62021106", "0.62017816", "0.62017", "0.61730784", "0.61730784", "0.6159277", "0.6156169", "0.61445665", "0.6125433", "0.61241156", "0.6121413", "0.6110477", "0.6105694", "0.61016303", "0.60845226", "0.6084427", "0.6065455", "0.6059506", "0.6054869", "0.6051708", "0.6051708", "0.60413384", "0.6030853", "0.6022535", "0.6015561", "0.59932375", "0.59898263", "0.5976479", "0.5973787", "0.59678394", "0.5963291", "0.5962048", "0.5961157", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.5950731", "0.59500545", "0.59443134", "0.59443134", "0.59424853", "0.59424853", "0.593523", "0.5926413", "0.5924831", "0.592427", "0.59233046", "0.59233046", "0.5921224", "0.59144294", "0.59142506", "0.58887535", "0.58854496", "0.5883008", "0.58792305", "0.5876954", "0.5876954", "0.58744955", "0.5857968", "0.5845542", "0.5841629", "0.58363605", "0.5829255", "0.582919", "0.5822138", "0.58208305" ]
0.0
-1
Metodo que incluye la libreria del actioncable y se conecta al canal demo y la cual es el encargado de mandar a todos los conectados la publicacion que realiza un usuario y responde con una action desde el controllador
def send_to_action_cable data = {message: to_html,action:"new_post"} self.user.friend_ids.each do |friend_id| #"posts_#{friend_id}" hace el broacating a todos los amigos del usuarios #quien realiza la publicacion ActionCable.server.broadcast "posts_#{friend_id}", data end self.user.user_ids.each do |friend_id| ActionCable.server.broadcast "posts_#{friend_id}", data end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def curator_actions(user)\n can_act_as_logged_in_user(user)\n can_curate\n can_update_metadata\n end", "def activar\n # flash[:notice] = \"klkkkk\"\n \n session[:cliente_id] = \"desktop\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n session[:tipo_cliente] = \"123\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n\n @tipo_cliente = \"desktop\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n @cliente_id = \"123\" # SETEADO MANUAL ADMINISTRATIVAMENTE OK TED.\n session[:chekeado] = \"chekeado\"\n\n if (session[:terminal_autorizada] == false)\n sign_out(current_user) \n end\n session[:terminal_autorizada] = true\n #creado para complemento (convention over configuration) del controlador del view de acticion de equipos. ok ted.\n end", "def ctoolsHTTPDirectToDoLMSMneme(uniqname, security_file, http_application)\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: ############### call ctools http direct Mneme todolms http_application: #{http_application}\"\n\n http_channel = ChannelCToolsDirectHTTP.new(security_file, http_application)\n http_channel.runGetCToolsSession\n\n become_user = http_channel.do_request(\"/session/becomeuser/#{uniqname}.json\")\n\n logger.debug \"#{__method__}: #{__LINE__}: becomeuser: [#{become_user}]\"\n logger.debug \"#{__method__}: #{__LINE__}: becomeuser: response: \"+become_user.inspect\n\n if /failure/i =~ become_user.to_s\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: become user failed for user: #{uniqname}\"\n return WAPIResultWrapper.new(WAPI::HTTP_NOT_FOUND, \"CTools becomeuser failed for user: #{uniqname}\", \"{}\")\n end\n\n #/direct/mneme/my\n ctools_todos = http_channel.do_request(\"/mneme/my.json\")\n\n return WAPIResultWrapper.new(WAPI::SUCCESS, \"got mneme todos from ctools direct\", ctools_todos)\n end", "def initialize(user)\n unless user\n can [:new, :create, :sign_in, :sign_up, :check_username, :check_email, :check_run, :log], [Producer, User]\n cannot [:new, :destroy, :update], Event \n can [:show, :index, :search, :siete_dias_app, :patrocinados_app, :buscar_app, :lista_app, :view_app], Event \n\t cannot [:account, :edit, :destroy, :update], [Producer, User]\n can [:geo], City\n can [:view_app, :check_app], Ticket\n #can :manage, :all#comentar esto si se quiere quitar permiso admin \n else\n if user.has_role? :normal\n can :manage, User\n can [:new, :create, :sign_in, :sign_up, :check_username, :check_email, :check_run, :log], [Producer]\n cannot [:account, :edit, :destroy, :update], Producer\n cannot [:new, :destroy, :update], Event \n can [:show, :index, :search, :detail], Event \n can [:ticket_free, :result_free, :result], Transaction\n can [:view_app, :check_app, :index, :pdf, :render_pdf], Ticket\n #can :manage, :all# esto si se quiere quitar permiso admin \n end\n end\n end", "def peacekeeper_quest; end", "def create\n self.resource = warden.authenticate!(auth_options)\n def is_active?\n self.resource.etat\n end\n\n # Si le user n'est pâs activer il est \n if is_active?\n current_user.update(presence: true, date_derniere_connexion: Time.now.utc)\n if current_user.categorie == \"Admin\"\n redirect_to ecoles_liste_path, notice: \"Bienvenue !!!\"\n else\n redirect_to root_path, notice: \"Bienvenue !!!\"\n end\n else\n session.clear\n redirect_to user_session_path, notice: \"Désolé votre compte à été desactiver\"\n end\n end", "def apresentacao\n if @permissao === \"convidado\"\n puts \"o usuário selecionado possui a permissao de Convidado\"\n end\n if @permissao === \"autenticado\"\n puts \"o usuário selecionado possui a permissao de Autenticado\"\n end\n if @permissao === \"admin\"\n puts \"o usuário selecionado possui a permissao de Admin\"\n end\n end", "def action(caseCourante)\n\n # Recuperation du type d'instance de case\n type = @partie.plateau.recupererTypeCase(caseCourante)\n case type\n when 'caseTerritoire'\n # Génération des opérations sur un territoire\n listeId = @partie.genererIdOperationsProposees(caseCourante.territoire.joueurPossesseur.ideologie)\n\n # Transmission des identifiants d'opération possibles et attente d'un choix\n idAction = @com.ask('operations', listeId, 'operation', 30).to_i\n\n\n appliedAction = ((idAction.integer?) && listeId.include?(idAction)) ? idAction : listeId[0]\n # Repercussion du choix (l'action proposée sera la première si la réponse n'est pas correcte)\n @partie.appliquerOperationTerritoire(\n Operation.new(\n appliedAction,\n caseCourante.territoire.joueurPossesseur.ideologie.numero\n ),\n caseCourante.territoire\n )\n @salon.broadcast(\"appliedOperation\", appliedAction.to_s)\n\n when 'caseEvenement'\n # On réclame une opération sur événement\n operation = caseCourante.selectionnerOperation()\n\n # On transmet l'opération à Partie pour son application aux joueurs concernés\n @partie.appliquerOperationEvenement(operation)\n\n # Send the id of the event to each client\n @salon.broadcast('evenement', operation.idEvenement.to_s)\n\n when 'caseDepart' # Muet\n\n else\n $LOGGER.error 'GestionJoueur::action: unknown case.'\n end\n end", "def authorization; end", "def cable; end", "def ctoolsHTTPDirectToDoLMSDash(uniqname, security_file, http_application)\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: ############### call ctools http direct Dash todolms http_application: #{http_application}\"\n\n http_channel = ChannelCToolsDirectHTTP.new(security_file, http_application)\n http_channel.runGetCToolsSession\n\n become_user = http_channel.do_request(\"/session/becomeuser/#{uniqname}.json\")\n\n logger.debug \"#{__method__}: #{__LINE__}: becomeuser: [#{become_user}]\"\n logger.debug \"#{__method__}: #{__LINE__}: becomeuser: response: \"+become_user.inspect\n\n if /failure/i =~ become_user.to_s\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: become user failed for user: #{uniqname}\"\n return WAPIResultWrapper.new(WAPI::HTTP_NOT_FOUND, \"CTools becomeuser failed for user: #{uniqname}\", \"{}\")\n end\n\n ctools_todos = http_channel.do_request(\"/dash/calendar.json\")\n\n return WAPIResultWrapper.new(WAPI::SUCCESS, \"got dash todos from ctools direct\", ctools_todos)\n end", "def security_server_client\n end", "def connect\n \t\t#Se sigue la convencion para la identificacion del usuario\n \t\t#y buscamos alusuario que se intenta conectar\n \t\tself.current_user = find_user\n \tend", "def send_activation_request\n end", "def send_moola!\n # @todo\n end", "def user_action_on_resource_authorized\n end", "def action_sendauth!()\n @action = TAC_PLUS_AUTHEN_SENDAUTH\n end", "def initialize(user)\n\n ############################## Household ##############################\n can :administrate, Household do |household|\n user.administrates?(household)\n end\n\n can :add_admin, Household do |household|\n user == household.head_admin\n end\n\n ############################## Completable ##############################\n can :accept, Completable do |todo|\n household = todo.household\n can?(:edit, todo) &&\n todo.completed? &&\n !todo.accepted? &&\n can?(:administrate, household)\n end\n\n can :complete, Completable do |todo|\n household = todo.household\n user.household == household &&\n !todo.completed? &&\n !todo.accepted?\n end\n\n can :destroy, Completable do |todo|\n household = todo.household\n user.household == household &&\n ( can?(:administrate, household) ||\n todo.creator_id == user.id && !todo.accepted?\n )\n end\n\n can :edit, Completable do |todo|\n household = todo.household\n todo.creator_id == user.id || \n can?(:administrate, household)\n end\n\n can :reorder, Completable do |todo|\n can?(:complete, todo) || can?(:uncomplete, todo)\n end\n\n can :uncomplete, Completable do |todo|\n household = todo.household\n user.household == household &&\n !todo.accepted? && \n todo.completed? &&\n (todo.completor_id == user.id || can?(:edit, todo))\n end\n\n end", "def user\n guest # inherits from guest\n can :launch, Challenge\n can :complete, Challenge\n can :show_hint, Challenge\n can :destroy, ChallengeFlag, user_id: @user.id\n\n # Messages\n #can [:read, :destroy], UserMessage, :user_id=>@user.id\n #can :create, UserMessage\n #cannot :multi_send, UserMessage # Send multiple to multiple users\n #cannot :system_send, UserMessage # Send messages from \"System\" users\n end", "def initialize(user)\n user ||= User.new\n #si el usuario es administrador\n if user.role == \"administrador\"\n #puede hacer todo\n can :manage, :all\n elsif user.role == \"profesor\"\n #si es profesor puede ver libros y eventos\n can :show, Libro\n can [:create, :show, :update], Evento\n can [:create, :show, :update], Query\n can [:create, :show, :update], Prestamo\n #can :manage, Evento, :id => user.id \n #can :update, Evento, users: user.id\n else user.role == \"estudiante\"\n #si es es estudiante solo ver libro\n can :show, Libro\n can [:create, :show, :update], Prestamo\n end\n end", "def initialize(user)\n if user.role == \"member\"\n can :index, :all\n can :create, :all\n cannot :index, Passenger\n #cannot :index, Home\n # Jeder Member kann jede Übersicht außer der Übersicht der User sehen\n # und kann alle Elemente erstellen\n can [:show, :update, :destroy], Car do |car|\n car && car.user == user \n end\n can :show, user.get_visible_cars\n # Member können eigene Autos erstellen, editieren und zerstören und alle eigenen und bei teilzunehmenden Fahrten genutzten Autos anschauen \n can [:outbox, :show, :update], Message do |message|\n message && message.writer == user\n end\n can [:show, :update], Message do |message|\n message && message.receiver == user\n end\n cannot [:edit], Message do |message|\n message && message.receiver == user\n end\n # Member können alle mit ihnen in Verbindung stehenden Messages lesen und editieren\n can [:show, :update, :destroy], Request do |request|\n request && request.user == user\n end\n # Member haben kompletten Zugriff auf die eigenen Anfragen\n can :show, Trip\n can [:update, :destroy], Trip do |trip|\n trip && trip.user == user\n end\n # Member können alle Fahrten sehen, jedoch nur die eigenen verändern\n can [:update, :destroy], Rating do |rating|\n rating && rating.author == user\n end\n # Member können nur selbstgeschriebene Ratings verändern\n can :show, user.get_visible_users\n can [:show, :update, :destroy], User do |user1|\n user1 && user1 == user\n end\n # Member können alle User sehen mit denen sie eine Fahrt antreten wollen und ihren eigenen Account verändern\n\n # Rechte der Member\n elsif user.role == \"admin\"\n can :manage, :all\n # Der Admin hat vollständige Zugriffsrechte\n end\n end", "def prompt_user_authorisation\n\n require './app/routes/web'\n\n # Start local API\n Launchy.open(\"http://localhost:5000/cli/auth\")\n\n auth_thread = Thread.new do\n Linkedin2CV::Routes::Web.run!\n end\n\n auth_thread\n end", "def loggin_opc(puser, pcontroller, paction, pcomment)\n #para que no haga logging de clicks de navegacion\n if pcontroller == 'home'\n\t\treturn\n else\n\t logmodel = Logeclubapi.new\n\t logmodel.login = puser.login\n\t logmodel.username = puser.name\n\t logmodel.log_option = pcontroller\n\t logmodel.log_action = paction[0..9]\n\t logmodel.log_comment = pcomment\n\t logmodel.origin = 'W' #origen web\n\t #logmodel.save\n end\n end", "def require_permission\n set_comentario\n @comentario = @politico.comentarios.find(params[:id])\n if (current_user != @politico.user) and (current_user != @comentario.user)\n flash[:notice] = 'Permissões insuficientes!'\n redirect_to @politico\n end\n end", "def faft_robot(user)\n end", "def before_players_ready\r\n end", "def actions\n client.actions\n end", "def owner_required\n ## before filter for owner of channel. \n if logged_in? && current_user.login == THUMBWEBS_AUTHORIZED_USER\n return true\n else\n flash[:error] = \"Unauthorized Access-Must be logged-in as owner.\"\n redirect_to thumbwebs_root_path\n end\nend", "def initialize(user)\n #we define here all the rules and permissions to out application\n # Define abilities for the passed in user here. For example:\n\n\n #if user is not signed in, current_user will return nil so we set it to 'User.new' if user is not signed in to ease writing rules by simply doing 'user.id' which will return nil instead of raising an exception\n user ||= User.new\n\n alias_action :create, :read, :update, :destroy, to: :crud\n\n #this rule specifies that the user can crud a question if the question created is the same as user who is currently logged in\n #remember that this defined the rule but you still have to enforce the rule yourself by using it in your views and controllers\n\n if user.is_admin?\n can :manage, :all?\n end\n #manage option in cancancan gives the user the ability to do anything\n #and not just CRUD; it includes other actions such as publish, activate, disable, etc\n\n\n can :crud, Question do |question|\n question.user == user\n end\n\n can :like, Question do |question|\n question.user != user\n end\n\n cannot :like, Question do |question|\n question.user == user\n end\n # user ||= User.new # guest user (not logged in)\n # if user.admin?\n # can :manage, :all\n # else\n # can :read, :all\n # end\n #\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n end", "def client\n end", "def notificaciones\n end", "def revisa_conectado\n unless conectado?\n redirect_to root_path\n end\n end", "def initialize(user)\n\n # We instantiate the user to User.new to avoid having user be nil if the user is not signed in - so methods can be called on it. We assume here that 'user' will be User.new if the user is not signed in.\n user ||= User.new\n\n # Gives superpowers to admin user by having the ability to manage all actions on all models\n # If a field is a boolean, Rails automatically creates a helper method with a question mark (alternatively, you can user user.admin, which references the value - true or false)\n can :manage, :all if user.admin?\n\n # Define alias_action instead of using :manage\n alias_action :create, :read, :update, :destroy, :to => :crud\n\n # Defining the ability to :manage (do anything) with a question\n can :crud, Question do |q|\n # This block returns true or false. This determines if the user is allowed to manage a question or not\n # user.persisted? ensures the user is actually logged in\n q.user == user && user.persisted?\n end\n\n can :crud, Answer do |a|\n # Both the author of the question and the author of the answer can CRUD an answer\n (a.question.user == user || a.user == user) && user.persisted?\n end\n\n can :like, Question do |q|\n q.user != user\n end\n\n can :destroy, Like do |l|\n l.user == user\n end\n\n # It is possible to define any action, i.e. can :edit / can :destroy ...etc\n\n # Define abilities for the passed in user here. For example:\n #\n # user ||= User.new # guest user (not logged in)\n # if user.admin?\n # can :manage, :all\n # else\n # can :read, :all\n # end\n #\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n end", "def control\n require 'net/http'\n require 'uri'\n ibox = Ibox.find(session[:ibox_id])\n accessory = Accessory.find(params[:id])\n @user = User.find(session[:user_id])\n ip = ibox.ip\n port = ibox.port\n ws = 'http://' + ip + ':' + port\n url = URI.parse(ws)\n respond_to do |format|\n begin\n ret = isConectedAccessory(ibox.id, accessory.zid)\n if (ret == true) \n res = iboxExecute(ip, port, '/cgi-bin/Status.cgi?ZID=' + accessory.zid, ibox.user, ibox.password)\n if (res[2] == 'STATUS=99')\n flash[:notice] = \"\"\n flash[:error] = \"El Ibox no puede conectarse con el accesorio.\"\n format.js {render :js => \"window.location.href=window.location.href\"}\n else\n if accessory.kind == 'MultiLevelSwitch'\n #req = Net::HTTP::Get.new(url.path + '/cgi-bin/Switch.cgi?VALUE=' + params[:value] + '&ZID=' + accessory.zid)\n req = Net::HTTP::Get.new(url.path + '/cgi-bin/Switch.cgi?&ZID=' + accessory.zid + '&VALUE=' + params[:value] + '&DEALY=&TIMER=')\n end\n if accessory.kind == 'BinarySwitch'\n #req = Net::HTTP::Get.new(url.path + '/cgi-bin/Switch.cgi?OP=' + params[:value] + '&ZID=' + accessory.zid)\n req = Net::HTTP::Get.new(url.path + '/cgi-bin/Switch.cgi?&ZID=' + accessory.zid + '&OP=' + params[:value] + '&DEALY=&TIMER=')\n end\n req.basic_auth ibox.user, ibox.password\n res = Net::HTTP.start(url.host, url.port) { |http| http.request(req) }\n accessory.update_attribute(:value, params[:value].to_i)\n \n ##logger information\n @activity = Activity.new\n @activity.update_attribute(:value, params[:value])\n ibox.activities << @activity\n @user.activities << @activity\n accessory.activities << @activity \n\n ### FOR DEBUGING!\n time = Time.new\n currentDay = time.wday\n currentTime = time.strftime(\"%H:%M:00\") \n @user = User.find(session[:user_id])\n AccessoriesLogger.debug \"El accesorio: #{accessory.name} se accionó con el valor: #{params[:value]} por el usuario #{@user.email} a las: #{currentTime} #{currentDay}\"\n end\n else\n flash[:notice] = \"\"\n flash[:error] = \"El Ibox no puede conectarse con el accesorio. Debe reinstalar el accesorio\" \n end\n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError,SocketError => e\n flash[:notice] = \"Lo sentimos, el servicio no se encuentra disponible actualmente.\"\n end\n format.js\n end\n end", "def clicar_botao\n #mas antes vamos setar para esperar e garantir que o botao irá aparecer na tela. Está padrão no default env\n wait_for_botao\n botao.click\n end", "def run_actions; end", "def auth\n end", "def auth\n end", "def conection()\t\n\tputs (\"\\nPresione Enter para continuar luego de permitir el acceso\")\n\tbegin\t\n\t\taccess_token = @cliente.authorize(\n \t\trequest_token.token,\n \t\trequest_token.secret)\n\t\trescue Exception => e\n\t\t\tabort(\"No se ha aceptado la conexion de la aplicacion, programa cerrando...\")\n\t\tputs (\"Conexion establecida satisfactoriamente\")\n\tend\n\t\t\n\trescue Exception => e\n\t\tabort( \"TIMEOUT EXCEPTION: al parecer hay un problema con la conexion a internet, programa cerrando...\")\nend", "def common_abilities_for_admins(user)\n can :access, Admin\n can :manage, :all if user.is_admin?\n\n conf_ids_for_organizer = Conference.with_role(:organizer, user).pluck(:id)\n conf_ids_for_cfp = Conference.with_role(:cfp, user).pluck(:id)\n conf_ids_for_info_desk = Conference.with_role(:info_desk, user).pluck(:id)\n\n if conf_ids_for_organizer\n # To access splashpage of their conference if it is not public\n can :show, Conference, id: conf_ids_for_organizer\n # To access conference/proposals/registrations\n can :manage, Registration, conference_id: conf_ids_for_organizer\n # To access conference/proposals\n can :manage, Event, program: { conference_id: conf_ids_for_organizer }\n # To access comment link in menu bar\n can :index, Comment, commentable_type: 'Event',\n commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_organizer).pluck(:id)).pluck(:id)\n end\n\n if conf_ids_for_cfp\n # To access comment link in menu bar\n can :index, Comment, commentable_type: 'Event',\n commentable_id: Event.where(program_id: Program.where(conference_id: conf_ids_for_cfp).pluck(:id)).pluck(:id)\n # To access conference/proposals\n can :manage, Event, program: { conference_id: conf_ids_for_cfp }\n end\n\n if conf_ids_for_info_desk\n # To access conference/proposals/registrations\n can :manage, Registration, conference_id: conf_ids_for_info_desk\n end\n end", "def authorize_pot\n authorize @pot, :contribute?\n end", "def transfer_submitter\n basic\n can :create, Transfer\n can :confirm, Transfer\n end", "def action_chpass!()\n @action = TAC_PLUS_AUTHEN_CHPASS\n end", "def activate()\n end", "def permiso_requerido\n if not protect?(action_name)\n return true\n end\n if @session['user'] and autorizado?(@session['user'], controller_name)\n return true\n end\n store_location\n access_denied\n return false\n end", "def donors_setup\n end", "def invite\n \n end", "def perform(params)\n\n init_params(params)\n\n send_secure_data_access_link\n\n notify_devs\n\n end", "def verificar_autenticado_admin\n unless session[:usuario_admin] #else if,tiene quer ser falso\n bitacora \"Intento de accceso sin autenticacion a la zona del admin\"\n flash[:error]=\"Debe autenticarse como Administrador\"\n redirect_to :action => \"index\" , :controller => \"externo\"\n return false\n end\n end", "def actionable?(c = nil)\n return unless c\n if c == contact \n true\n elsif c.privilege?(AppConstants::PRIVILEGE[:super_user]) and c.company == contact.company\n true\n else\n false\n end\n end", "def secret\n transfer_to PokerRoom # Define the PokerRoom as a controller.\n end", "def makec\n @user.add_role :celebrity\n render nothing: true\n end", "def initialize(user)\n \n user ||= User.new # guest user will not be allowed in the admin section\n alias_actions\n \n if user.super_admin?\n can :manage, :all\n elsif user.admin? || user.contractor?\n #can :manage, :all\n #can :read, :all\n #can :view_users, User do\n # user.admin?\n #end\n #authorize! :view_users, @user\n #can :create_users, User do\n # user.super_admin?\n #end\n #authorize! :create_users, @user\n #can :create_orders, User\n\n if user.trial || user.unsubscribed\n unless user.unsubscribed \n can [:make], Product if user.products.count < 1\n end\n can [:read, :change], Product, contractor_id: user.id \n else\n can :manage, Product, contractor_id: user.id\n end\n can :manage, Order, contractor_id: user.id\n can :manage, Shipment, order: {contractor_id: user.id}\n can :manage, ImageGroup, product: {contractor_id: user.id}\n can :manage, Property\n can :manage, Invoice\n\n if user.has_balance?\n can :manage, Requests::Balance, user_id: user.id\n can [:read, :make, :cancel], Requests::Transaction, balance_id: user.balance.id\n can :read, Requests::Credit\n can [:read, :make, :cancel], Requests::Withdraw\n can [:read], Requests::Refund, transaksi: {balance_id: user.balance.id} \n end\n\n can :manage, :overview\n end\n end", "def initialize(user)\n\n # guest user (not logged in) \n user ||= User.new \n\n # Alias to give proper abilities to the owner of his own course and profile\n alias_action :create, :update, :destroy, :mycourses, :myprofil, :to => :cud\n\n # Everyone can read all courses but only the owner can alter it\n can :read, Course\n can :cud, Course, :owner => user.id\n\n # Everyone can read all profiles but only the owner can alter it\n can :read, Profil\n can :cud, Profil, :user_id => user.id\n\n end", "def set_cable_opertor_comm\n @cable_opertor_comm = CableOpertorComm.find(params[:id])\n end", "def cuenta_activacion(maestro)\n @maestro = maestro \n mail to: maestro.correo, subject: \"Activa tu cuenta de profesor\"\n end", "def launchThread\n\t\t@mainThread = Thread.new do\n\n\t\t\[email protected]('introduction')\n\n\t\t\t# Recuperation du pseudo\n\t\t\t@pseudo = @com.receive('pseudo')\n\n\t\t\t$LOGGER.info \"#{@pseudo} vient de se connecter\"\n\n\t\t\tbegin\n\t\t\t\[email protected]('salons')\n\n\t\t\t\t# On fait choisir un salon\n\t\t\t\t@salon = @listeSalons.selection(self)\n\n\t\t\t\t# Test si la partie n'est pas commencée afin d'endormir le client si besoin\n\t\t\t\tif @salon.full?\n\t\t\t\t\t# On réveille les amis\n\t\t\t\t\[email protected]()\n\t\t\t\telse\n\t\t\t\t\twait()\n\t\t\t\tend\n\n\t\t\t\t# Au réveil, je vérifie que le client ne m'a pas réveillé pour changer de salon\n\t\t\tend while (@salon.nil?)\n\n\t\t\t# On initialise tout un tas de variables pour pouvoir démarrer la partie\n\t\t\tjoueur = @salon.partie.recupererInstanceJoueur(self.num)\n\n\t\t\tjoueur.definirPseudo(@pseudo)\n\t\t\t# À reprendre pour transmettre client et pas les éléments séparément\n\t\t\tgestionJoueur = GestionJoueur.new(joueur, @com, @salon)\n\n\t\t\t# Le joueur de la partie connait l'instance le gérant\n\t\t\tjoueur.obtenirInstanceGestionJoueur(gestionJoueur)\n\n\t\t\[email protected]('jeu')\n\n\t\t\t# Préparation du client pour le début de partie\n\n\t\t\t# On envoie une synthèse des personnes participant et les idéologies associées\n\t\t\[email protected]('partenaires', @salon.partie.obtenirTableauPartenaires)\n\n\t\t\t# Gestion du joueur durant toute la partie\n\t\t\twhile @salon.partie.estDemarree\n\t\t\t\tgestionJoueur.newTurn\n\t\t\tend\n\n\t\t\t# Envoi des scores finaux au client\n\t\t\[email protected]('score', @salon.partie.obtenirScores)\n\n\t\t\t# On ferme la ws\n\t\t\[email protected](code=4000)\n\t\tend\n\tend", "def authorize\n end", "def authorize\n end", "def get_started\n intro_and_request_permissions\n end", "def mco_action\n raise RuntimeError, \"Not implemented\"\n end", "def available_actions\n [\n Action::BuyCertificate,\n Action::Pass,\n Action::SellCertificates,\n Action::StartCompany\n ]\n end", "def initialize(user)\n # Define abilities for the passed in user here. For example:\n #\n user ||= User.new # guest user (not logged in)\n # if user.admin?\n # can :manage, :all\n # else\n # can :read, :all\n # end\n #\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n\n\n # To define a permission for a user, use the 'can' method inside\n # of this classes, initialize method. It takes the following args\n # (in order):\n # - The name of the action you are testing for as a symbol\n # - The class of an object we are testing against.\n # - A block that is used to determine whether or not a user can perform said action\n \n # If the block returns true, the user can perform the action, otherwise they can't\n\n if user.is_admin?\n can :manage, :all \n # manage means they can do everything (not just CRUD)\n end\n\n alias_action :create, :read, :edit, :update, :destroy, to: :crud\n\n can :crud, Question do |question|\n question.user == user\n end\n\n # We can also write abilities like:\n # can :crud, Question, use_id: user.id\n\n can :crud, Answer do |answer|\n answer.user == user\n end\n\n can :crud, JobPost do |job_post|\n job_post.user == user\n # check that if it matched\n end\n\n can :like, Question do |question|\n user.persisted? && user != question.user\n end\n\n can :destroy, Like do |like|\n like.user == user\n end\n end", "def canISteal\n @canISteal\n end", "def connect\n\tend", "def service_user(_user)\n can :access, :stats\n can :access, :export unless RuntimeConfig.elections_active?\n can :access, :voters if RuntimeConfig.elections_started? && RuntimeConfig.elections_active?\n end", "def inactivate!(reason = nil)\n end", "def initialize(user)\n\n # The first argument to `can` is the action you are giving the user\n # permission to do.\n # If you pass :manage it will apply to every action. Other common actions\n # here are :read, :create, :update and :destroy.\n #\n # The second argument is the resource the user can perform the action on.\n # If you pass :all it will apply to every resource. Otherwise pass a Ruby\n # class of the resource.\n #\n # The third argument is an optional hash of conditions to further filter the\n # objects.\n # For example, here the user can only update published articles.\n #\n # can :update, Article, :published => true\n #\n # See the wiki for details:\n # https://github.com/CanCanCommunity/cancancan/wiki/Defining-Abilities\n\n user ||= User.new\n\n # we don't do role inheritance b/c I have a sneaking feeling we\n # will want more fine-grained control for our roles as the system\n # grows.\n\n\n if ['contributor', 'editor', 'super_editor', 'admin'].member? user.role\n can [:edit, :update, :show], :all, :created_by_id => user.id\n can :create, DericciLink\n\n can :destroy, [Comment, Reply], :created_by_id => user.id\n cannot :manage, Page\n\n can :link, :all\n can :unlink, :all, :created_by_id => user.id\n can :history, :all\n\n can [:index, :new], DericciGame\n can :index, [Entry, Source, Manuscript, Comment]\n\n can :manage, PrivateMessage, :created_by_id => user.id\n can :manage, PrivateMessage do |pm|\n pm.users.include? user\n end\n can :manage, Rating\n cannot [:import, :upload], Entry\n end\n\n if ['editor', 'super_editor', 'admin'].member? user.role\n can :unlink, :all\n can :edit, Manuscript\n can :manage, DericciRecord\n\n cannot :deprecate, :all\n can :manage, Name\n cannot :review, Name\n # this needs to be RE-Established, since it has been overriden by line 51\n can :edit, :all, :created_by_id => user.id\n cannot :manage, Page\n end\n\n if ['super_editor'].member? user.role\n # allow super-editors to edit legacy records\n can [:edit, :update, :verify, :deprecate], Entry, :unverified_legacy_record => true\n can [:edit, :update], Source, :legacy => true\n can :manage, Place\n can :manage, Language\n end\n\n if ['admin'].member? user.role\n can :manage, :all\n can :update_type, Source\n end\n\n can [:edit, :update], Entry, contributors: { :id => user.id }\n cannot :manage, [Group]\n can [:edit, :update, :destroy], Group, admin: { :id => user.id }\n can [:destroy], Entry, {created_by_id: user.id, draft: true}\n\n can :show, Entry\n cannot :show, Entry do |entry|\n (entry.created_by != user && !entry.contributors.include?(user)) && entry.draft\n end\n end", "def activer\n DBC.require( !actif?, \"Cours deja actif: #{self}\" )\n\n @actif = true\n end", "def connect\n end", "def heliotrope_actor(temporal, action, env)\n Hyrax.config.callback.run(:heliotrope_actor, temporal, action, env.curation_concern, env.user) if temporal == :before\n Rails.logger.info \"heliotrope actor #{temporal} #{action} #{env.attributes}\"\n Hyrax.config.callback.run(:heliotrope_actor, temporal, action, env.curation_concern, env.user) if temporal == :after\n true\n end", "def action_login!()\n @action = TAC_PLUS_AUTHEN_LOGIN\n\n end", "def sys_admin\n speech_admin\n can :manage, :all\n end", "def send_unlock_instructions; end", "def basic\n # Any user can create a new Thesis.\n can :create, Thesis\n can :start, Thesis\n can :confirm, Thesis\n\n # Only the Thesis author can view their Thesis.\n can :read, Thesis, users: { id: @user.id }\n can :update, Thesis, users: { id: @user.id }\n end", "def initialize(user)\n if user.admin?\n can :manage, :all\n else\n can :read, :all\n can :sync_with_zendesk, :all\n can :sync_with_app, :all\n end\n end", "def dispatch_to_default_with_helpdesk\n issue = receive_issue\n roles = issue.author.roles_for_project(issue.project)\n # add owner-email only if the author has assigned some role with\n # permission treat_user_as_supportclient enabled\n if roles.any? {|role| role.allowed_to?(:treat_user_as_supportclient) }\n sender_email = @email.from.first\n #XXX the email_details overrides bellow: there is subroutine call instead\n email_details = \"From: \" + @email[:from].formatted.first + \"\\n\"\n email_details << \"To: \" + @email[:to].formatted.join(', ') + \"\\n\"\n\n custom_field = CustomField.find_by_name('cc-handling')\n custom_value = CustomValue.where(\n \"customized_id = ? AND custom_field_id = ?\", issue.project.id, custom_field.id).first\n\n if ([email protected]?) && (custom_value.value == '1')\n carbon_copy = @email[:cc].formatted.join(', ')\n email_details << \"Cc: \" + carbon_copy + \"\\n\"\n custom_field = CustomField.find_by_name('copy-to') \n\t custom_value = CustomValue.where(\n \"customized_id = ? AND custom_field_id = ?\", issue.id, custom_field.id).first\n custom_value.value = carbon_copy\n custom_value.save(:validate => false)\n else\n carbon_copy = nil\n end\n\n email_details << \"Date: \" + @email[:date].to_s + \"\\n\"\n email_details = \"<pre>\\n\" + Mail::Encodings.unquote_and_convert_to(email_details, 'utf-8') + \"</pre>\"\n\t email_details = compose_email_details()\n issue.description = email_details + issue.description\n issue.save\n custom_field = CustomField.find_by_name('owner-email')\n custom_value = CustomValue.where(\n \"customized_id = ? AND custom_field_id = ?\", issue.id, custom_field.id).\n first\n custom_value.value = sender_email\n custom_value.save(:validate => false) # skip validation!\n \n # regular email sending to known users is done\n # on the first issue.save. So we need to send\n # the notification email to the supportclient\n # on our own.\n \n HelpdeskMailer.email_to_supportclient(issue, {:recipient => sender_email,\n :carbon_copy => carbon_copy} ).deliver\n # move issue's description onto the new (1-st) journal entry\n journal = Journal.new(:journalized_id => issue.id, :journalized_type => 'Issue', :user_id => issue.author.id, :notes => issue.description, :private_notes => false, :created_on => issue.created_on)\n journal.notify = false # regular email sending to known users is done so no need to notify one more time about this technical operation\n journal.save\n issue.description = ''\n issue.save\n\n end\n after_dispatch_to_default_hook issue\n return issue\n end", "def on_authorization\n send_data \"Hello #{entered_username}! You're authorized now.\\n\"\n # NOTE: first command prompt is sent automatically after this\n end", "def authorized!\n redirect_to root_url, alert: \"You need to be set up for receiving whispers first\" and return unless current_user\n end", "def initialize(user)\n if not user # or (user.is_gym? and user.subscription.blank?) or (user.is_gym? and user.subscription.stripe_customer_token.blank?)\n# if provisional_user_id\n# can :manage, DoneDealRequest do |action, request|\n# provisional_user_id && request.provisional_user_id.to_s == provisional_user_id\n# end\n# can :manage, CustomDealRequest do |action, request|\n# provisional_user_id && request.provisional_user_id.to_s == provisional_user_id\n# end\n# can :manage, NewDealRequest do |action, request|\n# provisional_user_id && request.provisional_user_id.to_s == provisional_user_id\n# end\n# end\n# can :create, [CustomDealRequest, DoneDealRequest, NewDealRequest]\n# can :read, PressClipping\n# elsif user.is_admin?\n# can :manage, :all\n\n elsif (user.is_trainer?) and (user.subscription.blank? or user.subscription.stripe_customer_token.blank?) and user.trainer.gym.blank?\n # Plans\n ################\n can :index, Plan\n\n # Subscriptions\n ################\n can :create, Subscription\n\n elsif (user.is_gym?) and (user.subscription.blank? or user.subscription.stripe_customer_token.blank?)\n # Plans\n ################\n can :index, Plan\n\n # Subscriptions\n ################\n can :create, Subscription\n\n elsif user # user, non-admin\n# can :manage, :all\n\n # Subscriptions\n ################\n can :manage, Subscription do |action, subscription|\n subscription && (subscription.user == user)\n end\n can :create, Subscription\n# can :index, Subscription\n\n # Plans\n ################\n# can :manage, Plan do |action, plan|\n# plan && (plan.trainer == user.trainer)\n# end\n# can :create, Plan\n unless user.is_trainer? and user.trainer.gym.blank?\n can :index, Plan\n end\n\n # Documents\n ################\n can :manage, Document do |action, document|\n document && (document.trainer == user.trainer)\n end\n can :create, Document\n# can :index, Document\n\n # Trainers\n ################\n can :manage, Trainer do |action, trainer|\n trainer && (trainer.user == user or trainer.gym == user.gym)\n end\n can :create, Trainer\n can :index, Trainer\n\n # Gyms\n ################\n can :manage, Gym do |action, gym|\n gym && (gym.user == user)\n end\n can :create, Gym\n# can :index, Gym\n\n # Users\n ################\n can :manage, User do |action, u|\n u && (u == user)\n end\n can :create, User\n #can :index, User\n\n # Bodycomps\n ################\n can :manage, Bodycomp do |action, bodycomp|\n bodycomp && (bodycomp.client.trainer == user.trainer or bodycomp.client == user.client)\n end\n can :create, Bodycomp\n can :index, Bodycomp\n\n # Clients\n ################\n can :manage, Client do |action, client|\n client && (client.user == user or client.id == user.client_training_id or client.trainer == user.trainer or client.trainer.gym == user.gym)\n end\n can :create, Client\n can :index, Client\n\n # Workout_sessions\n ################\n can :manage, WorkoutSession do |action, workout_session|\n workout_session && (workout_session.user == user or user.client == workout_session.client or workout_session.client.trainer.gym == user.gym or workout_session.client.trainer == user.trainer or user.client_training_id == workout_session.client_id)\n end\n can :create, WorkoutSession\n can :index, WorkoutSession\n\n # Workouts\n ################\n can :manage, Workout do |action, workout|\n workout && (workout.user == user)\n end\n can :create, Workout\n can :index, Workout\n\n # Exercise_sessions\n ################\n can :manage, ExerciseSession do |action, exercise_session|\n exercise_session && (exercise_session.workout_session.user == user)\n end\n can :create, ExerciseSession\n can :index, ExerciseSession\n\n # Exercises\n ################\n can :manage, Exercise do |action, exercise|\n exercise && (exercise.user == user)\n end\n can :create, Exercise\n can :index, Exercise\n can :read, Exercise\n\n # Foodlogs\n ################\n can :manage, Foodlog do |action, foodlog|\n foodlog && (foodlog.client_id == user.client_training_id)\n end\n can :create, Foodlog\n can :index, Foodlog\n\n #SUPERUSER\n ################\n if user.username == \"jeremysenn\"\n can :manage, :all\n end\n end\n end", "def subscribe_to_channel; end", "def create\n # mission_owner = User.exists? mission_params[:owner_id] \n # respond_to do |format|\n\t\t#unless mission_owner.nil? \n\t\t#\towner_role = mission_owner.roles.first.id unless mission_owner.roles.first.nil? \n\t\t#end\n\t # if VALID_ADMIN_USERS.include?(owner_role)\n\t\t@mission = Mission.new(mission_params)\n\t\[email protected]\n @mission.set_status(MESA_IS_AUTHORIZED)\n #UserMission.create(user_id: current_user.id, mission_id: @mission.id,invitation_time: Time.now.utc, invitation_status: ACCEPTED_MESA_INVITATION)\n mission_owner = @mission.get_mission_owner \n\t\tUserMailer.send_new_mesa_email(mission_owner[:name],@mission.title).deliver\n #UserMailer.validate_brief_email(mission_owner[:name]).deliver\n\t\t#format.json { render :json=> {:mesa_id => @mission.id, :status => true} }\n\t # else\n\t\t#format.json { render :json=> {:error => 'You do not have permission to create mesa', :status => false} }\n\t # end\n # end\n end", "def ready\n return unless current_user.status==2\n @room = current_user.room\n publish_async(\"presence-room_#{@room.id}\",\"users_change\",{})\n current_user.update_attribute(:status, 3)\n if @room.show_next_question?\n if @next_question = choose_question!(@room)\n @room.users.each do |user|\n user.update_attribute(:status, 1)\n end\n question_id = @next_question.id\n else\n question_id = 0\n end\n\n #Publish next_question\n #If there're questions left, publish question_id\n #Else, publish question_id = 0, it will redirect user out of the room\n publish(\"presence-room_#{@room.id}\",\"next_question\", {\n question_id: question_id\n })\n render text: \"OK\",status: \"200\"\n end\n end", "def auth_pending_driver\n @user.is_driver = true\n @user.pending_driver_verification = false\n NotificationWorker.perform_async(\"became_authorized_driver\", nil, @user.id)\n NotificationWorker.perform_async(\"add_a_car\", nil, @user.id)\n if @user.save\n render nothing: true, status: 204\n else\n render :json => {:error => \"Non è stato possibile effettuare l'operazione.\"}.to_json, :status => 500\n end\n end", "def update_client!(success)\n 5.times do\n push_count = ActionCable.server.broadcast(\"auth_#{@code}\", { success: success })\n return true if push_count.positive?\n\n sleep 0.5\n end\n\n false\n end", "def act\n end", "def ligar #Metodo/função da classe Carro\n puts 'O carro está pronto para iniciar o trajeto.'\n end", "def host_authorization; end", "def host_authorization; end", "def identificarse(correo = responsables(:obi).correo, clave = '123')\n temp_controller, @controller = @controller, SesionesController.new\n\n post :create, { :correo => correo, :clave => clave }, {}\n assert_redirected_to :controller => :tareas, :action => :index\n assert_not_nil session[:responsable_id]\n\n @controller = temp_controller\n end", "def set_usuario\n \n end", "def autorun; end", "def authorise\n tmp_permission = @object_to_route_to.permission?\n if tmp_permission == \"yes\"\n permision_name = @pdt_method.method_name\n return @env.authorise(extract_actual_program_name(@pdt_method.program_name),permision_name,@user)\n elsif tmp_permission == nil\n return true\n else\n permision_name = tmp_permission\n return @env.authorise(extract_actual_program_name(@pdt_method.program_name),permision_name,@user)\n end\n\n end", "def client; end", "def client; end", "def connect!\n end", "def user_actions(user)\n can_act_as_logged_in_user(user) unless Revs::Application.config.restricted_beta # also have logged in privileges if we are not in beta\n end", "def es_propietario\n set_entrega\n if @entrega.recolector != current_user\n render json: {entrega: [\"No permitido para este usuario\"]}, status:401\n end\n end", "def warden; end", "def warden; end" ]
[ "0.5792495", "0.57833564", "0.5744827", "0.56624395", "0.5635397", "0.56341416", "0.5529034", "0.5501633", "0.54921734", "0.54668206", "0.54336053", "0.5421039", "0.5418851", "0.537546", "0.5374013", "0.5373845", "0.5350416", "0.5323263", "0.53216326", "0.53087735", "0.5305907", "0.52944624", "0.5281888", "0.5280855", "0.52718467", "0.5265844", "0.52654195", "0.52638906", "0.5262513", "0.52552557", "0.52487075", "0.5246885", "0.52363664", "0.52250236", "0.5223422", "0.5215071", "0.5214073", "0.5214073", "0.51963025", "0.51914984", "0.5186561", "0.5185285", "0.51815844", "0.5180302", "0.51773626", "0.51758814", "0.51750326", "0.5168319", "0.51580375", "0.51508766", "0.51501924", "0.5149671", "0.51463497", "0.5141393", "0.5137517", "0.51367897", "0.5136171", "0.5126964", "0.5126964", "0.511848", "0.5114675", "0.5113595", "0.5097855", "0.5093917", "0.50927395", "0.5091495", "0.5090354", "0.509022", "0.50788474", "0.5075496", "0.50703955", "0.50676185", "0.506358", "0.50630414", "0.5062602", "0.505687", "0.50548095", "0.5053905", "0.5053279", "0.5052872", "0.50515383", "0.5051275", "0.50457084", "0.50441563", "0.50428534", "0.5041873", "0.50415003", "0.5036838", "0.5036838", "0.50336885", "0.50246406", "0.50182515", "0.5017661", "0.5015156", "0.5015156", "0.50112516", "0.5010942", "0.5005868", "0.5004629", "0.5004629" ]
0.50530076
79
GET /gnodes/1 GET /gnodes/1.json
def show @gnode = Gnode.find(params[:id]) respond_to do |format| format.html # show.html.erb format.json { render json: @gnode } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def __get_nodes\n JSON.parse(Net::HTTP.get(URI(\"#{__cluster_url}/_nodes/process\")))\n end", "def nodes\r\n params = {\r\n method: :get,\r\n url: '/project/nodes',\r\n params: { prjUUID: @uuid }\r\n }\r\n @session.request(**params).perform!['nodes']\r\n end", "def nodes\n core_client.get_nodes\n end", "def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nodes }\n end\n end", "def node(id, params = {})\n get \"nodes/#{id}\", {query: params}\n end", "def nodes\n request.get(path: node_index_path, auth_token: auth_token)\n end", "def new\n @gnode = Gnode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gnode }\n end\n end", "def index\n @title = \"All Nodes\"\n @nodes = Node.order(:id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nodes }\n end\n end", "def get_nodes\n\tq = '[\"=\", [\"node\", \"active\"], true]'\n\n\tif ! q.is_a? String then\n\t\tq=JSON[q]\n\t\tend\n\tparams = {:query => q}\n\n response_nodelist = RestClient.get\"http://#{Tayu.puppetdb_server}:#{Tayu.puppetdb_port}/nodes\", { :accept => :json, :params => params }\n return JSON.parse(response_nodelist)\n end", "def index\n @node = Fedora.rest('rest/')\n end", "def index\n @nodes = @job.nodes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n format.json { render :json => @nodes }\n end\n end", "def show\n #@server_nodes = ServerNode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @server_node }\n end\n end", "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def show\n @compute_node = ComputeNode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compute_node }\n end\n end", "def nodes\n TestLab::Node.all\n end", "def show\n get_node_and_network(params[:id] || params[:name])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @node }\n format.json { render :json => (params[:key].nil? ? @node : @node[params[:key]]) }\n end\n end", "def getNodeFeatureData\n\t render json: Network.getFeatureData(params)\n\tend", "def get_nodes(opts = {})\n data, _status_code, _headers = get_nodes_with_http_info(opts)\n return data\n end", "def getNodeList\n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n result = HTTParty.get(broker_url + \"/resources/nodes\", :verify => false)\n temp2 = JSON.parse(result.body)\n\n node_data = temp2[\"resource_response\"][\"resources\"]\n return node_data\n \n end", "def show\n @project = Project.find(params[:id])\n # @nodes = Node.where(:project_id => @project)\n @nodes = Node.find(:all)\n @json = @nodes.to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @project }\n end\n end", "def index\n @nodes = Node.admin\n response.headers['Content-Range'] = @nodes.count\n render json: @nodes.reorder(id: :asc).as_json(admin: true)\n end", "def nodes\n nodes_by_id.values\n end", "def show\n @node_index = NodeIndex.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node_index }\n end\n end", "def get_nodegroups()\n nodemgr_rest_call(\"GET\", \"classifier\", \"groups\", $credentials)\nend", "def nodes_list\n @job = Job.find(params[:job_id])\n render :partial => \"nodes_list\", :locals => { :job => @job }\n end", "def create\n @gnode = Gnode.new(params[:gnode])\n\n respond_to do |format|\n if @gnode.save\n format.html { redirect_to @gnode, notice: 'Gnode was successfully created.' }\n format.json { render json: @gnode, status: :created, location: @gnode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @node = Node.find(params[:id])\n @json = Node.find(params[:id]).to_gmaps4rails\n # @json = Node.where(:user_id => current_user[:id]).to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @node }\n end\n end", "def index\n @retain_nodes = RetainNode.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @retain_nodes }\n format.json { render :json => @retain_nodes }\n end\n end", "def get_nodes_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UpgradeApi.get_nodes ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_nodes, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling UpgradeApi.get_nodes, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/upgrade/nodes\"\n\n # query parameters\n query_params = {}\n query_params[:'component_type'] = opts[:'component_type'] if !opts[:'component_type'].nil?\n query_params[:'component_version'] = opts[:'component_version'] if !opts[:'component_version'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodeInfoListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UpgradeApi#get_nodes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n render :json => @node\n end", "def nodes\n @conn.nodes\n end", "def destroy\n @gnode = Gnode.find(params[:id])\n @gnode.destroy\n\n respond_to do |format|\n format.html { redirect_to gnodes_url }\n format.json { head :no_content }\n end\n end", "def json_for(node)\n JSON.parse(File.read(\"#{@repository_path}/nodes/#{node}.json\"))\n end", "def index_coin\n @nodes = Node.where(coin: params[:coin].upcase).order(client_type: :asc ,name: :asc, version: :desc)\n\n render json: @nodes\n end", "def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end", "def get_registered_nodes\n update_nodes\n @registered_nodes\n end", "def show\n @node_template = NodeTemplate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node_template }\n end\n end", "def index\n @newnodes = Newnode.all\n end", "def show\n @node = Node.find(params[:id])\n @title = @node.title\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def index\n @nodes = Node.all\n @rtt = {}\n @loss = {}\n conf = Collectd::Collectd.new\n @nodes.each do |node|\n collectd_node = Collectd::CollectdNode.new(node.id.to_s(16),node.link_local_address)\n begin\n @rtt[node] = conf.stat(collectd_node,\"ping\",nil,nil).rtt_5_min\n @loss[node] = conf.stat(collectd_node,\"ping\",nil,nil).loss_5_min\n rescue Exception => e #Ignore errors in single hosts (-> missing rrd-Files for newly created ...)\n logger.error \"Unable to calculate stats: #{e}\"\n end\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.json do \n data = {}\n @nodes.each do |n| \n data[n.id] = {id_hex: n.id_hex, \n loss_5_min: (@loss[n].nil? || @loss[n].nan?) ? nil : @loss[n], \n rtt_5_min: (@loss[n].nil? || @rtt[n].nan?) ? nil : @rtt[n]}\n end\n render json: data\n end\n end\n end", "def show\n @node = Node.find(params[:id])\n unless @node.status == '2'\n @matched_build_objects = BuildObject.actual.where(\"user_id != ?\", current_user)\n @matched_nodes = Node.includes{ [sell] }.where { (sell.user_id != my {current_user}) & ( status != 2 ) }.matched_by_node @node #(\"build_objects.user_id != ? AND status != 2\", current_user).matched_by_node @node\n @matched_build_objects = BuildObject.match(@node)\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @node }\n end\n end", "def index\n #@server_nodes = ServerNode.all, :order => 'created_at DESC'\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @server_nodes }\n end\n end", "def get(\n id,\n deadline: nil\n )\n req = V1::NodeGetRequest.new()\n if not @parent.snapshot_time.nil?\n req.meta = V1::GetRequestMetadata.new()\n req.meta.snapshot_at = @parent.snapshot_time\n end\n\n req.id = (id)\n tries = 0\n plumbing_response = nil\n loop do\n begin\n plumbing_response = @stub.get(req, metadata: @parent.get_metadata(\"Nodes.Get\", req), deadline: deadline)\n rescue => exception\n if (@parent.shouldRetry(tries, exception))\n tries + [email protected](tries)\n next\n end\n raise Plumbing::convert_error_to_porcelain(exception)\n end\n break\n end\n\n resp = NodeGetResponse.new()\n resp.meta = Plumbing::convert_get_response_metadata_to_porcelain(plumbing_response.meta)\n resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)\n resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)\n resp\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def index\n @sum = 0\n session[:node] = params[:name]\n if params.has_key?(:role)\n result = NodeObject.all #this is not efficient, please update w/ a search!\n @nodes = result.find_all { |node| node.role? params[:role] }\n if params.has_key?(:names_only)\n names = @nodes.map { |node| node.handle }\n @nodes = {:role=>params[:role], :nodes=>names, :count=>names.count}\n end\n else\n @groups = {}\n @nodes = {}\n raw_nodes = NodeObject.all\n get_node_and_network(params[:selected]) if params[:selected]\n raw_nodes.each do |node|\n @sum = @sum + node.name.hash\n @nodes[node.handle] = { :alias=>node.alias, :description=>node.description, :status=>node.status }\n group = node.group\n @groups[group] = { :automatic=>!node.display_set?('group'), :status=>{\"ready\"=>0, \"failed\"=>0, \"unknown\"=>0, \"unready\"=>0, \"pending\"=>0}, :nodes=>{} } unless @groups.key? group\n @groups[group][:nodes][node.group_order] = node.handle\n @groups[group][:status][node.status] = (@groups[group][:status][node.status] || 0).to_i + 1\n if node.handle === params[:name]\n @node = node\n get_node_and_network(node.handle)\n end\n end\n flash[:notice] = \"<b>#{t :warning, :scope => :error}:</b> #{t :no_nodes_found, :scope => :error}\" if @nodes.empty? #.html_safe if @nodes.empty?\n end\n respond_to do |format|\n format.html # index.html.haml\n format.xml { render :xml => @nodes }\n format.json { render :json => @nodes }\n end\n end", "def getNodeStatus(node_id) \n cm_url = APP_CONFIG['cm_ip'] + ':' + APP_CONFIG['cm_port'].to_s\n res = HTTParty.get(cm_url+\"/resources/node/\"+ node_id)\n # puts \"status \"+node_id\n # puts res\n return res\n\n end", "def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end", "def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end", "def collect_ganeti(cluster)\n node_template = ERB.new File.new('cache_templates/node_template.erb').read,\n nil, '%'\n\n # for each cluster, append port number, endpoint, and query.\n uri = URI(\"https://#{cluster}.osuosl.bak:5080/2/instances?bulk=1\")\n begin\n Net::HTTP.start(uri.host, uri.port,\n use_ssl: uri.scheme == 'https',\n verify_mode: OpenSSL::SSL::VERIFY_NONE) do |http|\n # perform get request on full path. If this doesn't work, program\n # control will jump to the rescue block below.\n response = http.request Net::HTTP::Get.new uri\n # Store returned information in with datetime and node name\n JSON.parse(response.body).each do |node|\n node_name = node['name'] || 'unknown'\n disk_sizes_meas = node['disk.sizes'] || 'unknown'\n disk_usage_meas = node['disk_usage'] || 'unknown'\n disk_template_meas = node['disk_template'] || 'unknown'\n num_cpus_meas = node['oper_vcpus'] ||\n node['beparams']['vcpus'] ||\n node['custom_beparams']['vcpus'] || 'unknown'\n total_ram = node['beparams']['memory'] || 'unknown'\n active_meas = node['oper_state']\n type = 'ganeti'\n\n @node_cache.set(node_name, JSON.parse(node_template.result(binding)))\n @node_cache.set(node_name + ':datetime', Time.new.inspect)\n end\n end\n rescue JSON::ParserError, SocketError => e\n MyLog.log.fatal \"Error getting ganeti data from #{cluster}: #{e}\"\n end\n @node_cache.write\n end", "def url\n \"#{@options[:pe_enc_url]}/v1/classified/nodes/#{@options[:node]}\"\n end", "def get(key, options = {})\n custom_params = options[:dc] ? use_named_parameter('dc', options[:dc]) : nil\n ret = send_get_request(@conn, [\"/v1/catalog/node/#{key}\"], options, custom_params)\n OpenStruct.new JSON.parse(ret.body)\n end", "def index\n if params[:id] then\n @nodes = Node.find_all_by_id(params[:id].split(','), :include => [:previous_nodes, :next_nodes, :related_nodes_A, :related_nodes_B])\n else\n @nodes = Node.all :include => [:previous_nodes, :next_nodes, :related_nodes_A, :related_nodes_B]\n end\n \n Action.log :controller => params[:controller], :action => params[:action], :user => current_user\n\n respond_to do |format|\n format.html { render :layout => !request.xhr? } # index.html.erb\n format.json #{ render json: @nodes }\n end\n end", "def nodes\n @grpc.serve_nodes\n end", "def show\n @retain_node = RetainNode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @retain_node }\n format.json { render :json => @retain_node }\n end\n end", "def nodes\n @nodes ||= {}\n end", "def nodes\n @nodes ||= {}\n end", "def show\n @obj = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @obj }\n end\n end", "def show\n @node = Node.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @node }\n format.json { render :json => @node } \n end\n end", "def new\n @server_node = ServerNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_node }\n end\n end", "def nodes # :nodoc:\n return @nodes if defined?(@nodes) \n node_ids = (1..Configuration.numbers['total_nodes'])\n @nodes = node_ids.map do |id| \n {\n id: id,\n host: \"node_#{id}_#{Worker::VERSION}\"\n }.to_struct\n end\n end", "def request_path\n \"/nodes/id/681e84fd-b06b-4044-9c51-2b74a9e2dc24/storage/id/d66570fa-9d51-4f6e-ab26-bdace295353e\"\nend", "def data\n @map = Map.find(params[:map_id])\n @categories = @map.categories\n p \"--------- @map ---------\"\n p @map.nodes.to_json\n response = { nodes: [], edges: []}\n @map.nodes.each do |n|\n response[:nodes] << {id: n.id, name: n.name, description: n.description}\n n.rels.each do |rel|\n start = idIndex(@map.nodes, rel.start_node.id)\n stop = idIndex(@map.nodes, rel.end_node.id)\n if !start.nil? && !stop.nil?\n response[:edges] << {source: start, target: stop, type: rel.rel_type }\n end\n end\n end\n index_offset = @map.nodes.count \n @categories.each do |n|\n response[:nodes] << {id: n.id, name: n.name}\n n.rels.each do |rel|\n start = idIndex(@map.nodes, rel.start_node.id)\n stop = idIndex(@categories, rel.end_node.id, index_offset)\n if !start.nil? && !stop.nil?\n response[:edges] << {source: start, target: stop, type: rel.rel_type }\n end\n end\n end\n p \"------------ response -----------\"\n puts response.to_json\n respond_to do |format|\n format.html { render 'graph/show'}\n format.json { render json: response}\n end\nend", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def new\n @compute_node = ComputeNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compute_node }\n end\n end", "def show\n @node_incident = NodeIncident.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @node_incident }\n end\n end", "def index\n @node_templates = NodeTemplate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @node_templates }\n end\n end", "def addresses\n nodename = params[:node_id]\n @node = nodename == \"admin\" ? Node.admin.where(:available => true).first : Node.find_key(nodename)\n if params[:network]\n @net = Network.find_key(params[:network])\n res = {\n \"node\" => @node.name,\n \"network\" => @net.name,\n \"category\" => @net.category,\n \"addresses\" => @net.node_allocations(@node).map{|a|a.to_s}\n }\n render :json => res, :content_type=>cb_content_type(:addresses, \"object\")\n else\n res = []\n\n if params[:category]\n nets = Network.in_category(params[:category])\n else\n nets = Network.all\n end\n\n nets.each do |n|\n ips = n.node_allocations(@node)\n next if ips.empty?\n\n res << {\n \"node\" => @node.name,\n \"network\" => n.name,\n \"category\" => n.category,\n \"addresses\" => ips.map{|a|a.to_s}\n }\n end\n\n render :json => res, :content_type=>cb_content_type(:addresses, \"array\")\n end\n end", "def nodelist\n runopts(:nodelist)\n end", "def index\n puts \"xxxxxxx NodesC a:index xxxxxxx\"\n @nodes = Node.paginate(page: params[:page])\n #byebug\n end", "def index\n @nodes = Node.all\n @registerable_nodes = Node.registerable(request.remote_ip)\n @unregistered = Node.all_unregistered if permitted_to? :all_unregistered, :nodes\n @node_registrations = NodeRegistration.all\n \n if permitted_to? :register_all, :nodes\n @registerable_nodes = @unregistered\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end", "def travel_nodes\n if @event.travel_nodes_done?\n render :json => @event.to_json, :status => :ok\n elsif @event.waiting? || @event.travel_nodes_progress?\n render :nothing => true, :status => :not_found\n else\n render :nothing => true, :status => :gone\n end\n end", "def help_node_names_data\n\t\t__elasticsearch__.client.cat.nodes(:format => 'json', :h => 'name')\n\tend", "def nodes; end", "def nodes; end", "def nodes; end", "def index\n @pm_nodes = Pm::Node.all\n end", "def new\n @node = @job.nodes.build \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n format.json { render :json => @node } \n end\n end", "def index\n if(params.has_key?(:floor) && params.has_key?(:building))\n @nodes = Node.where(:floor => params[:floor],:building => params[:building])\n elsif(params.has_key?(:floor).present?)\n @nodes = Node.where(:floor => params[:floor])\n elsif(params.has_key?(:building).present?)\n @nodes = Node.where(:building => params[:building])\n else\n @nodes = Node.all\n end\n\n respond_to do |format|\n format.any { render json: @nodes, content_type: 'application/json' }\n end\n end", "def nodes(reload = false)\n load if reload\n @info['nodes'].map do |node|\n Drain::Node.new(\n stats['nodes'].find { |n| n[0] == node[0] },\n node,\n client,\n @asg\n )\n end\n end", "def nodes\n state(metrics: \"nodes\").dig(\"nodes\")\n end", "def get_node_data(url)\n begin\n response = RestClient.get(url,\n authorization: \"Basic #{Base64.strict_encode64(\"#{@username}:#{@password}\")}\",\n content_type: 'application/json',\n accept: 'application/json',\n timeout: 120)\n response_data = JSON.parse(response)\n result = response_data['result'][0]\n\n rescue RestClient::ExceptionWithResponse => e\n e.response\n @logger.err(e.response) unless @logger.nil?\n result = nil\n end\n\n update_attributes(result)\n end", "def get id\n @nodes[id]\n end", "def get_node(node)\n\t\t\t@nodes[node]\n\t\tend", "def get_node_with_http_info(uuid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.get_node ...\"\n end\n # verify the required parameter 'uuid' is set\n fail ArgumentError, \"Missing the required parameter 'uuid' when calling DefaultApi.get_node\" if uuid.nil?\n # resource path\n local_var_path = \"/{uuid}\".sub('{format}','json').sub('{' + 'uuid' + '}', uuid.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Node')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#get_node\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @nugget = Nugget.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nugget }\n end\n end", "def new\n @map = Map.find(params[:map_id])\n\n #@node = Node.new\n @node = @map.nodes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def query_by_nodename(nodename)\n query = {\"query\" => \"SELECT NodeName, NodeID FROM Orion.Nodes WHERE NodeName=@name\", \"parameters\" => {\"name\" => \"#{nodename}\"}}\n do_http_request(@querypath, query)\n end", "def get_node\n # @@neo = Neography::Rest.new\n begin\n # qur = \"MATCH (n {object_id: \"+self.id.to_s+\", object_type: \\'\"+self.class.to_s+\"\\' }) RETURN n LIMIT 1\"\n # response = @@neo.execute_query(qur)\n # node_id = response[\"data\"].flatten.first[\"metadata\"][\"id\"]\n node_id = self.get_node_id\n node = (node_id ? Neography::Node.load(node_id, @@neo) : nil)\n return node\n rescue Exception\n return nil\n end\n end", "def index\n neo = Neography::Rest.new\n r = neo.execute_query(\"START n=node(*) RETURN n;\")\n r[\"data\"].shift # first node is wacky\n @cities = r[\"data\"].map { |node|\n OpenStruct.new(node[0][\"data\"].merge(id: node[0][\"self\"].match(/node\\/(\\d+)$/)[1].to_i))\n }\n end", "def index\n @nodes = Node.all\n @title = \"List of taxonomy nodes - Browse organisms\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end", "def show\n @cluster = Cluster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cluster }\n end\n end", "def index\r\n @story = Story.find(params[:story_id])\r\n @nodes = @story.nodes\r\n end", "def find_nodes_with_http_info(term, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: QueriesApi.find_nodes ...\"\n end\n # verify the required parameter 'term' is set\n fail ArgumentError, \"Missing the required parameter 'term' when calling QueriesApi.find_nodes\" if term.nil?\n if !opts[:'skip_count'].nil? && opts[:'skip_count'] < 0.0\n fail ArgumentError, 'invalid value for \"opts[:\"skip_count\"]\" when calling QueriesApi.find_nodes, must be greater than or equal to 0.0.'\n end\n\n if !opts[:'max_items'].nil? && opts[:'max_items'] < 1.0\n fail ArgumentError, 'invalid value for \"opts[:\"max_items\"]\" when calling QueriesApi.find_nodes, must be greater than or equal to 1.0.'\n end\n\n # resource path\n local_var_path = \"/queries/nodes\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'term'] = term\n query_params[:'rootNodeId'] = opts[:'root_node_id'] if !opts[:'root_node_id'].nil?\n query_params[:'skipCount'] = opts[:'skip_count'] if !opts[:'skip_count'].nil?\n query_params[:'maxItems'] = opts[:'max_items'] if !opts[:'max_items'].nil?\n query_params[:'nodeType'] = opts[:'node_type'] if !opts[:'node_type'].nil?\n query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :csv) if !opts[:'include'].nil?\n query_params[:'orderBy'] = @api_client.build_collection_param(opts[:'order_by'], :csv) if !opts[:'order_by'].nil?\n query_params[:'fields'] = @api_client.build_collection_param(opts[:'fields'], :csv) if !opts[:'fields'].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 = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NodePaging')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: QueriesApi#find_nodes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end" ]
[ "0.6999959", "0.6914701", "0.67783946", "0.6659386", "0.66576815", "0.6574512", "0.6488312", "0.64699525", "0.6384202", "0.6309582", "0.63084364", "0.62858725", "0.6282642", "0.6282642", "0.6282642", "0.6282642", "0.6282642", "0.6282112", "0.61778694", "0.6170559", "0.615136", "0.6065959", "0.6047684", "0.6025773", "0.6018334", "0.6010922", "0.6000518", "0.59623885", "0.59567827", "0.5927552", "0.58895266", "0.58840007", "0.5874181", "0.58597535", "0.58583564", "0.58425474", "0.58314896", "0.5828013", "0.58276385", "0.58169013", "0.5769839", "0.57693124", "0.5765187", "0.57547057", "0.57512265", "0.5747275", "0.5746114", "0.57435006", "0.57435006", "0.57435006", "0.57435006", "0.5729554", "0.5721855", "0.57065284", "0.57065284", "0.57030153", "0.56702363", "0.5670023", "0.5664704", "0.5664276", "0.56600195", "0.5652647", "0.5652647", "0.5652576", "0.56428033", "0.56343544", "0.5632017", "0.56301004", "0.5629487", "0.5616635", "0.56125635", "0.5590543", "0.5587925", "0.55876815", "0.558473", "0.5576867", "0.55734086", "0.5564496", "0.55630493", "0.5550649", "0.5550649", "0.5550649", "0.55469084", "0.55428934", "0.5542269", "0.55316246", "0.5529671", "0.552894", "0.5527692", "0.5526045", "0.55122167", "0.5509672", "0.5506685", "0.5499513", "0.5460741", "0.54400957", "0.54396874", "0.5439198", "0.54384685", "0.5435797" ]
0.7236844
0
GET /gnodes/new GET /gnodes/new.json
def new @gnode = Gnode.new respond_to do |format| format.html # new.html.erb format.json { render json: @gnode } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def create\n @gnode = Gnode.new(params[:gnode])\n\n respond_to do |format|\n if @gnode.save\n format.html { redirect_to @gnode, notice: 'Gnode was successfully created.' }\n format.json { render json: @gnode, status: :created, location: @gnode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @newnode = Newnode.new(newnode_params)\n\n respond_to do |format|\n if @newnode.save\n format.html { redirect_to @newnode, notice: 'Newnode was successfully created.' }\n format.json { render :show, status: :created, location: @newnode }\n else\n format.html { render :new }\n format.json { render json: @newnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @node_template = NodeTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node_template }\n end\n end", "def new\n @server_node = ServerNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_node }\n end\n end", "def new\n @compute_node = ComputeNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @compute_node }\n end\n end", "def new\n @node = @job.nodes.build \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n format.json { render :json => @node } \n end\n end", "def new\n @node = Node.new\n authorize! :create, @node\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @map_node = Map::Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @map_node }\n end\n end", "def new\n @map = Map.find(params[:map_id])\n\n #@node = Node.new\n @node = @map.nodes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @obj = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @obj }\n end\n end", "def new\n @node = Node.new\n @node.addresses.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n 3.times { @node.related_edges_B.build }\n 3.times { @node.incoming_edges.build }\n 3.times { @node.outgoing_edges.build }\n \n Action.log :controller => params[:controller], :action => params[:action], :user => current_user\n\n respond_to do |format|\n format.html { render :layout => !request.xhr? } # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @retain_node = RetainNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node }\n format.json { render :json => @retain_node }\n end\n end", "def new\n @registration = NodeRegistration.new\n node_id = params[:node]\n \n if(mac = params[:node_mac])\n mac.gsub!(/[^A-Fa-f0-9]/,'')\n node_id = mac.to_i(16)\n logger.info \"Got node-id: #{node_id}\"\n end\n\n node = Node.find_by_id(node_id) || Node.new(id: node_id)\n \n if(node && node.node_registration.present?)\n flash[:error] = \"Fehler: Der Node #{node.mac} ist bereits registriert.\"\n redirect_to app_index_path\n return\n end\n\n @registration.node = node\n @registration.owner = current_user\n @registration.osm_loc = \"Suchbegriff\"\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registration }\n end\n end", "def new\n @node_index = NodeIndex.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node_index }\n end\n end", "def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @gpath = Gpath.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gpath }\n end\n end", "def index\n @newnodes = Newnode.all\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def create\n n = Node.create! params\n render api_show :node, Node, n.id.to_s, nil, n\n end", "def new\n @node = Node.new(:displayed => true)\n @node.template = Template.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def set_newnode\n @newnode = Newnode.find(params[:id])\n end", "def new_nodegroup(nodegroup_json)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=\"\", nodegroup_json)\nend", "def create\n #@server_node = ServerNode.new(params[:server_node])\n #@server_node = ServerNode.create() do |n|\n # n.name = params[:node][:name]\n\t# n.region = params[:node][:region]\n\t# n.status = params[:node][:status]\n\n #end\n\n respond_to do |format|\n if @server_node.save\n format.html { redirect_to @server_node, notice: 'Server node was successfully created.' }\n format.json { render json: @server_node, status: :created, location: @server_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @server_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n @node.project_id = current_user.project_id\n @node.user_id = current_user.id\n\[email protected] = true\n\[email protected] = true\n\tputs @node.inspect\n respond_to do |format|\n if @node.save\n format.html { redirect_to root_path(tab:\"newnode\"), notice: 'Node ' + @node.working_name + ' has been added'}\n format.json { render json: @node, status: :created, location: @node }\n else\n\t\tflash[:error] = @node.errors\n format.html { redirect_to root_path(tab:\"newnode\")}\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n megam_rest.post_node(to_hash)\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save!\n format.html { redirect_to @node, notice: 'Встречная продажа создана' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @node = Node.new\n @node.owner = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @comment_node = CommentNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @comment_node }\n end\n end", "def create\n @map_node = Map::Node.new(params[:map_node])\n\n respond_to do |format|\n if @map_node.save\n format.html { redirect_to @map_node, notice: 'Node was successfully created.' }\n format.json { render json: @map_node, status: :created, location: @map_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @map_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @graph = Graph.new\n 3.times { @graph.graph_membership_graphs.build }\n 3.times { @graph.graph_membership_nodes.build }\n \n Action.log :controller => params[:controller], :action => params[:action], :user => current_user\n\n respond_to do |format|\n format.html { render :layout => !request.xhr? } # new.html.erb\n format.json { render json: @graph }\n end\n end", "def new\n @node = Node.new(:user_id => current_user[:id])\n project = Project.where(:user_id => current_user[:id]).first\n project.optimized = false\n project.loading= false\n project.save\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @node_incident = NodeIncident.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @node_incident }\n end\n end", "def create\n @node = Node.new(node_params)\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @node }\n else\n format.html { render :new }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(node_params)\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @node }\n else\n format.html { render :new }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(node_params)\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @node }\n else\n format.html { render :new }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @obj = Node.new(params[:node])\n\n respond_to do |format|\n if @obj.save\n format.html { redirect_to @obj, notice: 'Node was successfully created.' }\n format.json { render json: @obj, status: :created, location: @obj }\n else\n format.html { render action: \"new\" }\n format.json { render json: @obj.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @network = Network.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @network }\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if (@job.nodes << @node)\n flash[:notice] = 'Node was successfully created.'\n format.html { redirect_to job_url(@job) }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @gossip = Gossip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gossip }\n end\n end", "def new\n @submit_text = \"Create Post\"\n @node = Node.new(:title => params[:title])\n @topic_id = params[:topic_id]\n @source_id = params[:source_id]\n\n # Set path to redirect to after node is created.\n\n flash[:page_to_redirect_to] = request.referer\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end", "def new\n @cluster = Cluster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cluster }\n end\n end", "def new\n @f5_node = F5Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @f5_node }\n end\n end", "def create\n @compute_node = ComputeNode.new(params[:compute_node])\n\n respond_to do |format|\n if @compute_node.save\n format.html { redirect_to @compute_node, notice: 'Compute node was successfully created.' }\n format.json { render json: @compute_node, status: :created, location: @compute_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @compute_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_node\n id = @nodes.size\n node = Node.new(id: id)\n @nodes.push(node)\n id\n end", "def create\n @node = Node.new(params[:node])\n authorize! :create, @node\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @admin_geonode = Admin::Geonode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_geonode }\n end\n end", "def create\n @pm_node = Pm::Node.new(pm_node_params)\n\n respond_to do |format|\n if @pm_node.save\n format.html { redirect_to @pm_node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @pm_node }\n else\n format.html { render :new }\n format.json { render json: @pm_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n \n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @retain_node_selector = RetainNodeSelector.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @retain_node_selector }\n end\n end", "def new\n @torneo = Torneo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @torneo }\n end\n end", "def new\n @tree = Tree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tree }\n end\n end", "def create\n puts \"xxxxxxx NodesC a:create xxxxxxx\"\n # Whitelisting is used to secure our actions from processing un-identified\n # parameters sent in the http request, this is a new Rails 4 feature\n #@node = Node.new(white_listed_params)\n\n puts \"1XXXXXXX params:\", params, \" ...YYYYYYYYYYYYY\"\n puts \"2XXXXXXX params[:node]:\", params[:node], \" ...YYYYYYYYYYYYY\"\n puts \"3XXXXXXX params[:node][:name_display]:\",params[:node][:name_display], \" ...YYYYYYYYYYYYY\"\n\n @node = Node.new(params[:node]) \n @node.user_id = current_user.id\n \n if @node.save\n flash[:success] = \"Node #{@node.name_display} saved successfully.\"\n # nodes_path is a helper that uses routes.rb to return\n # a string like '/nodes'.\n # redirect_to is a function that takes the relative url\n # and sends a 302 redirect to the browser\n redirect_to nodes_path\n else\n render :new\n end\n puts \"4XXXXXXX @node.to_yaml\", @node.to_yaml , \"... this is an object YYYYYYYYYYYY\"\n puts \"5XXXXXXX @node.user_id.inspect\", @node.user_id.inspect , \"... object property YYYYYYYYYYYYYYYY\"\n end", "def create\n pt = params[:news]\n @news = News.new(pt)\n @news.user_id = current_user.id\n @news.node_id = params[:node] || pt[:node_id]\n\n respond_to do |format|\n if @news.save\n format.html { redirect_to @news, notice: t(\"news.create_news_success\")}\n format.json { render json: @news, status: :created, location: @news }\n else\n format.html { render action: \"new\" }\n format.json { render json: @news.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n @node.broadcast_add_me\n Cue.send_all_pending\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new_node\n\t\t\traise NotImplementedError.new('#new_node must be implemented')\n\t\tend", "def request!\n PoolNode.create_or_get(@id, node)\n end", "def create\n @node_template = NodeTemplate.new(params[:node_template])\n\n respond_to do |format|\n if @node_template.save\n format.html { redirect_to @node_template, notice: 'Node template was successfully created.' }\n format.json { render json: @node_template, status: :created, location: @node_template }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node_template.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood }\n end\n end", "def new\n @neighborhood = Neighborhood.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood }\n end\n end", "def ajax_add_node\n\n # Create a new Node Instance\n node = Node.new\n\n # Update the fields of Node Instance\n node.app_id = params[:app_id]\n node.funnel_id = params[:funnel_id]\n\n if params[:email_template_id] == '0'\n # Create a new Email Template\n template = EmailTemplate.new\n template.app_id = params[:app_id]\n template.name = params[:name] + ' Email Template'\n template.description = ''\n template.email_subject = ''\n template.color = '#3498db'\n\n # Save blank Email Template\n template.save\n\n node.email_template_id = template.id\n\n else\n node.email_template_id = params[:email_template_id]\n\n end\n\n node.name = params[:name]\n node.delay_time = params[:delay_time]\n node.delay_unit = params[:delay_unit]\n node.top = 60\n node.left = 500\n node.num_emails = 0\n node.num_emails_sent = 0\n node.num_revenue = 0.0\n node.num_emails_opened = 0\n node.num_emails_clicked = 0\n\n\n\n node.save\n\n response = {\n success: true,\n message: 'Node Saved',\n id: node.id,\n email_template_id: node.email_template_id\n\n }\n\n render json: response\n\n\n\n end", "def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end", "def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n Action.log :controller => params[:controller], :action => params[:action], :target_id => @node.id, :user => current_user\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n @node.related_edges_B.build\n @node.incoming_edges.build\n @node.outgoing_edges.build\n format.html { render action: \"new\", :layout => !request.xhr? }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n Souffle::Log.info \"#{@node.log_prefix} Creating a new node...\"\n provider.create_node(@node)\n end", "def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end", "def create\n\n\n @node = Node.new(params[:node])\n @node.user_id = current_user[:id]\n @json = Node.where(:user_id => current_user[:id]).to_gmaps4rails\n current_user[:optimized] = false\n\n if @node.save\n @nodes = Node.where(:user_id => current_user[:id])\n @nodes.each do |node|\n node.jobnumber = nil\n node.vehicle_id = nil\n node.servicetime = nil\n node.tour_id = nil\n node.save\n end\n project = Project.where(:user_id => current_user[:id]).first\n project.optimized = false\n project.loading = false\n project.save\n end\n\n\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(nodes_path, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @retain_node = RetainNode.new(params[:retain_node])\n\n respond_to do |format|\n if @retain_node.save\n flash[:notice] = 'RetainNode was successfully created.'\n format.html { redirect_to(@retain_node) }\n format.xml { render :xml => @retain_node, :status => :created, :location => @retain_node }\n format.json { render :json => @retain_node, :status => :created, :location => @retain_node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @retain_node.errors, :status => :unprocessable_entity }\n format.json { render :json => @retain_node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n b.node = type.build(node_params)\n authorize! :create, b.node\n respond_to do |format|\n if b.node.save\n format.html { redirect_to b.node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: b.node }\n else\n format.html { render :new }\n format.json { render json: b.node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n puts \"xxxxxxx NodesC a:new xxxxxxx\"\n # @node = Node.new # orig \n \n @node = Node.new\n #@node.build ==> this does not work as there is m\n #@node.node_attrbs.build\n #byebug\n end", "def create\n @gnvl = Gnvl.new(gnvl_params)\n\n respond_to do |format|\n if @gnvl.save\n format.html { redirect_to @gnvl, notice: 'Gnvl was successfully created.' }\n format.json { render :show, status: :created, location: @gnvl }\n else\n format.html { render :new }\n format.json { render json: @gnvl.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @neighborhood_topic = NeighborhoodTopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood_topic }\n end\n end", "def new\n @gitem = Gitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gitem }\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n cookies[:last_node_id] = @node.id \n format.html { redirect_to @node, notice: 'node created!' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def newnode_params\n params.require(:newnode).permit(:nodename, :place)\n end", "def create\n @node = Node.new(params[:node])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n expire_page :action => :index\n expire_page :action => :show\n \n @ganglia_graph = GangliaGraph.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ganglia_graph }\n end\n end", "def new\n @trnodo = Trnodo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trnodo }\n end\n end", "def new\n @graph_membership_graph = GraphMembershipGraph.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @graph_membership_graph }\n end\n end", "def new\n @generation = Generation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @generation }\n end\n end", "def create\n @server = Server.new(server_params)\n @neo = Neography::Rest.new\n\n respond_to do |format|\n if @server.save && n = Neography::Node.create(\"name\" => server_params[:name])\n n.add_to_index('servers', 'name', server_params[:name])\n n.id = n.neo_id # this construct should be improved..\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 new\n @gist = Gist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gist }\n end\n end", "def new\n @pgn_file = PgnFile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pgn_file }\n end\n end", "def create\n @star_node = StarNode.new(star_node_params)\n\n respond_to do |format|\n if @star_node.save\n format.html { redirect_to @star_node, notice: \"Star node was successfully created.\" }\n format.json { render :show, status: :created, location: @star_node }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @star_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @gravity = Gravity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gravity }\n end\n end", "def new\n @nfcobject = Nfcobject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nfcobject }\n end\n end", "def create_nodes(nodes)\n nodes.each do |node|\n (raise CloudLB::Exception::MissingArgument, \"Must provide :address for all nodes\") if node[:address].to_s.empty?\n (raise CloudLB::Exception::MissingArgument, \"Must provide :port for all nodes\") if node[:port].to_s.empty?\n node[:condition] ||= \"ENABLED\"\n end\n body = {:nodes => nodes}.to_json\n response = @connection.lbreq(\"POST\", @lbmgmthost, \"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}/nodes\",@lbmgmtport,@lbmgmtscheme,{},body)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n JSON.parse(response.body)['nodes'].map { |node| get_node(node[\"id\"]) }\n end", "def new\n #@gethotel = Gethotel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gethotel }\n end\n end", "def new\n @network_connection = NetworkConnection.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @network_connection }\n end\n end", "def create\n @ngo = Ngo.new(ngo_params)\n\n respond_to do |format|\n if @ngo.save\n format.html { redirect_to @ngo, notice: 'Ngo was successfully created.' }\n format.json { render :show, status: :created, location: @ngo }\n else\n format.html { render :new }\n format.json { render json: @ngo.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7503664", "0.7503664", "0.7503664", "0.7503664", "0.7460648", "0.73053044", "0.7286441", "0.7272244", "0.72317314", "0.72179854", "0.71523064", "0.7116745", "0.71138334", "0.7103245", "0.70497763", "0.68550664", "0.6844446", "0.6828655", "0.6821503", "0.6779349", "0.6778215", "0.67730784", "0.673785", "0.673785", "0.66856766", "0.6672502", "0.6648617", "0.6635786", "0.66150707", "0.6595933", "0.65954816", "0.65774184", "0.65730023", "0.6572084", "0.6527965", "0.64931756", "0.6487589", "0.6483686", "0.6477219", "0.64752454", "0.6456384", "0.6456384", "0.6456384", "0.6427017", "0.6420353", "0.6402897", "0.63895833", "0.6382548", "0.6365983", "0.6338498", "0.63316333", "0.6321511", "0.6265989", "0.6215464", "0.6213863", "0.6213102", "0.6199326", "0.6197569", "0.6195188", "0.6188323", "0.6187283", "0.61848146", "0.61846524", "0.61633193", "0.6149585", "0.61396754", "0.61239", "0.6115936", "0.61145616", "0.61145616", "0.61005855", "0.6090629", "0.6088079", "0.6087438", "0.6084166", "0.6079222", "0.6059161", "0.6053386", "0.60477084", "0.6041023", "0.6029427", "0.60280335", "0.6012924", "0.60095197", "0.600769", "0.60026824", "0.5992977", "0.59841365", "0.59655565", "0.59586596", "0.59489083", "0.5940603", "0.59374803", "0.5935521", "0.5934261", "0.59331495", "0.592917", "0.5926835", "0.5921568", "0.5913017" ]
0.7926474
0
POST /gnodes POST /gnodes.json
def create @gnode = Gnode.new(params[:gnode]) respond_to do |format| if @gnode.save format.html { redirect_to @gnode, notice: 'Gnode was successfully created.' } format.json { render json: @gnode, status: :created, location: @gnode } else format.html { render action: "new" } format.json { render json: @gnode.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end", "def create\n megam_rest.post_node(to_hash)\n end", "def create_node_with_props data\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n 'Content-Type' => 'application/json',\n }\n post_request 'node', data, headers\n end", "def new_nodegroup(nodegroup_json)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=\"\", nodegroup_json)\nend", "def post_nodes_with_root\n serialize_service.post_nodes_serialized\n end", "def new\n @gnode = Gnode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gnode }\n end\n end", "def create\n #@server_node = ServerNode.new(params[:server_node])\n #@server_node = ServerNode.create() do |n|\n # n.name = params[:node][:name]\n\t# n.region = params[:node][:region]\n\t# n.status = params[:node][:status]\n\n #end\n\n respond_to do |format|\n if @server_node.save\n format.html { redirect_to @server_node, notice: 'Server node was successfully created.' }\n format.json { render json: @server_node, status: :created, location: @server_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @server_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n\n @node = Node.new(params[:node])\n @node.user_id = current_user[:id]\n @json = Node.where(:user_id => current_user[:id]).to_gmaps4rails\n current_user[:optimized] = false\n\n if @node.save\n @nodes = Node.where(:user_id => current_user[:id])\n @nodes.each do |node|\n node.jobnumber = nil\n node.vehicle_id = nil\n node.servicetime = nil\n node.tour_id = nil\n node.save\n end\n project = Project.where(:user_id => current_user[:id]).first\n project.optimized = false\n project.loading = false\n project.save\n end\n\n\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(nodes_path, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n @node.project_id = current_user.project_id\n @node.user_id = current_user.id\n\[email protected] = true\n\[email protected] = true\n\tputs @node.inspect\n respond_to do |format|\n if @node.save\n format.html { redirect_to root_path(tab:\"newnode\"), notice: 'Node ' + @node.working_name + ' has been added'}\n format.json { render json: @node, status: :created, location: @node }\n else\n\t\tflash[:error] = @node.errors\n format.html { redirect_to root_path(tab:\"newnode\")}\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if (@job.nodes << @node)\n flash[:notice] = 'Node was successfully created.'\n format.html { redirect_to job_url(@job) }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(node_params)\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @node }\n else\n format.html { render :new }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(node_params)\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @node }\n else\n format.html { render :new }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(node_params)\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @node }\n else\n format.html { render :new }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save!\n format.html { redirect_to @node, notice: 'Встречная продажа создана' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n Action.log :controller => params[:controller], :action => params[:action], :target_id => @node.id, :user => current_user\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n @node.related_edges_B.build\n @node.incoming_edges.build\n @node.outgoing_edges.build\n format.html { render action: \"new\", :layout => !request.xhr? }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_nodes(layer, nodes, params = {})\n default_params = {\n create_type: CREATE_TYPE_CREATE,\n node_type: NODE_TYPE_PTSTOP\n }\n params = default_params.merge(params)\n data = { create: { params: params }, nodes: nodes }.to_json\n response = put(\"/nodes/#{layer}\", data)\n if response.status != 200\n fail APIError, response.body\n end # if\n end", "def create_nodes(nodes)\n nodes.each do |node|\n (raise CloudLB::Exception::MissingArgument, \"Must provide :address for all nodes\") if node[:address].to_s.empty?\n (raise CloudLB::Exception::MissingArgument, \"Must provide :port for all nodes\") if node[:port].to_s.empty?\n node[:condition] ||= \"ENABLED\"\n end\n body = {:nodes => nodes}.to_json\n response = @connection.lbreq(\"POST\", @lbmgmthost, \"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}/nodes\",@lbmgmtport,@lbmgmtscheme,{},body)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^20.$/)\n JSON.parse(response.body)['nodes'].map { |node| get_node(node[\"id\"]) }\n end", "def nodes\r\n params = {\r\n method: :get,\r\n url: '/project/nodes',\r\n params: { prjUUID: @uuid }\r\n }\r\n @session.request(**params).perform!['nodes']\r\n end", "def create\n @obj = Node.new(params[:node])\n\n respond_to do |format|\n if @obj.save\n format.html { redirect_to @obj, notice: 'Node was successfully created.' }\n format.json { render json: @obj, status: :created, location: @obj }\n else\n format.html { render action: \"new\" }\n format.json { render json: @obj.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @newnode = Newnode.new(newnode_params)\n\n respond_to do |format|\n if @newnode.save\n format.html { redirect_to @newnode, notice: 'Newnode was successfully created.' }\n format.json { render :show, status: :created, location: @newnode }\n else\n format.html { render :new }\n format.json { render json: @newnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @node = @job.nodes.build \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n format.json { render :json => @node } \n end\n end", "def create\n p = params[:node_registration]\n \n @registration = NodeRegistration.new(latitude: p[:latitude],longitude: p[:longitude],\n operator_name: p[:operator_name], operator_email: p[:operator_email],\n name: p[:name], node_at: p[:node_at],notice: p[:notice],\n loc_str: p[:loc_str], osm_loc: p[:osm_loc])\n \n if permitted_to?(:set_owner, @registration)\n @registration.owner_id = p[:owner_id]\n else\n @registration.owner = current_user\n end\n @registration.creator = current_user\n @registration.updater = current_user\n\n respond_to do |format|\n if @registration.save\n format.html { redirect_to root_path, notice: 'Node erfolgreich registriert' }\n format.json { render json: @registration, status: :created, location: @registration }\n else\n format.html { render action: \"new\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end", "def ajax_add_node\n\n # Create a new Node Instance\n node = Node.new\n\n # Update the fields of Node Instance\n node.app_id = params[:app_id]\n node.funnel_id = params[:funnel_id]\n\n if params[:email_template_id] == '0'\n # Create a new Email Template\n template = EmailTemplate.new\n template.app_id = params[:app_id]\n template.name = params[:name] + ' Email Template'\n template.description = ''\n template.email_subject = ''\n template.color = '#3498db'\n\n # Save blank Email Template\n template.save\n\n node.email_template_id = template.id\n\n else\n node.email_template_id = params[:email_template_id]\n\n end\n\n node.name = params[:name]\n node.delay_time = params[:delay_time]\n node.delay_unit = params[:delay_unit]\n node.top = 60\n node.left = 500\n node.num_emails = 0\n node.num_emails_sent = 0\n node.num_revenue = 0.0\n node.num_emails_opened = 0\n node.num_emails_clicked = 0\n\n\n\n node.save\n\n response = {\n success: true,\n message: 'Node Saved',\n id: node.id,\n email_template_id: node.email_template_id\n\n }\n\n render json: response\n\n\n\n end", "def create\n @map_node = Map::Node.new(params[:map_node])\n\n respond_to do |format|\n if @map_node.save\n format.html { redirect_to @map_node, notice: 'Node was successfully created.' }\n format.json { render json: @map_node, status: :created, location: @map_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @map_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pm_node = Pm::Node.new(pm_node_params)\n\n respond_to do |format|\n if @pm_node.save\n format.html { redirect_to @pm_node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: @pm_node }\n else\n format.html { render :new }\n format.json { render json: @pm_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def node_params\n params.require(:node).permit(:name, :description, :map_id, :category_ids => [], :node_ids => [])\n end", "def create\n n = Node.create! params\n render api_show :node, Node, n.id.to_s, nil, n\n end", "def create\n b.node = type.build(node_params)\n authorize! :create, b.node\n respond_to do |format|\n if b.node.save\n format.html { redirect_to b.node, notice: 'Node was successfully created.' }\n format.json { render :show, status: :created, location: b.node }\n else\n format.html { render :new }\n format.json { render json: b.node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @node = Node.new\n @node.addresses.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def destroy\n @gnode = Gnode.find(params[:id])\n @gnode.destroy\n\n respond_to do |format|\n format.html { redirect_to gnodes_url }\n format.json { head :no_content }\n end\n end", "def node_params\n params.require(:node).permit(:room_name, :room_number, :room_capacity, :x, :y, :floor, :building, {:child_ids =>[]})\n end", "def reserveNode(node_ids,account_name,valid_from,valid_until)\n cert_path = APP_CONFIG['cert_path']\n # resernation_name: we set a random name for every reservation constructing by the name of the slice and a random number ex user1/12341234 \n resernation_name =account_name+ \"/\" + (1000 + Random.rand(10000000)).to_s\n puts resernation_name\n \n broker_url = APP_CONFIG['broker_ip'] + ':' + APP_CONFIG['broker_port'].to_s\n\n node_ids.map!{|r| {uuid: r}}\n\n header = {\"Content-Type\" => \"application/json\"}\n options ={\n name: resernation_name,\n valid_from: valid_from,\n valid_until: valid_until,\n account: \n { \n name: account_name\n },\n components: node_ids\n }\n\n #puts options.to_json \n uri = URI.parse(broker_url+\"/resources/leases\")\n pem = File.read(cert_path)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.cert = OpenSSL::X509::Certificate.new(pem)\n http.key = OpenSSL::PKey::RSA.new(pem)\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n request = Net::HTTP::Post.new(uri.request_uri, header)\n request.body = options.to_json\n\n response = http.request(request)\n \n res = JSON.parse(response.body)\n \n if response.header.code != '200'\n puts \"Something went wrong\"\n puts response \n puts res[\"exception\"][\"reason\"]\n return res[\"exception\"][\"reason\"]\n else\n return \"OK\"\n end\n \n end", "def create\n neo = Neography::Rest.new\n city = neo.create_node(params[:city])\n redirect_to cities_path\n end", "def ngo_params\n params.require(:ngo).permit(:name, :address, :number, :longitude, :latitude, :email, :services, :about, :status, :link, :accepted_documents, images:[])\n end", "def newnode_params\n params.require(:newnode).permit(:nodename, :place)\n end", "def nodetest_params\r\n params.require(:nodetest).permit!\r\n end", "def create\n @node = Node.new(params[:node])\n \n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_on_other_gs_nodes(association_method = nil, association_uuid = nil)\n action_on_other_gs_nodes('create', self.to_json, nil, association_method, association_uuid)\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n @node.broadcast_add_me\n Cue.send_all_pending\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(@node, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n authorize! :create, @node\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @compute_node = ComputeNode.new(params[:compute_node])\n\n respond_to do |format|\n if @compute_node.save\n format.html { redirect_to @compute_node, notice: 'Compute node was successfully created.' }\n format.json { render json: @compute_node, status: :created, location: @compute_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @compute_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_node!\n node.save\n end", "def get_nodes\n\tq = '[\"=\", [\"node\", \"active\"], true]'\n\n\tif ! q.is_a? String then\n\t\tq=JSON[q]\n\t\tend\n\tparams = {:query => q}\n\n response_nodelist = RestClient.get\"http://#{Tayu.puppetdb_server}:#{Tayu.puppetdb_port}/nodes\", { :accept => :json, :params => params }\n return JSON.parse(response_nodelist)\n end", "def node_params\n params.require(type_name.parameterize('_').to_sym)\n .permit(:name, :description, :email, :vk_id, :tag_list, :post)\n end", "def request!\n PoolNode.create_or_get(@id, node)\n end", "def create\n @node = Node.new(params[:node])\n @node.creator = current_user\n\n respond_to do |format|\n if @node.save\n if params[:topic_id]\n @node.topic_node_memberships.create!(:topic_id => params[:topic_id])\n end\n if params[:source_id]\n @node.source_edges.create!(:source_id => params[:source_id])\n source = Node.find(params[:source_id])\n source.topics.each do |t|\n @node.topic_node_memberships.create!(:topic_id => t.id)\n end\n end\n format.html { redirect_to flash[:page_to_redirect_to] || :back,\n :flash => { :success => 'Post was successfully created.' } }\n format.json { render json: @node, status: :created, location: @node }\n format.js\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "def post_data(graph, context=\"\")\n synchronize do\n # Prepares the dir to connect with the repository\n dir = \"#{@options[\"host\"]}:#{@options[\"port\"]}/openrdf-sesame/repositories/#{@options[\"repo\"]}/statements?context=%3C#{CGI::escape(context)}%3E\"\n data = graph.serialize(:ntriples)\n\n # Adds the data to Sesame\n RestClient.post dir, data, :content_type=>select_type\n end\n end", "def node_params\n params.require(:node).permit(:name)\n end", "def url\n \"#{@options[:pe_enc_url]}/v1/classified/nodes/#{@options[:node]}\"\n end", "def node_params\n params.permit(:name, :content, :title, :version, :node, :is_private)\n end", "def new\n @node = Node.new\n 3.times { @node.related_edges_B.build }\n 3.times { @node.incoming_edges.build }\n 3.times { @node.outgoing_edges.build }\n \n Action.log :controller => params[:controller], :action => params[:action], :user => current_user\n\n respond_to do |format|\n format.html { render :layout => !request.xhr? } # new.html.erb\n format.json { render json: @node }\n end\n end", "def node_params\n\t params.permit(:id, :node)\n\t end", "def new\n @map = Map.find(params[:map_id])\n\n #@node = Node.new\n @node = @map.nodes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def ajax_save_node\n\n # Get the Node from the DB\n node = Node.find(params[:node_id])\n\n # Update the Node\n node.top = params[:top]\n node.left = params[:left]\n\n # Save and verify Node and return correct JSON response\n if node.save!\n final_json = JSON.pretty_generate(result = {\n :success => true,\n :id => node.id\n })\n else\n final_json = JSON.pretty_generate(result = {\n :success => false\n })\n end\n\n # Return JSON response\n render json: final_json\n\n end", "def update_nodegroup(nodegroup_json, nodegroup_id)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=nodegroup_id, nodegroup_json)\nend", "def update\n @gnode = Gnode.find(params[:id])\n\n respond_to do |format|\n if @gnode.update_attributes(params[:gnode])\n format.html { redirect_to @gnode, notice: 'Gnode was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def __get_nodes\n JSON.parse(Net::HTTP.get(URI(\"#{__cluster_url}/_nodes/process\")))\n end", "def create_node(params)\n node = @tinkit_class.new(params)\n node.__save\n node\n #TODO: What if params includes attachments?\n end", "def node_params\n params.fetch(:node_node, {}).permit(:id, :apiotics_instance, :led_attributes => [\"led_state\", \"id\"], :button_attributes => [\"safe\", \"id\"], :neo_pixel_stick_eight_attributes => [\"led_color\", \"led_index\", \"id\"])\n end", "def create\n @track = Track.new(track_params)\n\n respond_to do |format|\n if @track.save\n if @nodes\n @nodes.each do |node_data|\n node_data['track'] = @track\n Node.create(node_data)\n end\n end\n format.html { redirect_to @track, notice: 'Track was successfully created.' }\n format.json { render :show, status: :created, location: @track }\n else\n format.html { render :new }\n format.json { render json: @track.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n puts \"xxxxxxx NodesC a:create xxxxxxx\"\n # Whitelisting is used to secure our actions from processing un-identified\n # parameters sent in the http request, this is a new Rails 4 feature\n #@node = Node.new(white_listed_params)\n\n puts \"1XXXXXXX params:\", params, \" ...YYYYYYYYYYYYY\"\n puts \"2XXXXXXX params[:node]:\", params[:node], \" ...YYYYYYYYYYYYY\"\n puts \"3XXXXXXX params[:node][:name_display]:\",params[:node][:name_display], \" ...YYYYYYYYYYYYY\"\n\n @node = Node.new(params[:node]) \n @node.user_id = current_user.id\n \n if @node.save\n flash[:success] = \"Node #{@node.name_display} saved successfully.\"\n # nodes_path is a helper that uses routes.rb to return\n # a string like '/nodes'.\n # redirect_to is a function that takes the relative url\n # and sends a 302 redirect to the browser\n redirect_to nodes_path\n else\n render :new\n end\n puts \"4XXXXXXX @node.to_yaml\", @node.to_yaml , \"... this is an object YYYYYYYYYYYY\"\n puts \"5XXXXXXX @node.user_id.inspect\", @node.user_id.inspect , \"... object property YYYYYYYYYYYYYYYY\"\n end", "def create\n @admin_geonode = Admin::Geonode.new(params[:admin_geonode])\n\n respond_to do |format|\n if @admin_geonode.save\n format.html { redirect_to @admin_geonode, notice: 'Geonode was successfully created.' }\n format.json { render json: @admin_geonode, status: :created, location: @admin_geonode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_geonode.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ngo = Ngo.new(ngo_params)\n\n respond_to do |format|\n if @ngo.save\n format.html { redirect_to @ngo, notice: 'Ngo was successfully created.' }\n format.json { render :show, status: :created, location: @ngo }\n else\n format.html { render :new }\n format.json { render json: @ngo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @node_template = NodeTemplate.new(params[:node_template])\n\n respond_to do |format|\n if @node_template.save\n format.html { redirect_to @node_template, notice: 'Node template was successfully created.' }\n format.json { render json: @node_template, status: :created, location: @node_template }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node_template.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @star_node = StarNode.new(star_node_params)\n\n respond_to do |format|\n if @star_node.save\n format.html { redirect_to @star_node, notice: \"Star node was successfully created.\" }\n format.json { render :show, status: :created, location: @star_node }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @star_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def to_json\n @nodes.map(&:to_json)\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def nodes_field\n define_nodes_field\n end", "def create\n @node_config = NodeConfig.new(params[:node_config])\n\n respond_to do |format|\n if @node_config.save\n format.xml { render :xml => @node_config, :status => :created, :location => @node_config }\n format.any { render :json => @node_config, :status => :created, :location => @node_config }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node_incident = NodeIncident.new(params[:node_incident])\n\n respond_to do |format|\n if @node_incident.save\n format.html { redirect_to @node_incident, :notice => 'Node incident was successfully created.' }\n format.json { render :json => @node_incident, :status => :created, :location => @node_incident }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @node_incident.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n cookies[:last_node_id] = @node.id \n format.html { redirect_to @node, notice: 'node created!' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def nodes= nodes\n @grpc.node_count = nodes\n end", "def create_nodes(shapes, data, source_list)\n\n\tCSV.foreach(\"network_links_final\", :headers=>true) do |row|\n\n\t\t# binding.pry\n\n\t\tshapes.shuffle\n\n\n\t\tdata[\"nodes\"] << {\"size\"=>10, \"score\"=> 0.6,\"id\"=> row[\"TAG\"], \"group\"=>row[\"Group\"], \"type\"=>shapes[row[\"Group\"].to_i]}\n\n\t\tsource_list << row[\"TAG\"]\n\n\n\tend\nend", "def node_params\n params.require(:node).permit(:ip_address)\n end", "def create\n @comment_node = CommentNode.new(params[:comment_node])\n\n respond_to do |format|\n if @comment_node.save\n format.html { redirect_to @comment_node, :notice => 'Comment node was successfully created.' }\n format.json { render :json => @comment_node, :status => :created, :location => @comment_node }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @comment_node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def ns_catalogue_poster()\n url = 'http://apis.t-nova.eu:4011/network-services'\n puts url\n uri = URI.parse(url)\n puts uri\n\n params = File.read('config/catalogue_nsd.json')\n puts params\n\n http = Net::HTTP.new(uri.host, uri.port)\n #http.use_ssl = true\n #http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(uri.request_uri)\n\n #request.set_form_data('code' => token, 'client_id' => @client_id, 'client_secret' => client_secret, 'redirect_uri' => googleauth_url, 'grant_type' => 'authorization_code')\n request.content_type = 'application/json'\n request.body = params\n response = http.request(request)\n response.code\n\n if response.code == 201\n puts \"#{response.code}\".color(Colors::GREEN)\n else\n puts \"#{response.code}\".color(Colors::RED)\n end\n\n return response.code\n end", "def show\n @gnode = Gnode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gnode }\n end\n end", "def getNodeFeatureData\n\t render json: Network.getFeatureData(params)\n\tend", "def create\n @retain_node = RetainNode.new(params[:retain_node])\n\n respond_to do |format|\n if @retain_node.save\n flash[:notice] = 'RetainNode was successfully created.'\n format.html { redirect_to(@retain_node) }\n format.xml { render :xml => @retain_node, :status => :created, :location => @retain_node }\n format.json { render :json => @retain_node, :status => :created, :location => @retain_node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @retain_node.errors, :status => :unprocessable_entity }\n format.json { render :json => @retain_node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def json_post\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n puts \"json_post: submitting #{params[:path]}\" if @@debug\n path = params[:path]\n if path\n puts \"json_post: path is #{path} l=#{path.length}\" if @@debug\n path = path.split('/').compact()\n path.delete('')\n # you cannot make rooted nodes via json atm... fix? xxx\n if path.length > 1\n name = path.pop\n nodes = Note.make_path @user,path\n puts \"json_post: making at path #{path.join('/')}\" if @@debug\n if nodes\n note = nodes.last.make_child @user,params,name\n puts \"json_post: made child #{note} from #{name} l=#{name.length}\"\n params[:path] = path.join('/') # for call to json_query\n # it is important to do a query rather than returning the note; to get freshest order\n json_query\n return\n #write_json note if note\n end\n end\n end\n render :nothing => true\n end", "def process_GENDATA(nodes, event)\n # Time, EventType, DataId, GeneratorId, Transmitting Size\n # 178.0,GENDATA,Data00000143,sensor-033,1024,\n\n # Extract necessary information from Eventlist\n data_creation = event[0].to_i\n id_data = event[2]\n id_gene = event[3]\n size = event[4].to_i\n\n # nodes creation (preparation)\n if (nodes[id_gene] == nil) then # firstly appeared\n nodes[id_gene] = Node.new\n end\n\n # Simulating for data storing in generation\n data = {\"id\" => id_data, \"size\" => size, \"creationtime\" => data_creation}\n data.each do |key,value|\n #puts \"#{key} : #{value}\"\n end \n #puts data[\"id\"]\n #puts data[\"size\"]\n #puts data[\"creationtime\"]\n\n nodes[id_gene].put(id_data, data)\n end", "def get_nodegroups()\n nodemgr_rest_call(\"GET\", \"classifier\", \"groups\", $credentials)\nend", "def post_network(request)\n # --- Create the new Instance ---\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml,\n @client,\n request.body,\n @config[:template_location])\n\n # --- Generate the template and Allocate the new Instance ---\n template = network.to_one_template\n return template, 500 if OpenNebula.is_error?(template)\n\n rc = network.allocate(template, @config[:cluster_id]||ClusterPool::NONE_CLUSTER_ID)\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n network.info\n return to_occi_xml(network, :code=>201)\n end", "def index\n @nodes = @job.nodes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n format.json { render :json => @nodes }\n end\n end", "def create\n @f5_node = F5Node.new(params[:f5_node])\n\n respond_to do |format|\n if @f5_node.save\n format.html { redirect_to @f5_node, notice: 'F5 node was successfully created.' }\n format.json { render json: @f5_node, status: :created, location: @f5_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @f5_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @node = Node.new\n authorize! :create, @node\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @node }\n end\n end", "def new\n @server_node = ServerNode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server_node }\n end\n end", "def create\n @node = Node.new(node_params)\n @course = Course.find_by_id(params[:course_id])\n @nodes = @course.direct_nodes\n\n if @node.save\n # Notice: you have to decrement the child_count of @node.father when destroy\n @node.father.increment!(:child_count) if @node.father\n\n respond_to do |respond|\n respond.html { redirect_to course_node_path(id: @node.course_id) }\n respond.js { render :show }\n end\n\n else\n\n respond_to do |respond|\n respond.html { redirect_to course_topics_path }\n respond.js { render :new }\n end\n\n end\n\n end", "def create\n @gpath = Gpath.new(params[:gpath])\n\n respond_to do |format|\n if @gpath.save\n format.html { redirect_to @gpath, notice: 'Gpath was successfully created.' }\n format.json { render json: @gpath, status: :created, location: @gpath }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gpath.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_form__item__netzke_submit(params)\n res = aggregatee_instance(:add_form__item).netzke_submit(params)\n \n if res[:set_form_values]\n # successful creation\n on_data_changed\n res[:set_form_values] = nil\n end\n res.to_nifty_json\n end", "def create\n @graph = Graph.new(params[:graph])\n\n respond_to do |format|\n if @graph.save\n Action.log :controller => params[:controller], :action => params[:action], :target_id => @graph.id, :user => current_user\n format.html { redirect_to @graph, notice: 'Graph was successfully created.' }\n format.json { render json: @graph, status: :created, location: @graph }\n else\n @graph.graph_membership_graphs.build\n @graph.graph_membership_nodes.build\n format.html { render action: \"new\", :layout => !request.xhr? }\n format.json { render json: @graph.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6819252", "0.65203476", "0.63891584", "0.63803405", "0.6365424", "0.6167253", "0.60946095", "0.6025852", "0.593734", "0.5933848", "0.5909308", "0.5904701", "0.58926255", "0.58926255", "0.58926255", "0.58653724", "0.5832633", "0.58268434", "0.5824329", "0.58236784", "0.57956976", "0.5780845", "0.5774919", "0.57691383", "0.5735227", "0.5704813", "0.57047766", "0.56852275", "0.565184", "0.5647844", "0.5644569", "0.5642712", "0.56315345", "0.56204075", "0.5601959", "0.5579295", "0.55697066", "0.5567393", "0.5564165", "0.55504775", "0.5548739", "0.5547732", "0.55442387", "0.5542934", "0.55322397", "0.55157787", "0.5511449", "0.5489217", "0.5487461", "0.54830414", "0.5462271", "0.54404485", "0.54223025", "0.5418677", "0.5391145", "0.5378768", "0.5370409", "0.5361897", "0.53573877", "0.53470874", "0.53405863", "0.5334456", "0.53278756", "0.53116864", "0.5297901", "0.529046", "0.5287303", "0.5281429", "0.52786773", "0.5274118", "0.52612156", "0.5250955", "0.5249247", "0.5249247", "0.5249247", "0.5249247", "0.52486783", "0.5232835", "0.5228499", "0.52254725", "0.5222259", "0.5219585", "0.5206903", "0.5204784", "0.51902264", "0.5179152", "0.51740015", "0.5169074", "0.51564294", "0.51475173", "0.51271147", "0.5126971", "0.5120707", "0.5107988", "0.51040465", "0.50827974", "0.508205", "0.50791955", "0.50777364", "0.50695634" ]
0.7106958
0
PUT /gnodes/1 PUT /gnodes/1.json
def update @gnode = Gnode.find(params[:id]) respond_to do |format| if @gnode.update_attributes(params[:gnode]) format.html { redirect_to @gnode, notice: 'Gnode was successfully updated.' } format.json { head :no_content } else format.html { render action: "edit" } format.json { render json: @gnode.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @node = Node.find(params[:id])\n @json = Node.all.to_gmaps4rails\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n @nodes = Node.where(:user_id => current_user[:id])\n @nodes.each do |node|\n node.jobnumber = nil\n node.vehicle_id = nil\n node.servicetime = nil\n node.tour_id = nil\n node.save\n end\n project = Project.where(:user_id => current_user[:id]).first\n project.optimized = false\n project.loading = false\n project.save\n format.html { redirect_to(nodes_path, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n name = Server.find(params[:id]).name\n n = Neography::Node.find('servers', 'name', name)\n n.name = server_params[:name]\n n.add_to_index('servers', 'name', server_params[:name]) #TODO: is this necessary?\n if @server.update(server_params)\n format.html { redirect_to @server, notice: 'Server was successfully updated.' }\n format.json { render :show, status: :ok, location: @server }\n else\n format.html { render :edit }\n format.json { render json: @server.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @node.update(node_params)\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { render :show, status: :ok, location: @node }\n else\n format.html { render :edit }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @node.update(node_params)\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { render :show, status: :ok, location: @node }\n else\n format.html { render :edit }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @node.update(node_params)\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { render :show, status: :ok, location: @node }\n else\n format.html { render :edit }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if b.node.update(node_params)\n format.html { redirect_to b.node, notice: 'Node was successfully updated.' }\n format.json { render :show, status: :ok, location: b.node }\n else\n format.html { render :edit }\n format.json { render json: b.node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_nodegroup(nodegroup_json, nodegroup_id)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=nodegroup_id, nodegroup_json)\nend", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @node.update(node_params)\r\n format.html { redirect_to @node, notice: 'Node 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: @node.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update_node(node)\n file = node_file(node)\n status = file.exist? ? \"update\" : \"add\"\n\n txn do\n (@path + \"nodes\").mkpath\n file.open(\"w\") do |f|\n f.print JSON.generate(\n node.as_json,\n object_nl: \"\\n\",\n indent: \" \",\n space: \" \"\n )\n end\n @repo.add file\n\n message = \"#{status} node #{node.fqn}\"\n @repo.commit message\n log << \"Database commit: #{message}\"\n end\n end", "def update\n if @node.update(node_params)\n # initiate service object to process node minimum quantity requirements\n NodeOrderInitiatorService.call(node_id: @node.id)\n render json: {}, status: :ok\n else\n # bug report about the node not able to update itself\n render json: {errors: @node.errors.messages}, status: 400\n end\n end", "def update\n respond_to do |format|\n if @newnode.update(newnode_params)\n format.html { redirect_to @newnode, notice: 'Newnode was successfully updated.' }\n format.json { render :show, status: :ok, location: @newnode }\n else\n format.html { render :edit }\n format.json { render json: @newnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize! :manage, @node\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_node\n params[:id] = params[:id] + '/' if (params[:id] == 'rest')\n @node = Fedora.rest(params[:id])\n end", "def update\n @obj = Node.find(params[:id])\n\n respond_to do |format|\n if @obj.update_attributes(params[:node])\n format.html { redirect_to @obj, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @obj.errors, status: :unprocessable_entity }\n end\n end\n end", "def setNodeON(node_id)\n cm_url = APP_CONFIG['cm_ip'] + ':' + APP_CONFIG['cm_port'].to_s\n\n options = {body: {state:\"on\"}.to_json, :headers => { 'Content-Type' => 'application/json' }}\n res = HTTParty.put(cm_url+\"/resources/node/\"+ node_id, options)\n \n end", "def update\n @server_node = ServerNode.find(params[:id])\n\n respond_to do |format|\n if @server_node.update_attributes(params[:server_node])\n format.html { redirect_to @server_node, notice: 'Server node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @server_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @map_node = Map::Node.find(params[:id])\n\n respond_to do |format|\n if @map_node.update_attributes(params[:map_node])\n format.html { redirect_to @map_node, notice: 'Node was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @map_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n @title = \"Taxonomy node - organism relationships\"\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def network_update\n if (network = params[:network])\n network = JSON.load(network)\n network['nodes'].each do |node|\n @@builder.network.find_node(node.id).coord_x = node.coord_x\n @@builder.network.find_node(node.id).coord_y = node.coord_y\n end\n # @@builder.network.nodes.replace network['nodes']\n Node.num = @@builder.network.nodes.size\n end\n end", "def ajax_save_edit_node\n\n # Get the Node from the DB\n node = Node.find(params[:id])\n\n node.name = params[:name]\n node.email_template_id = params[:email_template_id]\n node.delay_unit = params[:delay_unit]\n node.delay_time = params[:delay_time]\n\n # Save and verify Node and return correct JSON response\n node.put('', {\n :name => node.name,\n :email_template_id => node.email_template_id,\n :delay_unit => node.delay_unit,\n :delay_time => node.delay_time,\n })\n\n # Return Success Response\n response = {\n success: true,\n message: 'Node Updated!'\n }\n render json: response\n\n\n\n end", "def create\n @gnode = Gnode.new(params[:gnode])\n\n respond_to do |format|\n if @gnode.save\n format.html { redirect_to @gnode, notice: 'Gnode was successfully created.' }\n format.json { render json: @gnode, status: :created, location: @gnode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gnode.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.scopied.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node, notice: 'Встречная продажа обновлена' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to(@node, :notice => 'Node was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @compute_node = ComputeNode.find(params[:id])\n\n respond_to do |format|\n if @compute_node.update_attributes(params[:compute_node])\n format.html { redirect_to @compute_node, notice: 'Compute node was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compute_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(node); end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n format.html { redirect_to @node,\n :flash => { :success => 'Post was successfully updated.' } }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def upsert_nodes(conn, gtfs_id, layer_name)\n layer_id = find_layer_id_from_name(conn, layer_name)\n upsert_stop_nodes_and_stop_node_data(conn, gtfs_id, layer_id)\n upsert_route_nodes(conn, gtfs_id, layer_id)\nend", "def set_node\n @node = Node.find(params[:id])\n end", "def update\n @node = Node.find(params[:id])\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n flash[:notice] = 'Node was successfully updated.'\n format.html { redirect_to(@node) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n p = params[:node_registration]\n @registration = NodeRegistration.find(params[:id])\n if permitted_to?(:set_owner, @registration)\n @registration.owner_id = p[:owner_id]\n else\n @registration.owner = current_user\n end\n @registration.updater = current_user\n\n respond_to do |format|\n if @registration.update_attributes(latitude: p[:latitude],longitude: p[:longitude],\n operator_name: p[:operator_name], operator_email: p[:operator_email],\n name: p[:name], node_at: p[:node_at],notice: p[:notice],\n loc_str: p[:loc_str], osm_loc: p[:osm_loc])\n \n format.html { redirect_to nodes_path, notice: 'Registrierung erfolgreich gespeichert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @registration.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_node\r\n @node = Node.find(params[:id])\r\n end", "def update\n respond_to do |format|\n if @pm_node.update(pm_node_params)\n format.html { redirect_to @pm_node, notice: 'Node was successfully updated.' }\n format.json { render :show, status: :ok, location: @pm_node }\n else\n format.html { render :edit }\n format.json { render json: @pm_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_node\n @node = Node.find(params[:id])\n end", "def set_node\n @node = Node.find(params[:id])\n end", "def set_node\n @node = Node.find(params[:id])\n end", "def create\n\n\n @node = Node.new(params[:node])\n @node.user_id = current_user[:id]\n @json = Node.where(:user_id => current_user[:id]).to_gmaps4rails\n current_user[:optimized] = false\n\n if @node.save\n @nodes = Node.where(:user_id => current_user[:id])\n @nodes.each do |node|\n node.jobnumber = nil\n node.vehicle_id = nil\n node.servicetime = nil\n node.tour_id = nil\n node.save\n end\n project = Project.where(:user_id => current_user[:id]).first\n project.optimized = false\n project.loading = false\n project.save\n end\n\n\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to(nodes_path, :notice => 'Node was successfully created.') }\n format.xml { render :xml => @node, :status => :created, :location => @node }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @node = @job.nodes.find(params[:id])\n \n respond_to do |format|\n # When all nodes report ready, a nextstep action is triggered on the job.\n if @node.update_attributes(params[:node])\n \n if @job.state == \"waiting_for_nodes\"\n # check if all nodes have finished installs/configuration\n @ready_nodes = @job.nodes.find(:all, :conditions => {:is_configured => true })\n if @ready_nodes.size == @job.number_of_instances\n @job.nextstep! # waiting_for_nodes - > exporting_master_nfs\n puts \"All nodes have reported ready, configuring cluster host file and starting NFS export\"\n end \n elsif @job.state == \"exporting_master_nfs\"\n # trigger transition when nfs_mounted => true for master node...\n # find master node by checking if instance_id = master_instance_id, \n master_instance_id = @job.master_instance_id\n @master_node = @job.nodes.find(:first, :conditions => {:aws_instance_id => master_instance_id })\n # check if nfs_mounted is true for master node, if so - transition. \n if @master_node.nfs_mounted\n @job.nextstep! # exporting_master_nfs -> mounting_nfs\n puts \"Master node has exported NFS home, ready for worker nodes to begin mounting volume\" \n end \n elsif @job.state == \"mounting_nfs\" \n # check if all nodes have mounted NFS home directory\n @mounted_nodes = @job.nodes.find(:all, :conditions => {:nfs_mounted => true })\n if @mounted_nodes.size == @job.number_of_instances\n @job.nextstep! # mounting_nfs - > configuring_cluster\n puts \"All nodes mounted NFS volumes, cluster ready for MPI jobs\"\n end \n end \n \n flash[:notice] = 'Node was successfully updated.'\n format.html { redirect_to job_url(@job) }\n format.xml { head :ok }\n format.json { head :ok } \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n format.json { render :json => @job.errors, :status => :unprocessable_entity } \n end\n end\n end", "def update\n respond_to do |format|\n if @star_node.update(star_node_params)\n format.html { redirect_to @star_node, notice: \"Star node was successfully updated.\" }\n format.json { render :show, status: :ok, location: @star_node }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @star_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_node(params)\n node = @tinkit_class.get(params[@key_field])\n raise \"No node to update for #{@key_field} => #{params[@key_field]}.\"\\\n \"Maybe you wanted to create a new node instead?\" unless node\n #TODO: What if params includes attachments?\n \n joha_fields = JohaDataDefn.keys\n param_keys = params.keys\n param_keys.delete(@key_field)\n param_keys.each do |key|\n next unless joha_fields.include? key\n new_data = params[key]\n node._user_data[key] = new_data\n param_keys.delete(key)\n end\n \n\n if param_keys.size > 0\n node_user_data[@user_data_field] ||= {}\n param_keys.each do |key|\n node._user_data[@user_data_field][key] = params[key]\n end\n end \n end", "def update!(**args)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n end", "def update!(**args)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n end", "def update\n @node_index = NodeIndex.find(params[:id])\n\n respond_to do |format|\n if @node_index.update_attributes(params[:node_index])\n format.html { redirect_to @node_index, notice: 'Node index was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node_index.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!\n @etcd_node = etcd.set(etcd_key, value: to_json, prevExist: true).node\n end", "def update\n @node = Node.find(params[:id])\n @node.modifier = current_user\n respond_to do |format|\n if @node.update_attributes(params[:node])\n flash[:notice] = 'Project was successfully updated.'\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def ajax_save_node\n\n # Get the Node from the DB\n node = Node.find(params[:node_id])\n\n # Update the Node\n node.top = params[:top]\n node.left = params[:left]\n\n # Save and verify Node and return correct JSON response\n if node.save!\n final_json = JSON.pretty_generate(result = {\n :success => true,\n :id => node.id\n })\n else\n final_json = JSON.pretty_generate(result = {\n :success => false\n })\n end\n\n # Return JSON response\n render json: final_json\n\n end", "def update!(**args)\n @labels = args[:labels] if args.key?(:labels)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n end", "def destroy\n @gnode = Gnode.find(params[:id])\n @gnode.destroy\n\n respond_to do |format|\n format.html { redirect_to gnodes_url }\n format.json { head :no_content }\n end\n end", "def create\n #@server_node = ServerNode.new(params[:server_node])\n #@server_node = ServerNode.create() do |n|\n # n.name = params[:node][:name]\n\t# n.region = params[:node][:region]\n\t# n.status = params[:node][:status]\n\n #end\n\n respond_to do |format|\n if @server_node.save\n format.html { redirect_to @server_node, notice: 'Server node was successfully created.' }\n format.json { render json: @server_node, status: :created, location: @server_node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @server_node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @conv_id = args[:conv_id] if args.key?(:conv_id)\n @nodes = args[:nodes] if args.key?(:nodes)\n end", "def create\n @node = Node.new(params[:node])\n @node.project_id = current_user.project_id\n @node.user_id = current_user.id\n\[email protected] = true\n\[email protected] = true\n\tputs @node.inspect\n respond_to do |format|\n if @node.save\n format.html { redirect_to root_path(tab:\"newnode\"), notice: 'Node ' + @node.working_name + ' has been added'}\n format.json { render json: @node, status: :created, location: @node }\n else\n\t\tflash[:error] = @node.errors\n format.html { redirect_to root_path(tab:\"newnode\")}\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def request!\n PoolNode.create_or_get(@id, node)\n end", "def update\n @graph.update_attributes_from_request(update_params)\n head :no_content\n end", "def update\n @node_incident = NodeIncident.find(params[:id])\n\n respond_to do |format|\n if @node_incident.update_attributes(params[:node_incident])\n format.html { redirect_to @node_incident, :notice => 'Node incident was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @node_incident.errors, :status => :unprocessable_entity }\n end\n end\n end", "def method_missing(method, *args, &block)\n data = { method: method, parameters: args }\n request.post(path: nodes_path, data: data, auth_token: auth_token)\n end", "def update!(**args)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n @pod_count = args[:pod_count] if args.key?(:pod_count)\n end", "def update!(**args)\n @node_ip = args[:node_ip] if args.key?(:node_ip)\n @pod_count = args[:pod_count] if args.key?(:pod_count)\n end", "def update\n @retain_node = RetainNode.find(params[:id])\n\n respond_to do |format|\n if @retain_node.update_attributes(params[:retain_node])\n flash[:notice] = 'RetainNode was successfully updated.'\n format.html { redirect_to(@retain_node) }\n format.xml { head :ok }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @retain_node.errors, :status => :unprocessable_entity }\n format.json { render :json => @retain_node.errors, :status => :unprocessable_entity }\n end\n end\n end", "def _update_chef_node\n step(\" updating chef node\", :blue)\n set_chef_node_attributes\n set_chef_node_environment\n sync_ipconfig_attribute\n sync_volume_attributes\n chef_api_server_as_admin.put_rest(\"nodes/#{@chef_node.name}\", @chef_node)\n end", "def update\n @node_config = NodeConfig.find(params[:id])\n\n respond_to do |format|\n if @node_config.update_attributes(params[:node_config])\n format.html { redirect_to(@node_config, :notice => 'NodeConfig was successfully updated.') }\n format.json { render :json => @node_config, :status => :ok }\n format.xml { render :xml => @node_config, :status => :ok }\n else\n format.xml { render :xml => @node_config.errors, :status => :unprocessable_entity }\n format.any { render :json => @node_config.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @concurrent_nodes = args[:concurrent_nodes] if args.key?(:concurrent_nodes)\n @minimum_available_nodes = args[:minimum_available_nodes] if args.key?(:minimum_available_nodes)\n end", "def update_nodes\n mongo_driver = Kymera::MongoDriver.new(address, port, database, 'nodes')\n @registered_nodes = mongo_driver.get_collection('nodes')\n end", "def run(request, data)\n node = Razor::Data::Node[:name => data['node']]\n operation = { 'update' => { data['key'] => data['value'] } }\n operation['no_replace'] = data['no_replace']\n\n begin\n node.modify_metadata(operation)\n rescue Razor::Data::NoReplaceMetadataError\n request.error 409, :error => _('no_replace supplied and key is present')\n end\n end", "def create\n @server = Server.new(server_params)\n @neo = Neography::Rest.new\n\n respond_to do |format|\n if @server.save && n = Neography::Node.create(\"name\" => server_params[:name])\n n.add_to_index('servers', 'name', server_params[:name])\n n.id = n.neo_id # this construct should be improved..\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 set_newnode\n @newnode = Newnode.find(params[:id])\n end", "def update\n @node = Node.find(params[:id])\n \n #params[:incoming_edges_attributes] and params[:incoming_edges_attributes].each { |i| i[:node_id_B] = @node.id and i[:edgetype] = Edgetype.find_by_name('dependent') }\n #params[:outgoing_edges_attributes] and params[:outgoing_edges_attributes].each { |i| i[:node_id_A] = @node.id and i[:edgetype] = Edgetype.find_by_name('dependent') }\n\n respond_to do |format|\n if @node.update_attributes(params[:node])\n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n format.html { redirect_to @node, notice: 'Node was successfully updated.' }\n format.json { head :no_content }\n else\n @node.related_edges_B.build\n @node.incoming_edges.build\n @node.outgoing_edges.build\n format.html { render action: \"edit\", :layout => !request.xhr? }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @graph = Graph.includes(:nodes).find(params[:id])\n\n respond_to do |format|\n if @graph.update_attributes(params[:graph])\n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n format.html { redirect_to @graph, notice: 'Graph was successfully updated.' }\n format.json { head :no_content }\n else\n @graph.graph_membership_graphs.build\n @graph.graph_membership_nodes.build\n format.html { render action: \"edit\", :layout => !request.xhr? }\n format.json { render json: @graph.errors, status: :unprocessable_entity }\n end\n end\n end", "def nodes= nodes\n @grpc.node_count = nodes\n end", "def save\n # Try PUT. If the node doesn't yet exist, PUT will return 404,\n # so then POST to create.\n begin\n if Chef::Config[:why_run]\n logger.warn(\"In why-run mode, so NOT performing node save.\")\n else\n chef_server_rest.put(\"nodes/#{name}\", data_for_save)\n end\n rescue Net::HTTPClientException => e\n if e.response.code == \"404\"\n chef_server_rest.post(\"nodes\", data_for_save)\n else\n raise\n end\n end\n self\n end", "def new_nodegroup(nodegroup_json)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=\"\", nodegroup_json)\nend", "def set_node\n @node = ::Node::Node.find(params[:id])\n end", "def node_params\n\t params.permit(:id, :node)\n\t end", "def put(*args)\n request :put, *args\n end", "def create\n @node = Node.new(params[:node])\n\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(path, params={})\n RestClient.put request_base+path, params\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def node_params\n params.require(:node).permit(:name, :description, :map_id, :category_ids => [], :node_ids => [])\n end", "def edit #$$~used\n puts \"xxxxxxx NodesC a:edit xxxxxxx\"\n @node = Node.find(params[:id])\n end", "def update\n @node_rack = @object\n\n respond_to do |format|\n if @node_rack.update_attributes(params[:node_rack])\n flash[:notice] = 'NodeRack was successfully updated.'\n format.html { redirect_to node_rack_url(@node_rack) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node_rack.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end", "def update(\n node,\n deadline: nil\n )\n req = V1::NodeUpdateRequest.new()\n\n req.node = Plumbing::convert_node_to_plumbing(node)\n tries = 0\n plumbing_response = nil\n loop do\n begin\n plumbing_response = @stub.update(req, metadata: @parent.get_metadata(\"Nodes.Update\", req), deadline: deadline)\n rescue => exception\n if (@parent.shouldRetry(tries, exception))\n tries + [email protected](tries)\n next\n end\n raise Plumbing::convert_error_to_porcelain(exception)\n end\n break\n end\n\n resp = NodeUpdateResponse.new()\n resp.meta = Plumbing::convert_update_response_metadata_to_porcelain(plumbing_response.meta)\n resp.node = Plumbing::convert_node_to_porcelain(plumbing_response.node)\n resp.rate_limit = Plumbing::convert_rate_limit_metadata_to_porcelain(plumbing_response.rate_limit)\n resp\n end", "def setNodeOFF(node_id) \n cm_url = APP_CONFIG['cm_ip'] + ':' + APP_CONFIG['cm_port'].to_s\n\n options = {body: {state:\"off\"}.to_json, :headers => { 'Content-Type' => 'application/json' }}\n res = HTTParty.put(cm_url+\"/resources/node/\"+ node_id, options)\n \n end", "def update\n @node_template = NodeTemplate.find(params[:id])\n\n respond_to do |format|\n if @node_template.update_attributes(params[:node_template])\n format.html { redirect_to @node_template, notice: 'Node template was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @node_template.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_remove\n get_node_and_network(params[:id] || params[:name])\n if params[:submit] == t('nodes.edit.allocate')\n @node.allocated = true\n flash[:notice] = t('nodes.edit.allocate_node_success') if save_node\n elsif params[:submit] == t('nodes.edit.save')\n flash[:notice] = t('nodes.edit.save_node_success') if save_node\n else\n Rails.logger.warn \"Unknown action for node edit: #{params[:submit]}\"\n flash[:notice] = \"Unknown action: #{params[:submit]}\"\n end\n\n redirect_to nodes_path(:selected => @node.name)\n end", "def create_node!\n node.save\n end", "def create\n @node = Node.new(params[:node])\n\n respond_to do |format|\n if @node.save\n format.html { redirect_to @node, notice: 'Node was successfully created.' }\n format.json { render json: @node, status: :created, location: @node }\n else\n format.html { render action: \"new\" }\n format.json { render json: @node.errors, status: :unprocessable_entity }\n end\n end\n end", "def put_network(request, params)\n xmldoc = XMLElement.build_xml(request.body, 'NETWORK')\n vnet_info = XMLElement.new(xmldoc) if xmldoc != nil\n\n vnet = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n rc = nil\n if vnet_info['PUBLIC'] == 'YES'\n rc = vnet.publish\n elsif vnet_info['PUBLIC'] == 'NO'\n rc = vnet.unpublish\n end\n\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n # --- Prepare XML Response ---\n vnet.info\n return to_occi_xml(vnet, :code=>202)\n end", "def upsert_route_nodes(conn, gtfs_id, layer_id)\n puts 'Upserting route nodes...'\n\n sql = <<-SQL\n SELECT feed_valid_from, feed_valid_to\n FROM gtfs.feed_info\n WHERE gtfs_id = $1::text;\n SQL\n\n result = conn.exec_params(sql, [gtfs_id])\n validity = nil\n\n if result.cmd_tuples > 0\n feed = result[0]\n\n # TFGM uses the wrong field names. feed_(start|end)_data are the\n # correct headers.\n\n start_date_key =\n if feed.key?('feed_valid_from')\n 'feed_valid_from'\n else\n 'feed_start_date'\n end # else\n\n end_date_key =\n if feed.key?('feed_valid_to')\n 'feed_valid_to'\n else\n 'feed_end_date'\n end # else\n\n start_date = feed.fetch(start_date_key)\n end_date = feed.fetch(end_date_key)\n validity = \"[#{ start_date } 00:00, #{ end_date } 23:59]\"\n end # if\n\n result.clear\n\n sql = <<-SQL\n SELECT *\n FROM gtfs.routes\n WHERE gtfs_id = $1::text\n ;\n SQL\n\n result = conn.exec_params(sql, [gtfs_id])\n num_routes_to_add = result.cmdtuples\n\n result.each do |route|\n puts [\n num_routes_to_add,\n route.fetch('route_id'),\n route.fetch('route_short_name'),\n route.fetch('route_long_name')\n ].join('; ')\n\n [0, 1].each do |direction|\n upsert_route(conn, gtfs_id, layer_id, route, direction, validity)\n end\n\n num_routes_to_add -= 1\n end # do\nend", "def new\n @gnode = Gnode.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gnode }\n end\n end", "def set_node\n @node = @current_user.nodes.find_by(short_id: params[:id])\n end", "def put!\n request! :put\n end", "def create\n @obj = Node.new(params[:node])\n\n respond_to do |format|\n if @obj.save\n format.html { redirect_to @obj, notice: 'Node was successfully created.' }\n format.json { render json: @obj, status: :created, location: @obj }\n else\n format.html { render action: \"new\" }\n format.json { render json: @obj.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(**args)\n @desired_node_version = args[:desired_node_version] unless args[:desired_node_version].nil?\n end", "def update\n # checks if user is authorized\n if authorise(request)\n # operation parameter tells what put operation should be done on vertex\n operation = params[:operation]\n case operation\n when 'connection'\n update_connection(params[:from_vertex_id], params[:to_vertex_id])\n when 'transformation'\n update_transformation(params[:id], params[:pos_x], params[:pos_y], params[:width],\n params[:height], params[:z_index])\n when 'attribute'\n update_attribute(params[:id], params[:name], params[:estimated_time], params[:clue],\n params[:description])\n else\n render json: { success: false, message: 'Operation does not exist' }, status: :bad_request\n end\n else\n render json: { success: false, message: 'Unauthorized' }, status: 401\n end\n end" ]
[ "0.6442687", "0.6403066", "0.63474804", "0.63474804", "0.63474804", "0.63303804", "0.6327922", "0.6256871", "0.6239784", "0.623553", "0.623553", "0.623553", "0.62133646", "0.61938864", "0.6187117", "0.6185669", "0.61847305", "0.6160426", "0.6123705", "0.60719126", "0.6069259", "0.6062394", "0.60554093", "0.6051305", "0.6050116", "0.60208887", "0.6009567", "0.59785426", "0.59196264", "0.59190744", "0.59174365", "0.5906612", "0.5893804", "0.5872424", "0.5861409", "0.5852159", "0.5850407", "0.58450484", "0.5786237", "0.5754237", "0.5754237", "0.5754237", "0.5740698", "0.572737", "0.57003146", "0.56753355", "0.56667197", "0.56667197", "0.56619304", "0.5658171", "0.5649562", "0.5648474", "0.56452775", "0.5635785", "0.5635783", "0.5630356", "0.56258404", "0.56156844", "0.5613145", "0.5612357", "0.55928797", "0.55266744", "0.55073404", "0.55073404", "0.5505138", "0.5500116", "0.5496371", "0.54865575", "0.5474483", "0.5474336", "0.54405946", "0.54389423", "0.5428468", "0.54181975", "0.5402042", "0.54002005", "0.5399006", "0.53987736", "0.53929424", "0.5388554", "0.53796494", "0.5377486", "0.5376674", "0.536763", "0.5362325", "0.5342205", "0.53375", "0.5337455", "0.53230995", "0.53177166", "0.53114134", "0.53082925", "0.5307365", "0.5296599", "0.52960694", "0.52958107", "0.52908814", "0.52823925", "0.5279592", "0.5276081" ]
0.69552726
0
DELETE /gnodes/1 DELETE /gnodes/1.json
def destroy @gnode = Gnode.find(params[:id]) @gnode.destroy respond_to do |format| format.html { redirect_to gnodes_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n node = @job.nodes.find(params[:id])\n @job.nodes.delete(node)\n\n respond_to do |format|\n format.html { redirect_to job_url(@job) }\n format.xml { head :ok }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n b.node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.find_key(params[:id] || params[:name])\n @node.destroy\n respond_to do |format|\n format.html { redirect_to deployment_path(@node.deployment_id) }\n format.json { render api_delete @node }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_path }\n format.json { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :ok }\n end\n end", "def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @node.destroy\r\n respond_to do |format|\r\n format.html { redirect_to nodes_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def delete_node\n delete(@nodename)\n end", "def destroy\n n = Node.find_key(params[:id] || params[:name])\n render api_delete Node\n end", "def destroy\n @compute_node = ComputeNode.find(params[:id])\n @compute_node.destroy\n\n respond_to do |format|\n format.html { redirect_to compute_nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n authorize! :destroy, @node\n\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @server_node = ServerNode.find(params[:id])\n @server_node.destroy\n\n respond_to do |format|\n format.html { redirect_to server_nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n \n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n\n respond_to do |format|\n format.html { redirect_to :root, notice: 'Node was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def delete(node)\n remove_node(node)\n end", "def destroy\n @retain_node = RetainNode.find(params[:id])\n @retain_node.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_nodes_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def delete\r\n \tProductPackageNode.delete params[:node_ids]\r\n render :nothing => true\r\n end", "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @node.destroy\n respond_to do |format|\n format.html { redirect_to nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @map_node = Map::Node.find(params[:id])\n @map_node.destroy\n\n respond_to do |format|\n format.html { redirect_to map_nodes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @registration = NodeRegistration.find(params[:id])\n @registration.destroy\n\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "def delete_node(l)\n node = Node.find_by(layer: l).destroy\n Connection.destroy_all(parent_id: node.id)\n Connection.destroy_all(child_id: node.id)\n end", "def ajax_delete_node\n\n # Get the Node from the DB\n node = Node.find(params[:node_id])\n\n # If node exits, then remove the node\n if !node.nil?\n node.destroy\n end\n\n end", "def delete_node\n node.destroy if node\n end", "def delete_node(current_node)\n\nend", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @f5_node = F5Node.find(params[:id])\n @f5_node.destroy\n\n respond_to do |format|\n format.html { redirect_to f5_nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.scopied.find(params[:id])\n @node.kill\n\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @admin_geonode = Admin::Geonode.find(params[:id])\n @admin_geonode.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_geonodes_url }\n format.json { head :no_content }\n end\n end", "def destroy_nodes(nodes)\n ids = nodes.map do |node|\n case node\n when Node\n node.id\n when Hash\n node[:id] || node['id']\n else\n node\n end\n end\n ids_query = ids.map { |id| \"id=#{id}\" }.join('&')\n response = @connection.lbreq(\"DELETE\", @lbmgmthost, \"#{@lbmgmtpath}/loadbalancers/#{CloudLB.escape(@id.to_s)}/nodes?#{ids_query}\",@lbmgmtport,@lbmgmtscheme)\n CloudLB::Exception.raise_exception(response) unless response.code.to_s.match(/^202$/)\n true\n end", "def destroy\n @newnode.destroy\n respond_to do |format|\n format.html { redirect_to newnodes_url, notice: 'Newnode was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @pm_node.destroy\n respond_to do |format|\n format.html { redirect_to pm_nodes_url, notice: 'Node was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end", "def delete!\n # delete changes the node.modified_index\n @etcd_node = etcd.delete(etcd_key).node\n end", "def delete\n @connection.call('GRAPH.DELETE', @graphname)\n rescue Redis::CommandError => e\n raise DeleteError, e\n end", "def destroy\n @node = Node.find(params[:id])\n @node.destroy\n project = Project.where(:user_id => current_user[:id]).first\n project.optimized = false\n project.loading = false\n project.save\n @nodes = Node.where(:user_id => current_user[:id])\n @nodes.each do |node|\n node.jobnumber = nil\n node.vehicle_id = nil\n node.servicetime = nil\n node.tour_id = nil\n node.save\n end\n respond_to do |format|\n format.html { redirect_to(nodes_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @obj = Node.find(params[:id])\n @obj.destroy\n\n respond_to do |format|\n format.html { redirect_to :back}\n format.json { head :no_content }\n end\n end", "def destroy_empty\n @obj = Node.find(params[:id])\n @obj.destroy_empty\n respond_to do |format|\n format.html { redirect_to nodes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @node = Node.find(params[:id])\n myWorkingName = @node.working_name\n @node.destroy\n\n respond_to do |format|\n flash[:notice] = (\"Node \" + myWorkingName + \" has been deleted\")\n format.html { redirect_to root_path(tab:\"nodelist\") }\n format.json { head :no_content }\n end\n end", "def delete_path(path)\n @zk.delete(path)\n logger.info(\"Deleted ZK node #{path}\")\n rescue ZK::Exceptions::NoNode => ex\n logger.info(\"Tried to delete missing znode: #{ex.inspect}\")\n end", "def delete!\n\t\t\tClient.delete @root\n\t\tend", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @node_template = NodeTemplate.find(params[:id])\n @node_template.destroy\n\n respond_to do |format|\n format.html { redirect_to node_templates_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @node_index = NodeIndex.find(params[:id])\n @node_index.destroy\n\n respond_to do |format|\n format.html { redirect_to node_indices_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @node_incident = NodeIncident.find(params[:id])\n @node_incident.destroy\n\n respond_to do |format|\n format.html { redirect_to node_incidents_url }\n format.json { head :no_content }\n end\n end", "def delete_all\n neo4j_query(\"MATCH (n:`#{mapped_label_name}`) OPTIONAL MATCH (n)-[r]-() DELETE n,r\")\n end", "def cmd_delete argv\n setup argv\n uuid = @hash['uuid']\n response = @api.delete(uuid)\n msg response\n return response\n end", "def destroy\n @taxonomy = Taxonomy.find(params[:id])\n taxonomy_type = @taxonomy.taxonomy_type \n @taxonomy.delete_node_keep_sub_nodes\n @taxonomy.reload\n @taxonomy.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_taxonomies_url(:taxonomy_type => taxonomy_type) }\n format.json { head :no_content }\n end\n end", "def delete!\n PoolNode.rmdir(@id)\n super\n Address.delete(@id)\n Subnet.delete(@subnet)\n end", "def delete\n self.class.fire_event(NodeDeletedEvent.new(self))\n relations.each {|r| r.delete}\n @internal_node.delete\n lucene_index.delete(neo_node_id)\n end", "def destroy\n @retain_node_selector = RetainNodeSelector.find(params[:id])\n @retain_node_selector.destroy\n\n respond_to do |format|\n format.html { redirect_to(retain_node_selectors_url) }\n format.xml { head :ok }\n end\n end", "def deleteNode(nodeInfo)\r\n\t\tnum = 0\r\n\t\tnode_id = 0\r\n\t\tnodeInfo.each_pair { | name, value |\r\n\t\t\tif(name == \"node_id\")\r\n\t\t\t\tnode_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\t\r\n\t\t\tnum = dbh.do(\"DELETE FROM node_list WHERE id = '#{node_id}'\")\r\n\t\t\tif (num == 1)\r\n\t\t\t\tputs \"Node 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 clear_graph(graphname)\n update(\"WITH <#{graphname}> DELETE { ?s ?p ?o } WHERE { ?s ?p ?o .}\")\nend", "def orchio_delete_graph(kind, to_collection, to_key)\n response = client.send_request(\n :delete,\n inst_args(\n kind: kind,\n to_collection: to_collection,\n to_key: to_key,\n path: \"?purge=true\"\n ))\n orchio_status response, 204\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def delete()\n\n client.delete(\"/tasks/#{gid}\") && true\n end", "def destroy\n @comment_node = CommentNode.find(params[:id])\n @comment_node.destroy\n\n respond_to do |format|\n format.html { redirect_to comment_nodes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @star_node.destroy\n respond_to do |format|\n format.html { redirect_to star_nodes_url, notice: \"Star node was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete\n start { |connection| connection.request http :Delete }\n end", "def remove\n service = FolderService.new(@context)\n nodes = Node.editable_by(@context).where(id: unsafe_params[:ids])\n result = service.remove(nodes)\n\n if result.success?\n type = :success\n text = \"Node(s) successfully removed.\"\n else\n type = :error\n text = \"Error when Node(s) removing: #{result.value[:message]}.\"\n end\n\n path = params[:scope] == Scopes::SCOPE_PUBLIC ? everybody_api_files_path : api_files_path\n\n render json: { path: path, message: { type: type, text: text } }, adapter: :json\n end", "def clean_neo4j\n neo_connection.execute_query(\"START n0=node(0),nx=node(*) MATCH n0-[r0?]-(),nx-[rx?]-() WHERE nx <> n0 DELETE r0,rx,nx\")\nend", "def destroy\n @task = Node.find(params[:id])\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_path}\n format.json { head :no_content }\n end\n \n end", "def destroy\n @nodo.destroy\n respond_to do |format|\n format.html { redirect_to nodos_url }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def delete; rest_delete(link('self')); end", "def delete; rest_delete(link('self')); end", "def deleteEntityGroup( 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/group\",params)\n end", "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend", "def destroy\n expire_page :action => :index\n expire_page :action => :show\n \n @ganglia_graph = GangliaGraph.get(params[:id])\n @ganglia_graph.destroy\n\n respond_to do |format|\n format.html { redirect_to(ganglia_graphs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @argument_node = ArgumentNode.find(params[:id])\n @argument_node.destroy\n\n respond_to do |format|\n format.html { redirect_to argument_nodes_url }\n format.json { head :no_content }\n end\n end", "def delete!\n Recliner.delete(uri)\n end", "def delete\n delete_from_server single_url\n end", "def delete endpoint\n do_request :delete, endpoint\n end", "def destroy\n @node_config = NodeConfig.destroy(params[:id])\n xml=@node_config.to_xml\n json=@node_config.to_json\n @node_config.destroy\n\n respond_to do |format|\n format.html { redirect_to(node_configs_url) }\n format.json { render :json => json}\n format.xml { render :xml => xml}\n end\n end", "def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end", "def delete_all\n Neo.db.execute_query(\"#{initial_match} OPTIONAL MATCH (n0)-[r]-() DELETE n0,r\")\n end", "def delete_network(request, params)\n network = VirtualNetworkOCCI.new(\n VirtualNetwork.build_xml(params[:id]),\n @client)\n\n # --- Delete the VNET ---\n rc = network.delete\n if OpenNebula.is_error?(rc)\n return rc, CloudServer::HTTP_ERROR_CODE[rc.errno]\n end\n\n return \"\", 204\n end", "def destroy\n @gauge_graph.destroy\n respond_to do |format|\n format.html { redirect_to gauge_graphs_url, notice: 'Gauge graph was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @graph = Graph.find(params[:id])\n @graph.destroy\n \n Action.log :controller => params[:controller], :action => params[:action], :target_id => params[:id], :user => current_user\n\n respond_to do |format|\n format.html { redirect_to :root, notice: 'Graph was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def delete(path, params)\n headers = {:Authorization => \"token #{token}\", :content_type => :json, :accept => :json}\n res = RestClient.delete(\"#{github_api_uri}/#{path}\", params.to_json, headers)\n Yajl.load(res)\n end", "def delete(data)\n deleting(prev_n_current_nodes(data))\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end" ]
[ "0.68975353", "0.6881464", "0.67785126", "0.6765078", "0.67585284", "0.6736974", "0.67335826", "0.6718847", "0.6718847", "0.6718847", "0.6699355", "0.6696454", "0.66497666", "0.6615126", "0.6563885", "0.6537905", "0.65225035", "0.65114945", "0.65114945", "0.65114945", "0.65114945", "0.65114945", "0.6508741", "0.64770675", "0.646295", "0.6460037", "0.6460037", "0.6460037", "0.645302", "0.64497447", "0.64489365", "0.64418095", "0.64386994", "0.6396461", "0.6392491", "0.6378088", "0.63769287", "0.6376184", "0.63723123", "0.63402706", "0.6311213", "0.63061875", "0.63031703", "0.6271863", "0.6253648", "0.62453496", "0.6243408", "0.62428993", "0.62251115", "0.62159896", "0.6211509", "0.6158808", "0.61325914", "0.612277", "0.61128515", "0.6094355", "0.60753584", "0.6069977", "0.60694456", "0.60683393", "0.6066947", "0.60548204", "0.6053321", "0.60513884", "0.6050873", "0.60482156", "0.60412073", "0.60309136", "0.602842", "0.6027132", "0.6024604", "0.60200244", "0.60176444", "0.6012332", "0.60088724", "0.6006467", "0.60049874", "0.5998163", "0.5998163", "0.59903365", "0.59807116", "0.59582376", "0.59369147", "0.59353393", "0.59171504", "0.591602", "0.59117174", "0.59114164", "0.59006584", "0.5893579", "0.58832914", "0.5877966", "0.5872794", "0.58595985", "0.58584774", "0.5857937", "0.5857686", "0.5857686", "0.5857686", "0.5857686" ]
0.75663936
0
The operating system is derived from the Darwin kernel version when present, otherwise pulled from the comment.
def os darwin = detect_product(DARWIN) version = if darwin UserAgent::OperatingSystems::Darwin::WATCH_OS[darwin.version.to_s] else match = detect_comment_match(/watchOS\s(?<version>[\.\d]+)/) match.named_captures['version'] if match end [WATCH_OS, version].compact.join(' ') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def sys_uname_osname\n uname = `uname`\n if uname.include? 'Darwin' # macOS\n :macos\n elsif uname.include? 'Linux'\n :linux\n elsif uname.include? 'MINGW'\n :windows\n elsif uname.include? 'OpenBSD'\n :openbsd\n end\n end", "def os\n app = app_with_comments\n return unless app\n\n OperatingSystems.normalize_os(app.comment[2]) if app.comment[2]\n end", "def ruby_platform_osname\n return unless Object.const_defined? :RUBY_PLATFORM\n\n case RUBY_PLATFORM\n when /darwin/ # macOS\n :macos\n when /linux/\n :linux\n when /mingw/\n :windows\n when /openbsd/\n :openbsd\n end\n end", "def osver\n return `uname -r`.chomp\n end", "def os\n return `uname -s`.chomp\n end", "def os\n app = app_with_comments\n if app\n if IDEVICES.include?(app.comment[0]) && app.comment[1]\n return OperatingSystems.normalize_os(app.comment[1])\n elsif matches = OSX_VERSION_REGEX.match(app.comment[0])\n return [MAC_OS, matches[:version]].compact.join(' ') if matches[:version]\n end\n end\n\n app = detect_product(DARWIN)\n if app\n if X86_64_REGEX.match?(to_s)\n [MAC_OS, OperatingSystems::Darwin::MAC_OS[app.version.to_s]].compact.join(' ')\n else\n [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ')\n end\n end\n end", "def host_os\n name = `uname`.split(' ').first.downcase.to_sym\n case name\n when :linux\n :linux\n when :darwin\n :macosx\n else\n :unknown\n end\n end", "def host_os; end", "def host_os; end", "def os\n app = app_with_comments\n return app.comment[0] if app && app.comment[0]\n\n app = detect_product(DARWIN)\n [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app\n end", "def platform\n osver[0]\n end", "def determine_os\n @os = 'linux'\n end", "def get_os_name\n\t\t\t\treturn SystemDetector.get_os_name\n\t\t\tend", "def platform_version\n osver[1]\n end", "def host_os_family; end", "def determine_os\n @os = \"linux\"\n end", "def os\n if !@os\n @os = \"#{os_name}-#{os_version}\"\n end\n @os.dup\n end", "def platform\n type = os_type(:nice)\n type = case type\n when /Linux/i then linux_type\n else type\n end\n \n # Grab the Solaris version; turns '5.9' into '9', for example. (Solaris has a really\n # bizarre numbering scheme.)\n #\n # FIXME: This should include patchlevel.\n if type =~ /Solaris/i\n if @solaris_version.nil?\n @solaris_version = @platform.exec(\"uname\", \"-r\").strip\n @solaris_version = $2 if @solaris_version =~ /^\\s*(\\d+)\\s*\\.\\s*(\\d+)\\s*$/i\n end\n \n type += @solaris_version\n end\n \n # Grab the OS X version by looking at the Darwin kernel version.\n #\n # FIXME: This should include minor version, too (e.g., 10.4.7).\n if type =~ /OSX/i\n if @osx_version.nil?\n @osx_version = @platform.exec(\"uname\", \"-r\").strip\n if @osx_version =~ /^\\s*(\\d+)\\s*\\.\\s*(\\d+).*$/i\n minor_version = [ $1.to_i - 4, 0 ].max # i.e., Darwin 8.x => OS X 10.4, 7.x => OS X 10.3, etc.\n @osx_version = \"10.%d\" % minor_version\n else\n @osx_version = '-unknown-%s' % @osx_version\n end\n end\n \n type += @osx_version\n end\n \n # Grab the Windows version by System.getProperty\n if type =~ /Windows/i\n os_name = JavaSystem.getProperty('os.name');\n sun_os_patch_level = JavaSystem.getProperty('sun.os.patch.level');\n if @windows_version.nil?\n @windows_version = case os_name \n when /Windows 2003/i: \"win2k3\"\n when /Windows XP/i: \"winxp\"\n else os_name.gsub(/ /, '_')\n end\n unless sun_os_patch_level == \"unknown\"\n patch = ''\n sun_os_patch_level.split(/ /).each do |t|\n patch = \"#{patch}#{t[0..0]}\"\n end\n @windows_version += '-' + patch\n end \n end\n \n type = @windows_version\n end\n \n \"%s-%s\" % [ type.downcase, processor_type.downcase ]\n end", "def os_platform\n return @parsed_ua.os ? @parsed_ua.os : 'Unknown'\n end", "def os\n app = detect_product(DARWIN)\n return [IOS, UserAgent::OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app\n\n app = app_with_comments\n return OperatingSystems.normalize_os(app.comment.join) if app\n end", "def os_version\n if !@os_version\n if Facter['operatingsystemrelease'] &&\n Facter['operatingsystemrelease'].value &&\n !Facter['operatingsystemrelease'].value.empty?\n @os_version = Facter['operatingsystemrelease'].value\n else\n raise \"Unable to determine proper OS value on this platform\"\n end\n end\n @os_version.dup\n end", "def os\n if app = detect_product(IOS)\n [IOS, app.version].compact.join(' ') if app.version\n elsif app = detect_product(DARWIN)\n [IOS, OperatingSystems::Darwin::IOS[app.version.to_s]].compact.join(' ') if app.version\n elsif app = app_with_comments\n comments = app.comment.join\n if WINDOWS_NT_REGEX.match?(app.comment[0])\n OperatingSystems.normalize_os(app.comment[0])\n elsif ANDROID_REGEX.match?(comments)\n if comments.start_with?(LINUX)\n OperatingSystems.normalize_os(comments)\n elsif comments.start_with?(ANDROID) && matches = ANDROID_SDK_REGEX.match(comments)\n [ANDROID, OperatingSystems::Android::SDK[matches[:sdk]]].compact.join(' ') if matches[:sdk]\n end\n elsif app.comment[1]\n OperatingSystems.normalize_os(app.comment[1])\n end\n end\n end", "def os\n os_parser.os\n end", "def host_os\n @os ||= (\n case RbConfig::CONFIG['host_os']\n when /mswin|msys|mingw|cygwin|bccwin|wince|emc/\n :windows\n when /darwin|mac os/\n :macosx\n when /linux/\n :linux\n when /solaris|bsd/\n :unix\n else\n raise \"Unknown os: #{RbConfig::CONFIG['host_os']}\"\n end\n )\n end", "def os_name\n if (os_name = @host.at('tag[name=operating-system]'))\n os_name.inner_text\n end\n end", "def os_other\n\t\t\t\t\tnot_os_osx.not_os_linux.not_os_netbsd.not_os_freebsd.not_os_cisco.not_os_vxworks.not_os_vmware_esx.not_os_windows.not_os_aix\n\t\t\t\tend", "def kernel_version\n uname('-v')\n end", "def detect_os\r\n user_agent = request.env['HTTP_USER_AGENT']\r\n if user_agent =~ /(Windows|Mac)/\r\n return $1\r\n end\r\n return 'Unknow OS'\r\n end", "def os_version # rubocop:disable Lint/DuplicateMethods\n @os_version ||= @name.match(PLATFORM_REGEX)[2]\n end", "def os\n Facter.value(:operatingsystem)\n end", "def sys\n return `uname -n`.chomp\n end", "def os\n return nil unless length >= 4\n\n # comment[0] = 'Linux'\n # comment[1] = 'U'\n # comment[2] = 'Android x.y.z' except when there are only 3 tokens, then we don't know the version\n if (self[3].product == 'Dalvik' || self[3].product == 'Mozilla') && self[3].comment.length > 3\n self[3].comment[2]\n elsif (self[3].product == 'Dalvik' || self[3].product == 'Mozilla') && self[3].comment.length == 3\n 'Android'\n else\n nil\n end\n end", "def on_os name\n os_kernel = `uname -a`\n os_kernel.downcase.include?(name)\nend", "def os_name # rubocop:disable Lint/DuplicateMethods\n @os_name ||= @name.match(PLATFORM_REGEX)[1]\n end", "def os(platform: self.platform)\n platform = self.platform unless fetch_all('computer.platform').include?(platform)\n fetch(\"computer.os.#{platform.downcase}\")\n end", "def os_family\n case os_type(:nice)\n when /Linux|Solaris|OSX/i then 'Generic'\n when /Windows/i then 'Windows'\n else 'Unknown'\n end\n end", "def user_os_simple\r\n ua = request.env['HTTP_USER_AGENT'].downcase\r\n return \"Windows\" if ua.index('win')\r\n return \"Linux\" if ua.index('Linux')\r\n return \"Macintosh\" if ua.index('Macintosh')\r\n return \"unknown\"\r\n end", "def platform\n kernel.platform\n end", "def kernel_hardware\n uname('-m')\n end", "def arch\n return `uname -m`.chomp\n end", "def os\n return @os if @os\n raw_os = RbConfig::CONFIG['target_os']\n match = raw_os.match(/([a-z]+)/)\n if match\n @os = match[1]\n else\n @os = raw_os\n end\n end", "def os\n Agent.os_for_user_agent string\n end", "def os\n app = app_with_comments\n app.comment[1] if app.comment[1]\n end", "def os_family\n os_parser.family.os\n end", "def operating_system_version\n return @operating_system_version\n end", "def operating_system_version\n return @operating_system_version\n end", "def get_os\n line = Cocaine::CommandLine.new('uname')\n output = line.run\n\n output.chomp.downcase.intern\n end", "def get_os\n system=`/usr/bin/sw_vers -productVersion`.chomp.split(\".\").slice(1).to_i\n if system==4 then\n return \"tiger\"\n else\n return \"leo\"\n end\nend", "def fetch_linux_os_version\n `lsb_release -rs`.strip\nend", "def define_os\n @os ||= (\n host_os = RbConfig::CONFIG['host_os']\n case host_os\n when /mswin|msys|mingw|cygwin|bccwin|wince|emc/\n :windows\n when /darwin|mac os/\n :macosx\n when /linux/\n :linux\n when /solaris|bsd/\n :unix\n else\n raise GetMeSubsError.new(\"Unknown os: #{host_os.inspect}\")\n end\n )\n end", "def os\n if application && c = application.comment.detect { |c| OperatingSystems::ANDROID_VERSION_REGEX.match?(c) }\n OperatingSystems.normalize_os(c)\n end\n end", "def kernel_name\n uname('-s')\n end", "def arch\n if windows? && windows_arch_i386?\n \"i386\"\n elsif solaris?\n if intel?\n \"i386\"\n elsif sparc?\n \"sparc\"\n end\n else\n Ohai[\"kernel\"][\"machine\"]\n end\n end", "def get_os\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n return :Windows\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n return :Mac\n elsif RbConfig::CONFIG['host_os'] =~ /linux/\n return :Linux\n elsif RbConfig::CONFIG['host_os'] =~ /bsd/\n return :BSD\n else\n return :unknown_os\n end\nend", "def osx_name\n return exec('sysctl -n machdep.cpu.brand_string')\n end", "def osx_version\n @osx_version ||= `sw_vers | grep ProductVersion | cut -f 2 -d ':' | awk ' { print $1; } '`.strip rescue ''\n end", "def osx_version\n @osx_version ||= `sw_vers | grep ProductVersion | cut -f 2 -d ':' | awk ' { print $1; } '`.strip rescue ''\n end", "def pdb_get_os(facts)\n if facts.is_a?(Hash) && !facts['operatingsystem'].nil? && !facts['operatingsystem']['value'].nil?\n os = facts['operatingsystem']['value']\n Puppet.info(\"#{log_prefix} puppet os for node is: os=#{os}\")\n if os.downcase == 'windows'\n os = 'Windows'\n elsif os.downcase == 'centos'\n os = 'CentOS'\n end\n\n Puppet.info(\"#{log_prefix} fiendly puppet os for node is: os=#{os}\")\n os\n else\n \"Unknown\"\n end\n end", "def myOs\n if OS.windows?\n \"Windows\"\n elsif OS.linux?\n \"Linux\"\n elsif OS.mac?\n \"Osx\"\n else\n \"Não consegui indentificar!\"\n end\nend", "def supported_platform?\n linux? || darwin?\n end", "def os\n @values.fetch('os') { \n @values['os'] = nil\n }\n end", "def platform; RUBY_PLATFORM; end", "def os\n @header.os\n end", "def kernel_release\n uname('-r')\n end", "def darwin?\n /darwin/.match(RUBY_PLATFORM)\n end", "def os_name os=nil, version=nil\n if !os && version\n raise ArgumentError, \"You can't specify a `version` without specfying `os`\"\n end\n\n os ||= platform.os\n version ||= platform.version\n\n case os\n when 'darwin'\n id = OSX.fetch(version.split('.')[0]) { nil }\n \"OS X #{id}\"\n when 'linux'\n id = version.sub(/^(\\d+\\.\\d+).*/, '\\1')\n \"Linux #{id}\"\n when 'win32'\n id = WIN32.fetch(version.slice(0, 3)) { nil }\n \"Windows #{id}\"\n end\n end", "def linux?\n !darwin?\n end", "def detect_os\n @@os_features ||= nil\n return @@os_features if @@os_features\n @@os_features ||= {}\n\n # Mac Miner\n mac_miner = lambda do\n version = `sw_vers -productVersion`.match(/\\d+\\.\\d+(?:\\.\\d+)?/)[0]\n @@os_features.merge!({\n :platform => \"darwin\",\n :os_distro => \"Mac OSX\",\n :os_version => version,\n :os_nickname => case version.split(\".\")[0..1].join(\".\")\n when \"10.0\"; \"Cheetah\"\n when \"10.1\"; \"Puma\"\n when \"10.2\"; \"Jaguar\"\n when \"10.3\"; \"Panther\"\n when \"10.4\"; \"Tiger\"\n when \"10.5\"; \"Leopard\"\n when \"10.6\"; \"Snow Leopard\"\n when \"10.7\"; \"Lion\"\n when \"10.8\"; \"Mountain Lion\"\n when \"10.9\"; \"Mavericks\"\n when \"10.10\"; \"Yosemite\"\n else; \"Unknown Version of OSX\"\n end,\n :install_method => \"install\",\n :hostname => `hostname`.chomp,\n })\n if Pathname.which(\"brew\")\n @@os_features[:install_cmd] = \"brew install\"\n elsif Pathname.which(\"port\")\n @@os_features[:install_cmd] = \"port install\"\n else\n @@os_features[:install_method] = \"build\"\n end\n @@os_features\n end\n\n # Linux Miner\n linux_miner = lambda do\n # Ensure LSB is installed\n if not Pathname.which(\"lsb_release\")\n pkg_mgrs = {\n \"apt-get\" => \"install -y lsb\", # Debian/Ubuntu/Linux Mint/PCLinuxOS\n \"up2date\" => \"-i lsb\", # RHEL/Oracle\n \"yum\" => \"install -y lsb\", # CentOS/Fedora/RHEL/Oracle\n \"zypper\" => \"--non-interactive install lsb\", # OpenSUSE/SLES\n \"pacman\" => \"-S --noconfirm lsb-release\", # ArchLinux\n \"urpmi\" => \"--auto lsb-release\", # Mandriva/Mageia\n \"emerge\" => \"lsb_release\", # Gentoo\n \"slackpkg\" => \"\", # Slackware NOTE - doesn't have lsb\n }\n ret = false\n pkg_mgrs.each do |mgr,args|\n if Pathname.which(mgr)\n if mgr == \"slackpkg\" && File.exists?(\"/etc/slackware-version\")\n ret = true\n else\n ret = system(\"sudo #{mgr} #{args}\")\n end\n break if ret\n end\n end\n end\n\n arch_family = `arch 2> /dev/null`.chomp\n pkg_arch = arch_family\n install_method = \"install\"\n if File.exists?(\"/etc/slackware-version\") || Pathname.which(\"slackpkg\")\n # Slackware\n nickname = File.read(\"/etc/slackware-version\").strip\n version = nickname.split[1..-1].join(\" \")\n major_release = version.to_i\n distro = \"Slackware\"\n pkg_fmt = major_release < 13 ? \"tgz\" : \"txz\"\n install = \"slackpkg -batch=on -default_answer=y install\"\n local_install = \"installpkg\"\n elsif File.exists?(\"/etc/oracle-release\") || File.exists?(\"/etc/enterprise-release\")\n if File.exists?(\"/etc/oracle-release\")\n nickname = File.read(\"/etc/oracle-release\").strip\n else\n nickname = File.read(\"/etc/enterprise-release\").strip\n end\n version = nickname.match(/\\d+(\\.\\d+)?/)[0]\n major_release = version.to_i\n distro, pkg_fmt, install, local_install = \"Oracle\", \"rpm\", \"up2date -i\", \"rpm -Uvh\"\n else\n version = `lsb_release -r 2> /dev/null`.strip.split[1..-1].join(\" \")\n major_release = version.to_i\n nickname = `lsb_release -c 2> /dev/null`.strip.split[1..-1].join(\" \")\n lsb_release_output = `lsb_release -a 2> /dev/null`.chomp\n distro, pkg_fmt, install, local_install = case lsb_release_output\n when /(debian|ubuntu|mint)/i\n pkg_arch = \"amd64\" if arch_family == \"x86_64\"\n [$1, \"deb\", \"apt-get install -y\", \"dpkg -i\"]\n when /(centos|fedora)/i\n [$1, \"rpm\", \"yum install -y\", \"yum localinstall -y\"]\n when /oracle/i\n [\"Oracle\", \"rpm\", \"up2date -i\", \"rpm -Uvh\"]\n when /redhat|rhel/i\n [\"RHEL\", \"rpm\", \"up2date -i\", \"rpm -Uvh\"]\n when /open\\s*suse/i\n [\"OpenSUSE\", \"rpm\", \"zypper --non-interactive install\", \"rpm -Uvh\"]\n when /suse.*enterprise/i\n [\"SLES\", \"rpm\", \"zypper --non-interactive install\", \"rpm -Uvh\"]\n when /archlinux/i\n [\"ArchLinux\", \"pkg.tar.xz\", \"pacman -S --noconfirm\", \"pacman -U --noconfirm\"]\n when /(mandriva|mageia)/i\n [$1, \"rpm\", \"urpmi --auto \", \"rpm -Uvh\"]\n when /pc\\s*linux\\s*os/i\n [\"PCLinuxOS\", \"rpm\", \"apt-get install -y\", \"rpm -Uvh\"]\n when /gentoo/i\n [\"Gentoo\", \"tgz\", \"emerge\", \"\"]\n else\n install_method = \"build\"\n [`lsb_release -d 2> /dev/null`.strip.split[1..-1].join(\" \")]\n end\n end\n ret = {\n :platform => \"linux\",\n :os_distro => distro,\n :pkg_format => pkg_fmt,\n :pkg_arch => pkg_arch,\n :os_version => version,\n :install_method => install_method,\n :install_cmd => install,\n :local_install_cmd => local_install,\n :os_nickname => nickname,\n :hostname => `hostname`.chomp,\n }\n ret.reject! { |k,v| v.nil? }\n @@os_features.merge!(ret)\n end\n\n # Solaris Miner\n solaris_miner = lambda do\n distro = `uname -a`.match(/(open\\s*)?(solaris)/i)[1..-1].compact.map { |s| s.capitalize }.join\n version = `uname -r`.strip\n nickname = \"#{distro} #{version.split('.')[-1]}\"\n if distro == \"OpenSolaris\"\n nickname = File.read(\"/etc/release\").match(/OpenSolaris [a-zA-Z0-9.]\\+/i)[0].strip\n end\n @@os_features.merge!({\n :platform => \"solaris\",\n :os_distro => distro,\n :os_version => version,\n :install_method => \"install\",\n :install_cmd => \"pkg install\",\n :os_nickname => nickname,\n :hostname => `hostname`.chomp,\n })\n end\n\n # *BSD Miner\n bsd_miner = lambda do\n distro = `uname -s`.strip\n version = `uname -r`.strip\n @@os_features.merge!({\n :platform => \"bsd\",\n :os_distro => distro,\n :os_version => version,\n :install_method => \"install\",\n :install_cmd => \"pkg_add -r\",\n :os_nickname => \"#{distro} #{version}\",\n :hostname => `hostname`.chomp,\n })\n end\n\n # BeOS Miner\n beos_miner = lambda do\n version = `uname -r`.strip\n distro = `uname -s`.strip\n @@os_features.merge!({\n :platform => \"beos\",\n :os_distro => distro,\n :os_version => version,\n :install_method => \"build\",\n :os_nickname => \"#{distro} #{version}\",\n :hostname => `hostname`.chomp,\n })\n end\n\n # Windows Miner\n windows_miner = lambda do\n sysinfo = `reg query \"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\"`.chomp\n\n hostname = `reg query \"HKEY_LOCAL_MACHINE\\\\System\\\\CurrentControlSet\\\\Control\\\\ComputerName\\\\ComputerName\"`.chomp\n hostname = hostname.match(/^\\s*ComputerName\\s+\\w+\\s+(.*)/i)[1].strip\n\n version = sysinfo.match(/^\\s*CurrentVersion\\s+\\w+\\s+(.*)/i)[1].strip << \".\"\n version << sysinfo.match(/^\\s*CurrentBuildNumber\\s+\\w+\\s+(.*)/i)[1].strip\n\n nickname = sysinfo.match(/^\\s*ProductName\\s+\\w+\\s+(.*)/i)[1].strip\n nickname = \"Microsoft #{nickname}\" unless nickname =~ /^Microsoft/\n\n try_boot_ini = `type C:\\\\boot.ini 2> nul | findstr /C:\"WINDOWS=\"`.chomp\n unless try_boot_ini.empty?\n nickname = try_boot_ini.match(/WINDOWS=\"([^\"]+)\"/i)[1].strip\n end\n\n install_method, install_cmd = case ::RbConfig::CONFIG['host_os'].downcase\n when /mingw/; [\"build\", nil]\n when /mswin/; [\"install\", \"install\"]\n when /cygwin/; [\"install\", \"setup.exe -q -D -P\"] # TODO - Does this detect cygwin properly?\n end\n ret = {\n :os_distro => nickname.split(/\\s+/).reject { |s| s =~ /microsoft|windows/i }.join(\" \"),\n :hostname => hostname,\n :os_nickname => nickname,\n :os_version => version,\n :platform => \"windows\", # TODO - Cygwin / MinGW\n :install_method => install_method,\n :install_cmd => install_cmd,\n }\n ret.reject! { |k,v| v.nil? }\n @@os_features.merge!(ret)\n end\n\n case ::RbConfig::CONFIG['host_os'].downcase\n when /darwin/; mac_miner[]\n when /mswin|mingw/; windows_miner[]\n when /linux/; linux_miner[]\n when /bsd/; bsd_miner[]\n when /solaris/; solaris_miner[]\n else\n case `uname -s`.chomp.downcase\n when /linux/; linux_miner[]\n when /darwin/; mac_miner[]\n when /solaris/; solaris_miner[]\n when /bsd/; bsd_miner[]\n when /dragonfly/; bsd_miner[]\n when /haiku/; beos_miner[]\n when /beos/; beos_miner[]\n end\n end\n\n @@os_features.freeze\n end", "def my_os\n if ENV['LAUNCHY_HOST_OS'] then\n Launchy.log \"#{self.name} : Using LAUNCHY_HOST_OS override of '#{ENV['LAUNCHY_HOST_OS']}'\"\n return ENV['LAUNCHY_HOST_OS']\n else\n ::Config::CONFIG['host_os']\n end\n end", "def platform\n @_platform ||= begin\n os = []\n os << :windows if OS.windows?\n os << :linux if OS.linux?\n os << :osx if OS.osx?\n os << :posix if OS.posix?\n unless OS.windows? || OS.osx?\n os << :ubuntu if command_exists?(\"apt-get\")\n os << :arch if command_exists?(\"pacman\")\n os << :red_hat if command_exists?(\"yum\")\n end\n\n [\n *os,\n *os.map { |x| (x.to_s + OS.bits.to_s).to_sym }\n ]\n end\n end", "def my_os\n Application.my_os\n end", "def detect_platform\r\n\t\tprint_status(\"Attempting to automatically detect the platform\")\r\n\t\tres = send_serialized_request(\"osname.bin\")\r\n\r\n\t\tif (res.body =~ /(Linux|FreeBSD|Windows)/i)\r\n\t\t\tos = $1\r\n\t\t\tif (os =~ /Linux/i)\r\n\t\t\t\treturn 'linux'\r\n\t\t\telsif (os =~ /FreeBSD/i)\r\n\t\t\t\treturn 'linux'\r\n\t\t\telsif (os =~ /Windows/i)\r\n\t\t\t\treturn 'win'\r\n\t\t\tend\r\n\t\tend\r\n\t\tnil\r\n\tend", "def os_x?\n RUBY_PLATFORM.match(/darwin/)\n end", "def linux_version\n case ENV['MACHTYPE']\n when \"s390x-suse-linux\"\n :sles_zlnx\n when /^i[356]86/\n if File.exist? \"/etc/fedora-release\"\n :linux_ia32_cell\n else\n :linux_ia32\n end\n else\n if File.exist? \"/etc/rhel-release\"\n :rhel\n elsif File.exist? \"/etc/redhat-release\"\n `awk '/release 5/||/release 4.9/{v=5};/release 4/{v=4}; END {print \"rhel\" v}' /etc/redhad-release`.to_sym\n elsif File.exist? \"/etc/SuSE-release\"\n `awk '$1==\"VERSION\" { v=$3}; END { print \"sles\" v}' /etc/SuSE-release`.to_sym\n elsif File.exist? \"/etc/yellowdog-release\"\n :yhpc\n else\n :rhel\n end\n end\nend", "def is_os_x?\n RbConfig::CONFIG[\"host_os\"] =~ /darwin/\n end", "def platform\n System::get_property('platform')\n end", "def client_os? system\n detect_os == system.to_sym\n end", "def name\n RUBY_PLATFORM\n end", "def valid_os_or_current(os)\n if os\n os = os.to_sym\n oses = U3dCore::Helper.operating_systems\n raise \"Specified OS (#{os}) isn't valid [#{oses.join(', ')}]\" unless oses.include?(os)\n else\n os = U3dCore::Helper.operating_system\n end\n os\n end", "def platform\n RUBY_PLATFORM\n end", "def user_os_simple\n @user_os_simple ||= begin\n ua = ''\n ua = request.env['HTTP_USER_AGENT'].downcase if request.env['HTTP_USER_AGENT']\n if ua.index('win')\n \"Windows\"\n elsif ua.index('linux')\n \"Linux\"\n elsif ua.index('macintosh')\n \"Macintosh\"\n elsif ua.index('ipod') # iPod Touch\n \"iPod\"\n elsif ua.index('iphone')\n \"iPhone\"\n elsif ua.index('ipad')\n \"iPad\"\n else\n \"unknown\"\n end\n end\n end", "def os\n app = app_with_comments\n return if app.nil?\n\n if (os_string = app.comment.detect { |c| ANDROID_REGEX.match?(c) })\n OperatingSystems.normalize_os(os_string)\n end\n end", "def detect_os(compare_os = nil)\n return case request.user_agent.downcase\n when /windows/i\n :windows\n when /macintosh/i\n :mac\n else\n :unknown\n end\n end", "def linux?\n unix? and not mac?\n end", "def darwin?\n platform =~ /darwin/\n end", "def os_type_extra\n type = os_type(:nice)\n if type =~ /linux/i && `uname -m` =~ /64/\n type = type + \"64\"\n end\n type\n end", "def ruby_platform\n RUBY_PLATFORM\n end", "def linux?\n unix? and not mac?\n end", "def linux_identification\n \"#{fetch_linux_distributor}_#{fetch_linux_os_version}\"\nend", "def get_platform(host_os)\n return :osx if host_os =~ /darwin/\n return :linux if host_os =~ /linux/\n return :windows if host_os =~ /mingw32|mswin32/\n return :unknown\n end", "def get_nb_fusion_guest_os(options)\n guest_os = \"freebsd\"\n if not options['arch'].to_s.match(/i386/) and not options['arch'].to_s.match(/64/)\n guest_os = guest_os+\"-64\"\n end\n return guest_os\nend", "def os_type_decode(sys_type)\n case sys_type\n when 18 then \"WINNT\" # most likely so first\n when 0 then \"Unknown\"\n when 1 then \"Other\"\n when 14 then \"MSDOS\"\n when 15 then \"WIN3x\"\n when 16 then \"WIN95\"\n when 17 then \"WIN98\"\n when 19 then \"WINCE\"\n end\n end", "def os_metadata\n os =\n case RbConfig::CONFIG['host_os']\n when /mac|darwin/\n 'macos'\n when /linux|cygwin/\n 'linux'\n when /mingw|mswin/\n 'windows'\n else\n 'other'\n end\n metadata = \"os/#{os}\"\n local_version = Gem::Platform.local.version\n metadata += \"##{local_version}\" if local_version\n metadata += \" md/#{RbConfig::CONFIG['host_cpu']}\"\n metadata\n end", "def darwin?\n RUBY_PLATFORM.include?('darwin')\n end", "def ruby_arch\n case Common.target_platform\n when /darwin/\n 'x86_64-darwin10'\n when 'linux-x86_64'\n 'x86_64-linux'\n when 'linux-x86'\n 'i686-linux'\n when /windows/\n 'x64-mingw64'\n end\nend", "def platform\n \"win\"\n end", "def get_os_value\n Facter.value( @fact ) unless @fact.nil?\n end", "def osfamily\n return @osfamily if @osfamily\n @osfamily = Facter.value 'osfamily'\n end", "def ruby_platform\n case RUBY_PLATFORM\n when /win32|mswin|mingw/\n # Works on Windows XP, 2003, 7, 8 running Ruby 1.8.6 & 1.8.7, 1.9.2, 1.9.3 & 2.0.0 installed from RubyInstaller\n # Can't match for just 'win' cause it will match darwin as well.\n 'windows'\n when /linux/\n # Works on Debian Sarge, Lenny & Wheezy and Ubuntu 9.10 running REE 1.8.7 & MRI 2.0.0 32-bit & 64-bit, don't have anything else to test on.\n 'linux'\n when /darwin/\n # Works on my MacBook Pro OS 10.6 running Ruby 1.8.7 and .rbenv version of 1.9.3 & 2.0.0 , don't have anything else to test on,\n 'mac'\n else\n nil\n end\nend", "def build_os_version(os)\n # NOTE: UA regexes don't always give us the versions back\n # they do get \"corrected\" for various OSes such as:\n # - Windows (Windows NT 6.0 => 'Vista')\n # - Windows ('Windows NT 6.3' => '8','1')\n # - Windows ('Windows NT 10.0' => '10')\n # - iOS ('Darwin/15.5' => '9','3','2')\n return unless major = os.major\n if major.to_i.to_s == major\n version, sep = duped_string(major), '.'\n else\n version, sep = duped_string(major), ' '\n end\n if os.minor\n version << sep << os.minor\n if os.patch\n version << '.' << os.patch\n if os.patchMinor\n version << '.' << os.patchMinor\n end\n end\n end\n version\n end" ]
[ "0.7746464", "0.77171475", "0.7708016", "0.7650055", "0.75772154", "0.7566651", "0.75614023", "0.75310904", "0.75310904", "0.7484535", "0.7466924", "0.7443228", "0.7433102", "0.7416258", "0.73817044", "0.7377747", "0.7364486", "0.7358462", "0.72604036", "0.724797", "0.724657", "0.72369504", "0.72231907", "0.71959335", "0.71922594", "0.71875376", "0.7180277", "0.7172456", "0.7142096", "0.7139574", "0.7137359", "0.7133867", "0.7128917", "0.7124448", "0.7113349", "0.71008825", "0.708777", "0.70837945", "0.7070776", "0.70559114", "0.7053683", "0.7040398", "0.70215976", "0.70185333", "0.70120394", "0.70120394", "0.6981837", "0.6952979", "0.6950032", "0.6948558", "0.69465", "0.6939646", "0.69377506", "0.69089353", "0.6902035", "0.6877003", "0.6877003", "0.68460065", "0.6821613", "0.6821597", "0.6817583", "0.68084127", "0.6795089", "0.6794554", "0.6789793", "0.6782163", "0.6761573", "0.67537314", "0.6753226", "0.67312735", "0.67309916", "0.67118853", "0.6711863", "0.67045695", "0.6701751", "0.6697781", "0.66846", "0.66824555", "0.66633546", "0.6654859", "0.66356766", "0.6619573", "0.6610593", "0.66103053", "0.6609095", "0.66016287", "0.657208", "0.6558673", "0.65535414", "0.6545287", "0.65424466", "0.65385395", "0.6535625", "0.65326643", "0.65157497", "0.65153295", "0.6512431", "0.6508738", "0.65058196", "0.6493299" ]
0.7046675
41
Sinatra uses caller_locations for the file name in Tilt (unlike Rails/Rack) So here we are only grabbing the file name and name of directory it is in
def create_filename_for_metric(file) return file unless defined?(::Sinatra) && defined?(::Sinatra::Base) file.split('/')[-2..-1].join('/') rescue NoMethodError file end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def caller_files\n caller_locations.\n map { |file,line| file }\n end", "def find_file(path)\n\t\t\tcaller_path = caller_locations(4..4).first.path\n\n\t\t\t## It now never causes `LoadError`, but returning `nil`, as I want\n\t\t\t## https://github.com/jeremyevans/tilt/issues/2\n\t\t\tcaller_dir = File.dirname(caller_path).sub(views_dir, '') if Tilt[caller_path]\n\n\t\t\tfind_files(path, controller_dirs | Array(caller_dir))\n\t\t\t\t.find { |file| Tilt[file] }\n\t\tend", "def called_from\n location = caller.detect('unknown:0') do |line|\n line.match(/\\/liquid(-|\\/)ext/).nil?\n end\n file, line, _ = location.split(':')\n { :file => file, :line => line }\n end", "def locate\r\n File.dirname(__FILE__)\r\n end", "def locate\r\n File.dirname(__FILE__)\r\n end", "def get_request_file root, req_path, method, default=''\n path = File.join root, req_path\n file = \"#{path}.#{method}\"\n\n return file if File.file? file\n\n Dir.glob(File.join(path, \"_*_.#{method}\")).each do |f|\n return f\n end\n Dir.glob(File.join(File.dirname(file), \"_*_.#{method}\")).each do |f|\n return f\n end\n File.file?(default.to_s) ? default : nil\n end", "def whereami() [__FILE__] end", "def locate_app_file\n app_const = app_constant\n\n candidates = []\n candidates << app_const.app_file if app_const.respond_to?(:app_file)\n candidates << Padrino.first_caller if File.identical?(Padrino.first_caller.to_s, Padrino.called_from.to_s)\n candidates << Padrino.mounted_root(name.downcase, \"app.rb\")\n simple_name = name.split(\"::\").last.downcase\n mod_name = name.split(\"::\")[0..-2].join(\"::\")\n Padrino.modules.each do |mod|\n if mod.name == mod_name\n candidates << mod.root(simple_name, \"app.rb\")\n end\n end\n candidates << Padrino.root(\"app\", \"app.rb\")\n candidates.find { |candidate| File.exist?(candidate) }\n end", "def this_file\n File.expand_path(caller_file(caller))\n end", "def get_path(filename)\n\n Pathname(__FILE__).ascend{ |directory|\n path = directory + \"ansiblealexa.yml\"; break path if path.file?\n }\n\nend", "def first_caller_file\n File.expand_path caller.each {|s| !s.include? __FILE__ and s =~ /^(.*?):\\d+/ and break $1 }\n end", "def __caller_file__(caller_depth=0)\n regex = RUBY_ENGINE == 'opal' ? PutsDebuggerer::STACK_TRACE_CALL_SOURCE_FILE_REGEX_OPAL : PutsDebuggerer::STACK_TRACE_CALL_SOURCE_FILE_REGEX\n caller[caller_depth] && caller[caller_depth][regex, 1]\n end", "def requested_file(request)\n request_uri = request.split(\" \")[1]\n path = URI.unescape(URI(request_uri).path)\n\n clean = []\n\n # Split the path into components\n parts = path.split(\"/\")\n\n parts.each do |part|\n # skip any empty or current current directory (\".\") path components\n next if part.empty? || part == \".\"\n # If the path component goes up one directory level (\"..\"),\n # remove the last clean component\n # Otherwise, add the component to the Array of clean components\n part == \"..\" ? clean.pop : clean << part\n end\n\n # return the web root joined to the client path\n\n File.join(WEB_ROOT, *clean)\nend", "def dyn_local_file_for(request, from)\n file = request.dup\n extension = File.extname(request)\n # Remove extension\n file.gsub!(/#{extension}$/, \"\")\n # Remove cache-buster (/js/app.28389 => /js/app)\n file.gsub!(/\\.[a-f0-9]{32}$/, \"\")\n\n matches = Dir[File.join(expand_from(from), \"#{file}.*\")]\n\n # Fix for filenames with dots (can't do this with glob)\n matches = matches.select { |f| f =~ /#{file}\\.[^.]+$/ }\n\n # Sort static file match, weighting exact file extension matches\n # first, then registered Tilt formats\n matches.sort! do |candidate, _|\n cfmt = File.extname(candidate)[1..-1]\n efmt = extension[1..-1]\n (cfmt == efmt or AssetPack.tilt_formats[cfmt] == efmt) ? -1 : 1\n end\n matches.first\n end", "def files_for_erb\n return Dir.chdir( base ) { Dir.glob( '*.erb' ) }\n end", "def outside_caller\n callstack = caller\n if first_inside = callstack.rindex { |l| l.include?(__FILE__) }\n callstack[first_inside + 1].split(\"/\").last\n else\n \"Unknown\"\n end\n end", "def local_file_for(request)\n request.squeeze!('/')\n serve_path, from = served.detect { |path, _| request.start_with?(path) }\n\n return if !from\n\n path = File.join(expand_from(from), request.sub(serve_path, ''))\n return if !File.file?(path)\n\n path\n end", "def requested_file(request)\n uri = request.split(\" \")[1]\n clean_path = []\n parts = uri.split(\"/\")\n\n # skip if path component includes current directory (\".\")\n parts.each do |part|\n next if part.empty? || part == '.'\n\n # removes last component if path goes one directory level up (\"..\"), pass; else append to clean_path\n part == '..' ? next : clean_path << part\n end\n File.join(ROOT, *clean_path)\nend", "def directory_handlers\n \"#{serf_path}/handlers\"\nend", "def base_dir_for_path_parameters; end", "def path_in_dir(file)\n \"#{@req.env['PATH_INFO']}/#{file}\".gsub('//', '/')\n end", "def source_location(caller)\n case caller\n when Exception\n trace = caller.backtrace.select{ |bt| RUBY_IGNORE_CALLERS.all?{ |ric| bt !~ ric } }\n caller = trace.first\n when Array\n trace = caller.select{ |bt| RUBY_IGNORE_CALLERS.all?{ |ric| bt !~ ric } }\n caller = trace.first\n end\n caller =~ /(.+?):(\\d+(?=:|\\z))/ or return \"\"\n source_file, source_line = $1, $2.to_i\n # substitute `.` path in source_file for current working directory\n source_file.sub!(/^\\./, @pwd)\n return source_file, source_line\n end", "def root_file_path; end", "def matched_path\n e = @env\n e[SCRIPT_NAME] + e[PATH_INFO].chomp(@remaining_path)\n end", "def file_path\n File.dirname(__FILE__) + '/' + @file_name\n end", "def extract_file_name(backtrace)\n return unless backtrace\n backtrace = backtrace.to_a\n return unless backtrace.length >= 1\n \n m = backtrace.first.match(/^(.+?):/)\n return unless m and m.length > 1\n m[1].gsub(Dir.getwd, \"\")\n end", "def file_path\n dir_name + file_name\n end", "def caller_root_path(caller_info)\n caller_dirname = File.expand_path(File.dirname(caller_info[0]))\n if (test_dir_pos = caller_dirname.index(TEST_REGEX)) > 0\n root_dir = caller_dirname[0..(test_dir_pos-1)]\n end\n end", "def access_file_name\n end", "def fetch_path(start_path)\n ['', 'config'].each do |directory|\n ['', '.'].each do |prefix|\n path = File.join(start_path, directory, \"#{prefix}#{@file_name}\")\n return path if File.exist?(path)\n end\n end\n nil\n end", "def this_dir\n File.expand_path(File.dirname(caller_file(caller)))\n end", "def files_post_erbed\n return files_for_erb.map { |e| src_path( erbed_filename( e ) ) }\n end", "def file() = pathname.relative_path_from(Cnfs.config.paths.definitions)", "def find_location(filename)\n Find.find(path) do |element| \n if element.include? filename\n candidate = Pathname.new(element)\n yield candidate.dirname.to_s\n end \n end\n end", "def file_dir\n 'files'\n end", "def my_dir\n File.dirname(__FILE__)\nend", "def from\n from = File.basename(caller[4])\n end", "def this_file_path\n Pathname.new( __FILE__ ).expand_path\n end", "def path_for(filename)\n return nil unless filename\n for dir in @dirs\n result = path_from_dir_for(dir,filename)\n return result if result\n end\n @logger.fatal(\"Failed to locate '#{filename}'\")\n return nil\n end", "def path_section\n $1 if @basename.to_s =~ /\\.(\\d\\w*)\\./\n end", "def path_relative_to_caller( rpath, clr ) # :doc:\n unless rpath =~ %r{^/}\n from = caller_path( clr )\n rpath = File.expand_path( rpath, from ) if from\n end\n rpath\n end", "def app_dir_for(type) self.app_paths[type].first end", "def containing_directory\n path.dirname\n end", "def processed_file\n last_dir_in_path = Pathname(@origional_path).each_filename.to_a.last\n file_wo_path = @origional_file.sub('.'+process_tag, '').sub(@origional_path, '')\n File.join($config[\"processed_loc\"], last_dir_in_path, file_wo_path)\n end", "def f(path)\n File.dirname(__FILE__) + \"/\" + path\nend", "def f(path)\n File.dirname(__FILE__) + \"/\" + path\nend", "def template_path\n exact_path = File.join(root, request.path)\n with_erb = File.join(root, \"#{request.path}.html.erb\")\n with_index = File.join(root, File.dirname(request.path), 'index.html.erb')\n\n [ exact_path, with_erb, with_index ].find { |f| File.file?(f) }\n end", "def server_file(uri)\n require 'pathname'\n require 'uri'\n Pathname.new(URI.parse(uri).path).basename.to_s\nend", "def self_path\n caller_locations(1,1)[0].label.to_s.camelize(:lower)\n end", "def templates() = templates_path.glob('**/*.erb')", "def file\n backtrace.first.split(\":\")[0]\n end", "def current_module\n File.basename(__FILE__, \".rb\")\nend", "def sample_path(*names)\n File.join(\n File.dirname(__FILE__), 'programs', *names)\nend", "def file_and_line\n path, line = *@proc.inspect.match(PROC_PATTERN)[1..2]\n path = File.expand_path(path)\n pwd = File.expand_path(PWD)\n if path.index(pwd)\n path = path[pwd.length+1..-1]\n elsif path =~ /.*\\/gems\\/(.*\\.rb)$/\n path = $1\n end\n [path, line.to_i]\n end", "def root; Pathname(__dir__).parent; end", "def template_files\n Pathname.glob(staged_root.join(\"**\", \"*.erb\")).select(&:file?)\n end", "def template_name\n self.path.scan(/[^\\/]+$/).first\n end", "def main_files\n retrieve_files_in_main_dir\n end", "def full_path\n \"templates/#{filename}\"\n end", "def __find_caller__(str)\n i_caller = str[0]\n if i_caller =~ /([^:]+):([0-9]+)(:.*)?/\n file = File.expand_path($1)\n line = $2.to_i\n if not $__source_files__.include?(file)\n $__source_files__.push(file)\n end\n [file, line]\n else\n puts i_caller\n puts \"[Internal Error] __find_caller__ is called inappropriately.\" \n exit(1)\n end\nend", "def load_path\n paths, file = [\"\"], current_file\n paths << File.dirname(file) if file\n paths + LOAD_PATH\n end", "def figure_path(file)\n return file if Pathname.new(file).absolute?\n $LOAD_PATH.each do |path|\n found = File.join(path, file)\n return File.expand_path(found) if File.file?(found)\n end\n file\n end", "def base_file\n path.join(\"#{daemon_name}.rb\")\n end", "def active_path\n if script = script_object()\n if path = script.path\n return path.dup\n end\n end\n\n # If for some reason that didn't work, return the compile time filename.\n method.file.to_s\n end", "def root\n Pathname.new(File.dirname(__dir__))\n end", "def get_template_filepath_in_directory( directory, template_file ) \n @logger.debug( \"#{__method__} directory=#{directory}, template_file=#{template_file}\" )\n\n if ! File.exists?( directory ) then\n raise <<-eos\n\n No such directory '#{directory}'.\n \n Option -g should list\n - existing paths OR\n - Gems which includes 'mustache' directory\n \n eos\n\n end\n\n template_path = \"#{directory}/#{template_file}.#{@template_extension}\"\n @logger.info( \"#{__method__} read template_path=#{template_path}\" )\n \n return template_path\n\n end", "def file_path\n dir\n end", "def get_code_name\n code_name = $0\n code_name = Pathname.new(code_name)\n code_name = code_name.basename.to_s\n return code_name\nend", "def app_dir_pathname\n @app_dir_pathname ||= Pathname.new(app_name)\n end", "def filerequested(request)\n\trequest_uri = request.split(\" \")[1]\n\tpath = \".\"+URI.unescape(URI(request_uri).path)\n\tpath = \"./index.html\" if path == \"./\"\n\treturn path\nend", "def path\n name.split(\"::\").join(\"/\").downcase\n end", "def file\n if glob = file_map['vclog']\n Dir.glob(glob).first\n else\n Dir.glob(DEFAULT_GLOB).first\n end\n end", "def rackup_path_from_argv\n if path = @bin.options[:rackup]\n return path if path.file?\n warn \"rackup does not exist at #{path} (given with -R)\"\n end\n end", "def path_for(app: app_name)\n \"#{base_path}/#{app}\"\n end", "def path_for(app: app_name)\n \"#{base_path}/#{app}\"\n end", "def dir\n calc_dir(@basename)\n end", "def find_file_named(name)\n top_level.class.find_file_named(name)\n end", "def local_template(path)\n # Is there a better way to specify alternate template locations with sinatra?\n File.read(File.join(File.dirname(__FILE__), \"server/views/#{path}\"))\n end", "def path\n path = @file.sub(File.expand_path(root_path), '')\n\n # if xx.haml (but not xx.html.haml), \n if tilt?\n path = path.sub(/\\.[^\\.]*$/, \"\")\n path += \".#{default_ext}\" unless File.basename(path).include?('.')\n end\n\n path\n end", "def dir\n File.dirname(__FILE__)\n end", "def dir_for(type) Merb.load_paths[type].first end", "def self_path\n caller_locations(1,1)[0].label.to_s.camelize\n end", "def resource_path(path)\n path = Pathname.new(path).expand_path.relative_path_from(Pathname.pwd).to_s\n path = path.sub('.rb', '')\n path = path.split('/')\n from_block_dir_path = false\n path.shift if path.first == 'app'\n path.shift if path.first == 'lib'\n if path.first == 'blocks'\n path.shift\n from_block_dir_path = true\n end\n path.shift if path.first == underscored_app_namespace\n if path.include?('derivatives')\n path.delete('derivatives')\n from_block_dir_path = true\n end\n if from_block_dir_path\n path.delete('sub_blocks')\n path.pop if path.last == 'model'\n if path.last == 'controller'\n path.pop\n path << \"#{path.pop}_controller\"\n end\n end\n path.join('/')\n end", "def get_file(name, env)\n name = name + '.rb' unless name =~ /\\.rb$/\n path = search_directories(env).find { |dir| Puppet::FileSystem.exist?(File.join(dir, name)) }\n path and File.join(path, name)\n end", "def inspect\n File.basename @__path\n end", "def specfile\n Dir[\"#{@path}/[Ss]pecfile\"].first\n end", "def get_caller\n caller[1].split(\":\")[0]\n end", "def process_name\n # NOTE MEthod also in helper\n controller = Rails.application.routes.recognize_path(request.path)[:controller]\n process = controller.split(\"/\").first\n end", "def lookup_file_path\n file_path_list.each do |candidate_file_path|\n next unless File.file?(File.expand_path(candidate_file_path))\n return candidate_file_path\n end\n nil\n end", "def bundle_location_for(bundle_name)\n bundle_name = bundle_name.to_sym\n is_local_client = client_directories.include?(bundle_name.to_s)\n is_local_framework = framework_directories.include?(bundle_name.to_s)\n\n ret = nil\n if is_local_client || is_local_framework\n bundle_type = is_local_framework ? :framework : :client\n ret = {\n :bundle_name => bundle_name,\n :bundle_type => bundle_type,\n :source_root => File.join(root_path, bundle_type.to_s.pluralize, bundle_name.to_s)\n }\n else\n ret = next_library.nil? ? nil : next_library.bundle_location_for(bundle_name)\n end\n\n return ret\n end", "def locate_include_file(context, file, safe)\n includes_dirs = ['_templates','_templates/liquid','_templates/liquid/ops','_templates/ops','theme/_includes','theme/_layouts']\n includes_dirs.each do |dir|\n path = File.join(dir.to_s, file.to_s)\n return path if File.exist?(path)\n end\n raise IOError, could_not_locate_message(file, includes_dirs, safe)\n end", "def enclosed_directory\n \".\"\nend", "def file_name\n # file = full_name\n # file = file.gsub('::', '/')\n # file = file.gsub('#' , '/')\n # file = file.gsub('.' , '-')\n # #file = File.join(output, file + '.html')\n # file\n WebRI.entry_to_path(full_name)\n end", "def find_path_with_base(f)\n Dir.glob(f + \"*\").first || \"\" # don't return nil; makes for bad spec error messages\nend", "def for(file_or_dir); end", "def full_template_path\n template_root.join(\"#{@template}.erb\").to_s.squeeze(\"/\")\n end", "def file_path(file_name)\n file_map[file_name]['path']\n end", "def file_path(file_name)\n file_map[file_name]['path']\n end", "def files\n Dir[root_path(\"app\", \"**\", \"*.rb\")] + [@app_class.app_file]\n end", "def root\n File.dirname(__FILE__)\n end", "def get_content_path\r\n if ENV[\"RACK_ENV\"] != \"test\"\r\n File.expand_path(\"..\", __FILE__) + \"/content_files\"\r\n else\r\n File.expand_path(\"..\", __FILE__) + \"/test/content_files\"\r\n end\r\nend" ]
[ "0.67720985", "0.6450147", "0.64347374", "0.63042325", "0.63042325", "0.6288789", "0.6281273", "0.6262194", "0.61561275", "0.61107826", "0.6066449", "0.6037355", "0.6036283", "0.60210586", "0.60029703", "0.5998585", "0.59810364", "0.59595376", "0.59490246", "0.58945495", "0.58678204", "0.5863406", "0.58381057", "0.58122444", "0.5806025", "0.57994986", "0.57984805", "0.5795654", "0.57935506", "0.5768588", "0.57594645", "0.5743888", "0.5738665", "0.5727185", "0.57124597", "0.5710931", "0.5705244", "0.570122", "0.5683238", "0.5672177", "0.56648195", "0.562575", "0.5619756", "0.5619721", "0.56034786", "0.56034786", "0.5598273", "0.5591716", "0.5591611", "0.55858326", "0.5582983", "0.55753154", "0.55704963", "0.55663896", "0.55631906", "0.5552379", "0.5541707", "0.55382967", "0.55320454", "0.55302817", "0.55291736", "0.55284405", "0.55186963", "0.55142814", "0.5513204", "0.55066574", "0.5483442", "0.5481586", "0.54684377", "0.5458307", "0.54531884", "0.5448548", "0.5445815", "0.5445217", "0.5445217", "0.5444726", "0.5443703", "0.54432523", "0.544302", "0.5442199", "0.54417", "0.5439852", "0.54392624", "0.5437974", "0.5430882", "0.5428203", "0.54266363", "0.5425625", "0.5421656", "0.5418172", "0.54164803", "0.54118484", "0.5410951", "0.5409221", "0.5408689", "0.54003084", "0.53978425", "0.53978425", "0.53912365", "0.53888315", "0.5379613" ]
0.0
-1
GET /events/1 GET /events/1.json
def show @event = Event.find(params[:id]) @ticket = @event.tickets.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @event = Event.find(params[:id])\n render json: @event\n end", "def get(event_id)\n @client.request \"events/#{event_id}\"\n end", "def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not Found\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end", "def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end", "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end", "def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end", "def index\n @events = Event.all\n render json: @events, status: 200\n end", "def index\n @event = Event.all\n render json: @event\n end", "def index\n @events = Event.find(:all)\n respond_to do |format|\n format.html\n format.json\n end\n end", "def index\n respond_to do |format|\n format.html\n format.json { render json: @events }\n end\n end", "def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end", "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def details\n get(\"v1/event/#{@id}\")\n end", "def index\n @events = Event.all\n render json: @events\n end", "def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myevent }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_event }\n end\n end", "def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end", "def index\n @events = Event.all\n\n render json: @events\n end", "def show\n render json: @event, status: :ok\n end", "def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json do\n render :json => {events: @events}\n end\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.json { render json: @events }\n end\n end", "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event } \n end\n end", "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "def show\n render json: @event\n end", "def show\n render json: @event\n end", "def show\n render json: @event\n end", "def show\n render json: @event\n end", "def show\n render json: @event\n end", "def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json \n end\n end", "def show\n render json: EventSerializer.new(@event).as_json, status: 200\n end", "def event(event, options = {})\n get \"events/#{event}\", options\n end", "def index\n response = { events: Event.all }\n respond_to do |format|\n format.json { render json: response.to_json }\n format.html { render :index }\n end\n end", "def index\n render json: Event.all, status: :ok\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def index\n @events = current_user.events\n\n render json: @events\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def event(id, options = {})\n get \"events/#{id}\", options\n end", "def index\n @events = Event.all\n @event = Event.new\n\n respond_to do |format|\n format.html\n format.json { render 'events/index', events: @events }\n end\n end", "def show\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event_type = EventType.find(@event.event_type_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end", "def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end", "def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend", "def index\n @event = Event.find(params[:event_id])\n\n end", "def index\n @upcoming_events = Event.upcoming\n @past_events = Event.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def show\n \trender json: @event\n end", "def index\n @events = current_user.events\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n @events = getUpcomingEvents()\n \n @page_title = \"Events\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "def index\n respond_with(@events)\n end", "def show\n render json: format_event(@event)\n end", "def show\n @current_event = CurrentEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @current_event }\n end\n end", "def get_events\n if @user.uuid.present?\n @events = @user.events.active_events.page(params[:page])\n paginate json: @events, per_page: params[:per_page]\n elsif @user.uuid == \"guest\"\n @events = Com::Nbos::Events::Event.active_events.where(tenant_id: @user.tenant_id)\n render json: @events\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end", "def show\n begin\n @event = Event.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to show invalid event #{params[:id]}\"\n redirect_to events_path, notice: 'Invalid event ID'\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end\n end", "def index\n @events = @category.events\n render json: @events \n end", "def index\n\t\t@events = Event.all.order('created_at desc')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @events }\n\t\tend\n\tend", "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event, methods: [:talks] }\n end\n end", "def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end", "def index\n if params[:user]\n @events = Event.where(user: params[:user]).first\n else\n @events = Event.all.order('created_at asc')\n end\n\n render json: @events, :only => [:id, :date, :user, :event_type, :message, :otheruser]\n end", "def get_event(session, options={})\n json_request \"get\", {:session => session}, options\n end", "def index\n \n @events = current_user.events\n \n \n respond_to do |format|\n format.html {}\n format.json { render json: Event.events_to_json(@events) }\n end\n end", "def show\n @calendar = Calendar.find(params[:id])\n @events = Event.find(@calendar.event_ids)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @calendar }\n end\n end" ]
[ "0.75029767", "0.74019474", "0.7361382", "0.7348975", "0.73475033", "0.7338018", "0.7317425", "0.72875094", "0.72813755", "0.7246173", "0.72317284", "0.7219172", "0.7219172", "0.7218839", "0.7218839", "0.721464", "0.7204848", "0.71989256", "0.7196662", "0.71925515", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7192214", "0.7190171", "0.7189989", "0.71858066", "0.71843475", "0.71817815", "0.7178166", "0.716525", "0.71637964", "0.7158998", "0.71580267", "0.7120116", "0.7120116", "0.7120116", "0.7120116", "0.7120116", "0.7104676", "0.7098543", "0.70866513", "0.7075021", "0.7071629", "0.70692325", "0.70692325", "0.7067004", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.70606047", "0.7050251", "0.7043129", "0.70385677", "0.70330113", "0.7027942", "0.7025206", "0.70196456", "0.6993209", "0.69843143", "0.69733816", "0.69682246", "0.69497913", "0.6949218", "0.6943893", "0.6929541", "0.69259447", "0.6922537", "0.69194067", "0.6912311", "0.6893206", "0.689077", "0.687633", "0.6853893", "0.6851784" ]
0.0
-1
Check if all time slot ids exist times: array of time slot id
def validate_time_slot_ids times empty_times if times.size == 0 times.each do |id| time_slot = TimeSlot.find(id) end true rescue ActiveRecord::RecordNotFound r = {times: 'Record Not Found'} return not_found r end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def validate_time_slots times\n time_models = []\n times.each do |time|\n t = TimeSlot.new(from: time[:from], to: time[:to], opinion_poll: @opinion_poll)\n\n bad_request t.errors.messages and return unless t.valid?\n time_models.append t\n end\n time_models\n end", "def get_time_slot_array\n time_slot_array = [\"07:00\", \"07:30\", \"08:00\", \"08:30\", \"09:00\", \"09:30\", \"10:00\", \"10:30\",\n \"11:00\", \"11:30\", \"12:00\", \"12:30\", \"13:00\", \"13:30\", \"14:00\", \"14:30\",\n \"15:00\", \"15:30\", \"16:00\", \"16:30\", \"17:00\", \"17:30\", \"18:00\", \"18:30\",\n \"19:00\", \"19:30\", \"20:00\", \"20:30\", \"21:00\"]\n end", "def check_slot(day, slot)\n\t\t\tevents = Event.where(day: day)\n\t\t\tused_slots = events.pluck(:slot)\n\n\t\t\tif used_slots.include? slot\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\treturn true\n\t\t\tend \n\t\tend", "def valid_schedule?(time_blocks)\n time_blocks = quicksort_timeblocks(time_blocks)\n return !exists_overlap?(time_blocks)\n end", "def check_times\n if start_end_times.count > 0 && !start_end_times.nil?\n start_end_times.each do |t|\n return true if t.check_time_ranges\n end\n\n false\n else\n true\n end\n end", "def timeslot_contains_reservations?\n return start_dt.blank? || end_dt.blank? || existing_reservations?\n end", "def free_time_frame?\n started_booking_time = Booking.where(start_time: start_time)\n\n if started_booking_time.present? && (started_booking_time.ids.first != id)\n errors.add(:start_time, 'Sorry, this hour is already booked')\n end\n end", "def next_time_slots\n\t\ttime_slot_array = self.timeslots\n\t\ttime_slot_array.drop_while do |x|\n\t\t\tx[0].split(\"-\")[0].to_time < Time.now\n\t\tend\n\tend", "def time_slots\n collection=[]\n start_time=Time.now.beginning_of_hour\n end_time=Time.now.tomorrow.midnight-1.hour\n time=start_time\n\n while time < end_time\n collection<<[time.beginning_of_hour.hour, time.beginning_of_hour]\n time=time+1.hour\n end\n\n collection\n end", "def uniqueness_of_timeframes\n if(self.initial_time && self.end_time && timecard_id)\n #checks that there isn't any additional hour at the same time\n existing_hours = Hour.includes(:timecard).where([\"timecards.user_id = ? AND ((hours.initial_time >= ? AND hours.initial_time < ?) OR (hours.end_time > ? AND hours.end_time <= ?) OR (hours.initial_time <= ? AND hours.end_time >= ?))\", self.timecard.user_id, self.initial_time,self.end_time,self.initial_time,self.end_time,self.initial_time,self.end_time])\n if(existing_hours.length > 0 && existing_hours.first.id != self.id)\n self.errors.add(:initial_time, \"Oops, you already have an hour registered within this timeframe.\")\n end\n end\n end", "def is_slot_already_passed?\n\t\tunless self.date_of_booking != Time.zone.now.beginning_of_day \n\t\t\tunless self.resource.next_time_slots.include?(self.resource.timeslots[self.slot])\n\t\t\t\tself.errors[:slot_avaibility] << \"=> This slot is already passed\"\n\t\t\tend\n\t\tend\n\tend", "def slot_empty?(slot, event)\n return ((slot.id + @slots_size).to_datetime <= event.start.to_datetime or\n slot.id >= event.finish.to_datetime)\n end", "def slots\n slot_start = start_time\n slot_end = slot_start + slot_length\n while slot_end <= end_time\n slot = ::V2::TimeSlot.new(start_time: slot_start, end_time: slot_end, event_id: @event_id)\n @slots << slot if slot.valid? && slot.save\n slot_start = slot_end + buffer\n slot_end = slot_start + slot_length\n end\n\n @slots\n end", "def generate_time_slots(time_entries)\n time_entries.map { |entry| extract_available_slots(entry) }.flatten\n end", "def has_conflict?(ts, days, t_range)\n slot_days = ts.days\n return false if no_matching_days?(slot_days, days)\n\n # We have matching days, so continue on.\n slot_range = get_range_times(ts.start_time, ts.end_time)\n\n collided?(t_range, slot_range)\n end", "def reservations_exist_in_block\n if timeslot_contains_reservations?\n errors.add(:base, I18n.t('reservation.reservations_exist_in_block'))\n end\n end", "def all_timeslots\n unless @all_timeslots.present?\n @all_timeslots = (1..5).map do |day_id|\n Timeslot.new(self, day_id, @day_start_minute, @day_end_minute)\n end\n end\n\n @all_timeslots\n end", "def slot_valid? \n\t\tavailable_slots = self.resource.available_time_slot(self.date_of_booking.strftime(\"%Y%m%d\") )\n\t\tavailable_slots.each do | slot |\n\t\t\treturn if slot[1] == self.slot.to_i\n\t\tend\n\t\t\tself.errors[:slot_invalid] << \"=> This slot is invalid\"\n\tend", "def valid_tournament_id\n \tall_tournaments = Tournament.all.to_a.map{|u| u.id}\n \treturn all_tournaments.include?(self.tournament.id) && self.tournament.end_date.nil?\n end", "def valid_tournament_id\n \tall_tournaments = Tournament.all.to_a.map{|u| u.id}\n \treturn all_tournaments.include?(self.tournament.id) && self.tournament.end_date.nil?\n end", "def timeslots\n\t\tif (self != nil)\n\t\t\tcompany = self.company\n\t\t\tstart_time = company.start_time\n\t\t\tend_time = company.end_time\n\t\t\tcompany_duration = (( end_time - start_time )/60).round(2)\n\t\t\tno_of_slots = ( company_duration / (self.time_slot.hour*60 + self.time_slot.min) ).to_i\n\t\t\ttime_slot_array =Array.new\n\t\t\tremember_hour = start_time.hour.round\n\t\t\tremember_min = start_time.min\n\t\t\tno_of_slots.times do | index |\n\t\t\t\ta = remember_hour == 0 ? \"00\" : remember_hour\n\t\t\t\tb = remember_min == 0 ? \"00\" : remember_min\n\t\t\t\tc = ((remember_min + self.time_slot.min)/60 )+remember_hour+self.time_slot.hour == 0 ? \"00\" :((remember_min + self.time_slot.min)/60 )+remember_hour+self.time_slot.hour\n\t\t\t\td = (remember_min + self.time_slot.min) % 60 == 0 ? \"00\" : (remember_min + self.time_slot.min) % 60\n\t\t\t\ttime_slot_array << [\"#{a}:#{b}-#{c}:#{d}\", index]\n\t\t\t\tremember_hour = ((remember_min + self.time_slot.min)/60 )+remember_hour+self.time_slot.hour\n\t\t\t\tremember_min = (remember_min + self.time_slot.min) % 60\n\t\t\tend\n\t\t\ttime_slot_array\n\t\tend\n\tend", "def validate\n\t\tif not isEmpty(self.time)\n\t\t\terrors.add(:time, \"is already occupied.\")\n\t\tend\n\t\tif not Schedule.isValidTimeSlot(self.schedule, self.time)\n\t\t\terrors.add(:time, \"is not a valid timeslot.\")\n\t\tend\n\tend", "def must_choose_at_least_one_time\n \tif compact_times_available.size <= 0\n \t\tself.errors[:base] << \"Must choose at least one time slot\"\n \tend\n end", "def time_slots\n\n # you can book by the hour, and you can stay for an hour\n reservation_interval = 1.hour\n\n # Determine the earliest time we will allow reservation\n # It can't be in the past, we'll start 10 minutes from now\n start_time = Time.zone.now + 10.minutes\n # Then we have to round to the next hour block\n start_time = Time.zone.at( (start_time.to_f / reservation_interval).ceil * reservation_interval )\n # Then, if we are still earlier than opening hour, just use the opening hour\n # We can use the 'max' Array method\n start_time = [start_time, start_time.change(hour: opening_hour)].max\n\n # Determine the furthest in the future we will allow reservations\n end_time = (start_time + 3.days).change(hour: closing_hour)\n\n # Now, we want to make a list of every hour between our start_time and our end_time\n # For this we can use a begin... end while condition loop.\n # We'll start with an empty array that will hold all the hours,\n # and a variable to hold each hour, which we will keep increasing by 1 hour, and then add to our array\n # Our loop condition will have us stop looping once we've reached the end time\n\n all_times = []\n a_time = start_time\n\n begin\n\n # add this time to our list of times\n all_times << a_time\n\n # increment the time\n a_time += reservation_interval\n\n # Once we get to closing time, we have to skip ahead to the next day's opening\n # That way you can't make a reservation at 2am\n if (a_time + reservation_interval) > a_time.change(hour: closing_hour)\n a_time = (a_time + 1.day).change(hour:opening_hour)\n end\n\n end while a_time < end_time\n\n all_times\n end", "def conflict?(times)\n\t\treturn false if @tba == true\n\n\t\ttimes.each do |time|\n\t\t\treturn false if time.tba == true\n\t\t\treturn true if \\\n\t\t\t\t\t((time.startTimeInMinutes <= @endTimeInMinutes && time.startTimeInMinutes >= @startTimeInMinutes) \\\n\t\t\t\t\tor (time.endTimeInMinutes >= @startTimeInMinutes && time.endTimeInMinutes <= @endTimeInMinutes) \\\n\t\t\t\t\tor (time.startTimeInMinutes > @startTimeInMinutes && time.endTimeInMinutes < @endTimeInMinutes) \\\n\t\t\t\t\tor (time.startTimeInMinutes < @startTimeInMinutes && time.endTimeInMinutes > @endTimeInMinutes)) \\\n\t\t\t\t\tand (@days & time.days).length > 0\n\t\tend\n\n\t\treturn false\n\tend", "def airport_has_watch_hour(airport_id, time)\n @airport_watch_hour_map ||= {}\n return @airport_watch_hour_map[\"#{airport_id}-#{time.to_s}\"] if @airport_watch_hour_map[\"#{airport_id}-#{time.to_s}\"].present?\n watch_hour = @watch_hours.detect{ |w| w.airport_id == airport_id and ( w.start_at <= time and w.end_at >= time )}\n watch_hour.present? ? ( @airport_watch_hour_map[\"#{airport_id}-#{time.to_s}\"] = [ true, watch_hour.cost ] ) : ( @airport_watch_hour_map[\"#{airport_id}-#{time.to_s}\"] = [ false, 0 ] )\n @airport_watch_hour_map[\"#{airport_id}-#{time.to_s}\"]\n end", "def airport_has_notam(airport_id, time)\n @airport_notam_map ||= {}\n return @airport_notam_map[\"#{airport_id}-#{time.to_s}\"] if @airport_notam_map[\"#{airport_id}-#{time.to_s}\"].present?\n notam = @notams.detect{ |n| n.airport_id == airport_id and ( n.start_at <= time and n.end_at >= time ) }\n notam.present? ? ( @airport_notam_map[\"#{airport_id}-#{time.to_s}\"] = true ) : ( @airport_notam_map[\"#{airport_id}-#{time.to_s}\"] = false )\n @airport_notam_map[\"#{airport_id}-#{time.to_s}\"]\n end", "def no_time_overlap\n @other_bookings = Booking.where(:date => date)\n @other_bookings.each do |other_booking|\n if other_booking.time.strftime(\"%I:%M%p\") == time.strftime(\"%I:%M%p\") && other_booking.room_id == room_id\n errors.add(:time, \"Cannot book, overlapping sessions!\")\n end\n end\n end", "def timeslots_during_conference\n outside = self.timeslots.reject do |ts|\n ts.start_time.to_date.between? begins, finishes\n end\n return true if outside.empty?\n errors.add_to_base(_('There are %d timeslots for this conference ' +\n 'outside its time span: %s') %\n [outside.size,\n outside.map {|ts| \"%s (%s)\" %\n [ts.start_time, ts.room.name]}.join(', ')])\n end", "def exists_overlap?(time_blocks)\n (0..time_blocks.size - 2).each do |i|\n if (time_blocks[i].term == time_blocks[i+1].term &&\n time_blocks[i].day == time_blocks[i+1].day &&\n time_blocks[i].end_time > time_blocks[i+1].start_time)\n return true\n end\n end\n return false\n end", "def checkRoomAvailibilty(date, time, scheduleTable)\n j=0\n while j < scheduleTable.size\n if date == scheduleTable[j][\"Date\"] && time == scheduleTable[j][\"Time\"] && self.building == scheduleTable[j][\"Building\"] && self.roomNum == scheduleTable[j][\"Room\"] && \"true\" == scheduleTable[j][\"Available\"]\n return true\n else\n j+=1\n end\n end\n return false\n end", "def time?\n !times.empty?\n end", "def check_overlap\n bookings = @parking_space.booking.all\n booking = booking_params.values\n for currentBooking in bookings\n if booking.at(3).to_i < currentBooking.finish_time.to_i && currentBooking.start_time.to_i < booking.at(4).to_i\n return true\n end \n end\n return false\n end", "def not_overlapping\n @meetingsRD = Meeting.where(\"day = ? and room = ?\", day, room)\n overlap = false\n @meetingsRD.each do |mtng|\n if (id != mtng.id)\n if ((finish <= mtng.start) || (start >= mtng.finish))\n overlap = false\n else\n overlap = true\n errors.add(:finish, 'Sorry! It overlaps ' + (mtng.subject).upcase + ' meeting')\n errors.add(:start, 'Sorry! It overlaps ' + (mtng.subject).upcase + ' meeting')\n break #if overlap, finish the loop\n end\n end\n end\n end", "def create_schedule_conflict(rname,day,stime,etime)\r\n #flag=false\r\n @statuss=Status.find(:all,:conditions => [\"room_name = ? AND schedule_day = ?\",rname,day])\r\n if @statuss\r\n @statuss.each do |s|\r\n if time_conflict(stime,etime,s[\"start_time\"],s[\"end_time\"])\r\n return true\r\n end\r\n end\r\n end\r\n return false\r\n end", "def appointment_unique_with_doctor_in_clinic\n times_taken = []\n begin\n self.doctor.appointments.confirmed.each do |appt|\n unless appt.id == self.id\n times_taken << appt.appointment_time\n end\n end\n rescue NoMethodError\n errors.add(:doctor_id, 'No doctor specified')\n end\n errors.add(:appointment_time, \"Time not available\") if times_taken.include?(appointment_time)\n end", "def is_slot_alloted?\n\t\tif self.company.bookings.find_by_date_of_booking(self.date_of_booking)\n\t\t\tif self.new_record?\n\t\t\t\tdays_booking = self.company.bookings.where(date_of_booking: self.date_of_booking)\n\t\t\telse\n\t\t\t\tdays_booking = self.company.bookings.where(date_of_booking: self.date_of_booking).where.not(id: self.id)\n\t\t\tend\n\t\t\tdays_booking.each do |x|\n\t\t\t\tunless x.slot != self.slot\n\t\t\t\t\tself.errors[:allocated_slot] << \"=> This slot is already alloted\"\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def manage_time_slots\n @time_slot = TimeSlot.new\n\n end", "def timeslots\n unless @timeslots.present?\n timeslots = Timeslot\n .timeslots_for(@schedule_range, @form)\n .select { |ts| ts.blocks >= @blocks_needed }\n timeslots = @schedule_range.all_timeslots if timeslots.empty?\n @timeslots = timeslots.sort_by { |ts| [ts.day_id, ts.start_minute] }\n end\n\n @timeslots\n end", "def reserved_slots(date)\n Reservation.confirmed.where(nook_id: self.id)\n .happening_within(date.beginning_of_day..date.end_of_day)\n .map do |r|\n r.start.strftime('%H%M').to_i..\n (r.end + 1.seconds).strftime('%H%M').to_i\n end\n end", "def include?(time)\n if @days[time.wday]\n # If no times then days matching is good enough \n return true if @time_ranges.size == 0\n \n # Check time range(s)\n for time_range in @time_ranges\n time_n = time.hour * 100 + time.min\n return true if time_n >= time_range.start and\n time_n < time_range.end\n end\n end\n \n false\n end", "def verify_start_time time\n\n # Check that there are currently\n # records on the day to iterate through\n dsym = self.class.date_symbol time\n return true if not self.class.days_index[dsym]\n\n self.class.days_index[dsym].each do |record|\n\n next if record.end_time == :running\n next if record == self\n if time < record.end_time\n raise ArgumentError, \"Time conflict with existing record\" if time_in_record? time, record\n end\n end\n true\n end", "def timeslots\n data['timeslots'].map { |ts|\n Timeslot.new(\n Time.at(ts['start_date']),\n Time.at(ts['end_date'] || ts['start_date']),\n data['timezone']\n )\n }.reject(&:finished?).sort_by(&:start_date)\n end", "def includes?(time)\n next_occurrence = next_occurrence(time) || last_occurrence\n residue_for(time) == @residue \\\n && !next_occurrence.nil? \\\n && time_overlaps?(time, next_occurrence, next_occurrence + duration)\n end", "def generate_schedule\r\n match_list = make_match_list\r\n schedule = make_empty_schedule\r\n # pp match_list\r\n # pp match_list.size\r\n\r\n scheduled_matches = []\r\n referee_count = 0\r\n move_to_next_slot = false\r\n\r\n schedule.each do |day|\r\n # puts \"#{day[:day]}\"\r\n day[:slots].each do |slots|\r\n # puts \" #{slots[:time]}\"\r\n\r\n match_count = -1\r\n move_to_next_slot = false\r\n match_to_validate = {}\r\n\r\n slots[:matches].each do |match|\r\n # puts \" scheduled (#{scheduled_matches.size})\"; pp scheduled_matches\r\n # puts \"match list (#{match_list.size})\"; pp match_list\r\n # puts \" to_val: \"; pp scheduled_matches\r\n while(!validate_rest_time(match_to_validate, scheduled_matches))\r\n match_count += 1 #next match on match_list\r\n # puts \" CLASH: mc=#{match_count} \"\r\n match_to_validate = {:teams=>match_list[match_count],:day => day[:day], :time => slots[:time]}\r\n\r\n if(match_list.size == match_count)\r\n # puts \"----> Move to next slot\"\r\n move_to_next_slot=true\r\n break\r\n end\r\n end\r\n\r\n # puts \"move_to_next_slot: #{move_to_next_slot}\"\r\n \r\n unless(move_to_next_slot)\r\n scheduled_matches << match_to_validate\r\n match[:referees] = REFEREES[referee_count%REFEREES.size]\r\n match[:score] = [0,0]\r\n match[:teams] = match_list.delete_at(match_count)\r\n # print \"Adding match: \"; pp match\r\n # puts \"-\"*34\r\n referee_count += 1\r\n match_count = 0\r\n match_to_validate = {:teams=>match_list[match_count], :day => match[:day], :time => match[:time]}\r\n else\r\n break\r\n end\r\n\r\n end\r\n\r\n end\r\n end\r\n\r\n schedule\r\n end", "def valid?\n @slot_first && @slot_last && @slot_time\n end", "def should_not_overlap\n if table.reservations.where(\"time_from <= ? AND time_to > ? AND NOT id = ?\", time_from, time_from, id).count > 0\n errors.add(:time_from, \"shouldn't overlap with existing reservation\")\n end\n if table.reservations.where(\"time_from < ? AND time_to >= ? AND NOT id = ?\", time_to, time_to, id).count > 0\n errors.add(:time_from, \"shouldn't overlap with existing reservation\")\n end\n if table.reservations.where(\"time_from >= ? AND time_to <= ? AND NOT id = ?\", time_from, time_to, id).count > 0\n errors.add(:time_from, \"shouldn't overlap with existing reservation\")\n end\n end", "def mask_for_time_slots\n offset = (ends_at.next_day.beginning_of_day - ends_at) / APPOINTMENT_INTERVAL\n slots_number = (ends_at - starts_at) / APPOINTMENT_INTERVAL\n ('1' * slots_number).to_i(2) << offset\n end", "def clocked_in\n if clock_in_times.select {|c| c.time.localtime.to_date == Date.today}.count >= 1\n true\n end\n end", "def get_acceptable_call_times\n AvailableTime.all.map{|m|\n if m.pharmacy_id == self.id #should be interger already but casting just in case\n {\"start\" => m.start_time.strftime(\"%H:%M:%S\"), \"stop\" => m.end_time.strftime(\"%H:%M:%S\")}\n else\n nil\n end\n }.compact\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 includesTime(time_format)\r\n @times.empty? or @times.any? { |start,finish| start <= time_format && time_format < finish}\r\n end", "def get_unique_permutations annotation_time_slot\r\n\t\treturn annotation_time_slot.uniq.permutation.to_a\r\n\tend", "def has_appointment?(date, time)\n datetime = Temporal.generate_datetime(date, time)\n\n !is_available?(datetime, 20) #the time is broken up into 20 minute blocks\n end", "def overlaps?\n self.class.all.any? do |other|\n (start_hour > other.start_hour && start_hour < other.end_hour) ||\n (end_hour > other.start_hour && end_hour < other.end_hour)\n end\n end", "def available_time_slot date_of_booking\n\t\tif date_of_booking.gsub(/[-]+/,\"\").to_i != Time.zone.now.strftime(\"%Y%m%d\").to_i\n\t\t\tresource_slot = self.timeslots\n\t\t\tif self.bookings.where(date_of_booking:date_of_booking).where(status:1)\n\t\t\t\tbookings_of_day = self.bookings.where(date_of_booking: date_of_booking).where(status:1)\n\t\t\t\tbookings_of_day.each do |x|\n\t\t\t\t\tresource_slot.delete_at(x.slot)\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tresource_slot = next_time_slots\n\t\tend\n\t\tresource_slot\n\tend", "def any_empty_time_segment?\n self.empty?(self, \"time_segments\", false)\n end", "def can_schedule?(slot, employee, position, location)\n !existing_shifts.user_scheduled_at(employee.id, slot.x, slot.y) &&\n !existing_shifts.user_scheduled_during_day(employee.id, slot.x, location.id) &&\n !existing_shifts.user_scheduled_at(employee.id, slot.x, slot.y) &&\n slot.not_full? &&\n slot.position_room_available?(position.name) &&\n !minmax_not_eligible(slot, employee) &&\n not_during_time_off(slot, employee)\n end", "def vacant_slots(from, to)\n\n end", "def uniquely_identified_by_any_peptides?\n unique_spectra > 0\n end", "def empty_slots\n # INITIALIZE an array of empty slots\n empty_slots_indices = []\n # FOR EACH empty slot access its index\n @slots.each_with_index do |slot_num, index|\n # IF slot_num is 0\n if slot_num == 0\n # ADD its index in the collection of empty slots\n empty_slots_indices << index\n end\n end\n empty_slots_indices\n end", "def time_slots_for(time_entry)\n count = (duration_for(time_entry.range) / block_size).floor.to_i\n time = time_entry.start_time\n\n slots = count.times.map do |i|\n # Instantiate a new TimeSlot out of thin air (no backing store)\n slot = TimeSlot.new time, time + block_size.minutes, time_entry\n\n # Stash the current session onto the slot as well, so it may handle\n # some of it's own session based logic.\n slot.session = session\n\n # finally increment the time for the next iteration\n time = time + block_size.minutes\n\n slot\n end\n\n # Detect deadspace at the TimeSlot layer.\n # If found, we add a final TimeSlot to make up the difference.\n if time < time_entry.end_time\n slots << TimeSlot.new(time, time_entry.end_time, time_entry)\n end\n\n # Return the aggregated slot collection\n slots\n end", "def check_conflicts_with_room(booking, room, devices, capacity, recurring_days)\n\n if devices != room.devices\n if devices != 0\n return true\n end\n end\n\n logger.info \"capacity is #{capacity.to_i} and rooms capacity is #{room.capacity}\"\n if !capacity.nil?\n\n if capacity.to_i > room.capacity\n return true\n end\n end\n\n dates = split_booking booking.startdate,recurring_days\n\n splited_bookings = Array.new\n dates.each do |date|\n tmp_booking = Booking.new\n tmp_booking.enddate = booking.enddate\n tmp_booking.starttime = booking.starttime\n tmp_booking.endtime = booking.endtime\n tmp_booking.recurring = booking.recurring\n tmp_booking.startdate = date\n splited_bookings << tmp_booking\n end\n\n bookings = Booking.find_all_by_room_id room.id\n\n\n\n bookings.each do |booking_at_room|\n\n splited_bookings.each do |splited_booking|\n if check_conflicts_with_specific splited_booking,booking_at_room\n hour_bits_1 = build_hour_bits splited_booking\n hour_bits_2 = build_hour_bits booking_at_room\n if hour_bits_1 & hour_bits_2 != 0\n return true\n end\n end\n end\n\n end\n\n return false\n\n end", "def validate_time_blocks(time_blocks)\n b = time_blocks.select(&:collision_free?)\n\n # Test environment has unreliable data entry for start times.\n b = b.select(&:in_future?) unless Rails.env.test?\n\n b\n end", "def default_timeslots?\n true if self.timeslots.count == 0\n\n _initialize_timeslots(self.timeslots.count, self.timeslots.first.team_capacity).all?(&:persisted?) &&\n (!num_timeslots || self.timeslots.count == num_timeslots.to_i)\n end", "def valid_for_removal\n if timetable_in_use.include?(id)\n return false\n else\n return true\n end\n end", "def build_slots(current_time, finish_time, start_hour, finish_hour)\n while current_time < finish_time\n slots_quantity = get_slots_quantity(start_hour, finish_hour)\n\n (1..slots_quantity).each do\n verterx = @elements_factory.create_vertex(current_time, current_time.class,\n {gained_weight: 0, duration: @slots_size})\n @slots << verterx\n\n current_time += @slots_size\n break if current_time >= finish_time\n end\n\n current_time = current_time.beginning_of_day + start_hour.seconds_since_midnight.seconds + 1.day if start_hour.seconds_since_midnight > finish_hour.seconds_since_midnight\n end\n end", "def check_overlap\n appointments = Appointment.all\n current_start = DateTime.strptime(self.start_time,\"%m/%d/%y %H:%M\").to_time\n current_end = DateTime.strptime(self.end_time,\"%m/%d/%y %H:%M\").to_time\n\n appointments.each do |appt|\n appt_start = DateTime.strptime(appt.start_time,\"%m/%d/%y %H:%M\").to_time\n appt_end = DateTime.strptime(appt.end_time,\"%m/%d/%y %H:%M\").to_time\n\n ## if the appointment being checked is a new appointment ##\n if @new_appt\n if current_start >= appt_start && current_start <= appt_end\n @valid = false\n elsif current_end >= appt_start && current_end <= appt_end\n @valid = false\n end\n\n ## if the appointment being checked is an old appointment being updated ##\n else\n if current_start > appt_start && current_start < appt_end\n @valid = false\n elsif current_end > appt_start && current_end < appt_end\n @valid = false\n end\n end\n\n end\n @valid\n p @valid\n end", "def attended_slots\n self.tabling_slot_members.where(status_id: Status.where(name: :attended).first).map do |tsm|\n tsm.tabling_slot\n end\n end", "def open_slots(date)\n time = date.to_time\n \n slots = []\n prev_time = time - 30.minutes\n loop do\n start_time = prev_time + 30.minutes\n \n if start_time.to_date == date\n slots << Slot.new(starts_at: start_time, cat: self)\n prev_time = start_time\n else\n break\n end\n end\n \n # Remove taken/past timeframes\n slots.reject do |slot|\n Reservation.exists?(cat: self, starts_at: slot.starts_at) || slot.starts_at.past?\n end\n end", "def live_slots\n slots = []\n\n unless live_delivery_block_end_time.blank? || live_delivery_block_start_time.blank?\n available_hours = live_delivery_block_end_time - live_delivery_block_start_time\n\n number_of_slots = available_hours / 60.minutes\n\n number_of_slots.to_i.times do |i|\n slots << {\n from: live_delivery_block_start_time + i.hours,\n to: live_delivery_block_start_time + (i + 1).hours,\n type: :live\n }\n end\n end\n\n slots\n end", "def check_possible_times\n @possible_times = Event::POSSIBLE_TIMES_CONST\n end", "def intersecting_event_schedules\n room.event_schedules.where(start_time: start_time, schedule: schedule).where.not(id: id)\n end", "def get_times_array(padding = true)\n @times = (padding) ? [@start_dt - 1.hour] : [@start_dt]\n \n # and including every 1/2 hour until one hour after the selected end time\n while true do\n tmp = @times.last + 30.minutes\n (padding) ? (tmp == (@end_dt + 1.hour)) ? break : '' : (tmp == @end_dt) ? break : ''\n @times.push(tmp)\n end\n end", "def valid_team_and_game_id\n all_teams = Team.all.to_a.map{|u| u.id}\n all_games = Game.all.to_a.map{|u| u.id}\n return all_teams.include?(self.team_id) && all_games.include?(self.game_id)\n end", "def is_in_past?(timeslot)\n t_today = Time.now.strftime('%Y%m%d').to_i #today's date\n t_now = Time.now.strftime('%H%M').to_i #local time\n t_this_date = timeslot.strftime('%Y%m%d').to_i #this iteration's date\n t_this_time = timeslot.strftime('%H%M').to_i #this iteration's time\n return ((t_today == t_this_date and t_this_time <= t_now) or (t_this_date < t_today))\n end", "def time_collision_validation\n\t\tappointments = Appointment.all\n\n\t\t#if duration is equals to 0, it means it is fixed pay. \n\t\t#Here, duration is set to 0 so it will not be validated \n\t\t#This will execute if is_pay_per hour is set to 0\n\t\tif @start_date.present? && @start_time.present? && duration == 0.to_s\n\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\t\t\n\t\t\tappointments.each do |a|\n\t\t\t\t# will ensure that the appointment to compare will not be compared to itself in the database if it exists\n\t\t\t\tif a.id.to_s != @appointment_id.to_s\n\t\t\t\t\t# compare fixed-pay input to pay per hour appointment\n\t\t\t\t\tif a.task.is_pay_per_hour && start_at < a.end_at && start_at >= a.start_at \n\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\terrors.add(:start_date, \"An appointment is already \n\t\t\t\t\t\t\tset at #{a.start_at.strftime(\"%I:%M%p\")}, #{a.start_at.strftime(\"%d/%m/%Y\")} \n\t\t\t\t\t\t\tto #{a.end_at.strftime(\"%I:%M%p\")} on #{a.end_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\tbreak\n\n\n\t\t\t\t\t\t#compare fixed-pay input to fixed pay appointment\n\t\t\t\t\telsif !a.task.is_pay_per_hour && start_at == a.start_at \n\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\terrors.add(:start_date, \"A fixed pay appointment is aleady set at #{a.start_at.strftime(\"%I:%M%p\")}\n\t\t\t\t\t\t\t, #{a.start_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend \t\n\t\t\t\tend \t\n\t\t\tend\n\n\n\t\t\t\t#Here, duration should be present and will be always validated\n\t\t\t\t#This will execute if is_pay_per hour is set to 1\n\t\t\telsif @start_date.present? && @start_time.present? && duration.present?\n\t\t\t\tstart_at = Time.parse(\"#{@start_date} #{@start_time}\") + (1.hours)\n\t\t\t\tend_at = Time.parse(\"#{@start_date} #{@start_time}\") + (@duration.to_f.hours+ (1.hours))\n\n\t\t\t\tappointments.each do |a|\n\t\t\t\t\t# will ensure that the appointment to compare will not be compared to itself in the database if it exists\n\t\t\t\t\tif a.id.to_s != @appointment_id.to_s\n\t\t\t\t\t\t# compare pay per hour input to pay per hour appointment\n\t\t\t\t\t\tif a.task.is_pay_per_hour && start_at < a.end_at && a.start_at < end_at \n\n\t\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\t\terrors.add(:start_date, \"An appointment already \n\t\t\t\t\t\t\t\texists at #{a.start_at.strftime(\"%I:%M%p\")}, #{a.start_at.strftime(\"%d/%m/%Y\")} \n\t\t\t\t\t\t\t\tto #{a.end_at.strftime(\"%I:%M%p\")} on #{a.end_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\t\tbreak\n\n\t\t\t\t\t\t\t#compare pay per hour input to fixed pay appointment\n\t\t\t\t\t\telsif !a.task.is_pay_per_hour && a.start_at <= end_at && a.start_at >= start_at\n\n\t\t\t\t\t\t\terrors.add(:start_time, \"Please select a different date or time.\")\n\t\t\t\t\t\t\terrors.add(:start_date, \"A fixed pay appointment is aleady set at #{a.start_at.strftime(\"%I:%M%p\")}\n\t\t\t\t\t\t\t\t, #{a.start_at.strftime(\"%d/%m/%Y\")}. \n\t\t\t\t\t\t\t\tPlease select a different date or time.\")\n\t\t\t\t\t\t\tbreak\t\t\t\t\n\t\t\t\t\t\tend\t\t\t\n\t\t\t\t\tend \n\t\t\t\tend\n\t\t\tend \n\t\tend", "def valid?\n court_slots.any?\n end", "def time_taken?(model, ss_obj, params)\n stime = time_format(params[:stime_h], params[:stime_m], params[:stime_p])\n etime = time_format(params[:etime_h], params[:etime_m], params[:etime_p])\n\n # Invalid time, do not care\n return false if stime.nil? || etime.nil?\n\n time_wanted = get_range_times(stime, etime)\n\n # Get the days in an array.\n # If nothing is checked, get the\n # fuck out of here, man! Evolution!\n days = checked_days(params)\n return false if days.size == 0\n\n ss_obj.section_settings.each { |s| return true if has_conflict?(s.time_slot, days, time_wanted) }\n \n false\n end", "def add_timeslot_location(start_time, end_time, location_flex_rating, location_id_array)\n rt = ResponseTimeslot.new :start_time => start_time, :end_time => end_time, :location_flexibility_rating => location_flex_rating\n location_id_array.each do | location_id |\n # TODO - revisit preference logic here\n rt.response_timeslot_locations << (ResponseTimeslotLocation.new :event_location_id => location_id)\n end\n self.response_timeslots << (rt)\n self.save\n \n end", "def check_if_consistent_times(starting_hour, default_time_hour, ending_hour)\n\t\t(starting_hour <= default_time_hour) && (default_time_hour <= ending_hour)\n\tend", "def contains_time?(time)\n segments.each do |seg|\n return true if seg.contains_time?(time)\n end\n return false\n end", "def create_time_slots\n return unless params[:start_time]\n\n start_time = Time.from_picker(params.delete(:start_time))\n end_time = Time.from_picker(params.delete(:end_time))\n\n return if end_time < start_time # Prevent infinite loop\n\n shift_length = params.delete(:shift_length).to_i\n shift_overlap = params.delete(:shift_overlap).to_i\n people_per_shift = params.delete(:people_per_shift)\n\n num_shifts = ((end_time - start_time) / shift_length).ceil\n return if num_shifts > 100 # Arbitrary threshold to prevent flooding database\n\n cur_time = start_time\n TimeSlot.transaction do\n while cur_time < end_time\n end_shift_time = cur_time + shift_length + shift_overlap\n TimeSlot.create! job: @job,\n start_time: cur_time,\n end_time: [end_shift_time, end_time].min,\n slots: people_per_shift\n cur_time += shift_length\n end\n end\n end", "def checkIfBooked\n booking_start_time = Time.parse(get_booking[\"date\"].to_s)\n hours_booked = get_booking[\"hours_booked\"].to_i\n booking_stop_time = booking_start_time + (3600 * hours_booked)\n dates_booked = get_tutor[\"dates_booked\"]\n lesson_block = 14400\n bookings_array = []\n dates_booked.each do |date|\n start_time = Time.parse(date[\"date\"].to_s)\n stop_time = start_time + lesson_block\n if(booking_start_time >= start_time && booking_start_time <= stop_time)\n bookings_array.push(date)\n elsif(start_time >= booking_start_time && start_time <= booking_stop_time)\n bookings_array.push(date)\n end\n \n end\n if(bookings_array.length >= 1)\n return true\n else\n return false\n end\n end", "def valid_appointments(base_time)\n transform_blocks_to_appointments(valid_blocks(base_time))\n end", "def include?(time)\n for time_frame in @timeframes\n return true if time_frame.include?(time)\n end\n\n return (@timeframes.size == 0) # Empty time string matches all times\n end", "def check_conflict\n\n params[:id] = params[:id] ? params[:id] : 0\n flag = false\n arr_wd_sche_now = params[:a_day_check].each.map{|c| c.to_i}\n if params[:repeat_sche] == \"false\"\n start_date = format_date(params[:start_date])\n end_date = format_date(params[:end_date])\n @schedules = current_user.working_schedules.where(\"(:start_date BETWEEN start_date AND end_date) AND (:end_date BETWEEN start_date AND end_date) AND active = TRUE\",start_date: start_date, end_date: end_date).where.not(id: params[:id])\n @schedules.each do |sc|\n arr_wd_sches = sc.working_days.select(\"day_of_week\").where(open: true).map{ |w| w.day_of_week}\n arr_wd_sches.each do |c|\n if arr_wd_sche_now.include? c\n flag = true\n end\n end\n end\n render json: flag\n else\n start_date = format_date(params[:start_date])\n @schedules = current_user.working_schedules.where(\"(end_date >= :today) AND active = TRUE\",today: Date.today).where.not(id: params[:id])\n @schedules.each do |sc|\n arr_wd_sches = sc.working_days.select(\"day_of_week\").where(open: true).map{ |w| w.day_of_week}\n arr_wd_sches.each do |c|\n if arr_wd_sche_now.include? c\n flag = true\n end\n end\n end\n render json: flag\n end\n end", "def index\n if !time_slot_params[:start].present? && !time_slot_params[:end].present?\n @appointments = Appointment.all\n else\n #time_slot_params[:start], time_slot_params[:end]\n @appointments = Appointment.in_time_slot_only(time_slot_params).all\n end\n render :json => @appointments, :status => :ok\n end", "def empty_times\n r = {times: 'should not be empty'}\n return not_found r\n end", "def validate_time(start_time, end_time)\n\t\t\t\ttime_now = Time.now.strftime(\"%m/%d/%Y %H:%M\")\n\t\t\t\tappointments = Appointment.all\n\t\t\t\ttoday = start_time.split[0]\n\t\t\t\ttoday_appts = appointments.where(start_time: today)\n\t\t\t\tresult = false\n\n\t\t\t\tif start_time > time_now\n\t\t\t\t\tif today_appts.length == 0\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t\t\t\t\ttoday_appts.each do |appt|\n\t\t\t\t\t\tif start_time <= appt.end_time && appt.start_time <= end_time\n\t\t\t\t\t\t\treturn false\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tresult = true\n\t\t\t\t\t\tend\n\t\t\t\t\tend#end of each loop\n\t\t\t\tend#end of if start_time\n\t\t\t\tresult\n\t\t\tend", "def find_time_slot\n time_slot = check_club_times(next_user_time)\n\n if valid_tee_time?(time_slot)\n time_slot\n else\n go_to_next_day(time_slot)\n end\n end", "def depature_time_slots_must_be_present\n if departure_time_slots.blank?\n errors.add(:departure_time_slots, \"must be provided\")\n end\n end", "def no_overlap\n self.class.where(user_id: user.id, time_type: time_type).each do |other_time|\n errors.add(:start_time, \"i'm a sad error\") if overlaps?(other_time)\n end\n end", "def flown_in_event?(combination)\n event_participants.include?(combination.map(&:id))\n end", "def block_slots\n slots = []\n\n unless block_delivery_end_time.blank? || block_delivery_start_time.blank?\n\n available_hours = block_delivery_end_time - block_delivery_start_time\n\n number_of_slots = available_hours / 60.minutes\n\n number_of_slots.to_i.times do |i|\n slots << {\n from: block_delivery_start_time + i.hours,\n to: block_delivery_start_time + (i + 1).hours,\n type: :daytime\n }\n end\n end\n\n slots\n end", "def check_full_schedule\n has_full_schedule = true\n schedules = self.schedules\n schedules.each_with_index do |schedule, index|\n if(index != 0 && index != schedules.length-1)\n #if(schedule[:plan].length == 0 || schedule[:hotel].length == 0)\n if(schedule[:plan].strip.length == 0)\n has_full_schedule = false\n break\n end\n end\n end\n\n return has_full_schedule\n end", "def find_reservation_by_timeslot(timeslot, existing_reservations)\n t_next = timeslot + 30.minutes #next iteration's time\n timeslot = timeslot\n\n # Get existing reservations in this room from previously queried elasticsearch result\n room_reservations = existing_reservations.find {|r| r[id.to_i]}\n unless room_reservations.blank?\n # Return a has with the reservation information if it is found in the collection of reservations for this room in this timeslot\n reservation = room_reservations[id.to_i].find {|r| (r._source.start_dt.to_datetime >= timeslot and r._source.end_dt.to_datetime <= t_next) or (r._source.start_dt.to_datetime <= timeslot and r._source.end_dt.to_datetime >= t_next) }\n return reservation\n end\n\n end", "def exclusive_schedule\n if Schedule.where('init >= ? AND init <= ?', init, finish).any?\n errors.add(:base, \"Já existe uma reserva para esse horário\")\n end\n end", "def available_slots\n # Doit regarder le board et renvoyer un array avec les slots restants\n slots = []\n @board.each do |k,v|\n v.each_with_index { |num,i| slots << k + (i+1).to_s if num.zero?}\n end\n slots\n end", "def index\n \n @events = Event.where(\"for_student = true\").pluck(:id,:name)\n $students = Student.all.order(:UIN)\n $students.each do |x|\n @arr = Hash.new([])\n @tslots = x.timeslots\n @events.each do |ev|\n @check = FALSE\n @tslots.each do |t|\n if(t.event_id == ev[0])\n @arr[ev[1]] = (t.start_time.strftime(\"%I:%M%p\") + \"-\" + t.end_time.strftime(\"%I:%M%p\"))\n @check = TRUE\n break\n end\n end\n if(@check == FALSE)\n @arr[ev[1]] = (\"Not Attend\")\n end\n end\n $stu_slot[x.id] = @arr\n end\n end" ]
[ "0.66781074", "0.65845853", "0.6560357", "0.6447423", "0.63985753", "0.6378263", "0.63464206", "0.62637347", "0.6225948", "0.6207943", "0.61952233", "0.61527413", "0.6099937", "0.6064067", "0.6043473", "0.6039101", "0.60314065", "0.60021514", "0.59750915", "0.59750915", "0.5927575", "0.59215057", "0.5901498", "0.5897971", "0.58790314", "0.5866212", "0.58427596", "0.5841389", "0.5839521", "0.58288217", "0.58171266", "0.5762936", "0.5741885", "0.573042", "0.57111937", "0.57026744", "0.5687728", "0.56800073", "0.5671736", "0.56684667", "0.56659985", "0.5665477", "0.5654028", "0.565107", "0.56452334", "0.5637606", "0.5619457", "0.5619371", "0.5608511", "0.56028587", "0.5602469", "0.55991584", "0.55439746", "0.5537395", "0.55363154", "0.5526146", "0.5525829", "0.55246043", "0.55181926", "0.55064034", "0.5501331", "0.54996794", "0.5494814", "0.54921913", "0.5491116", "0.54897535", "0.5481638", "0.5480818", "0.5479988", "0.54533553", "0.54480356", "0.5442544", "0.5431263", "0.54310775", "0.54290944", "0.54248095", "0.54235005", "0.54104966", "0.54015887", "0.54008573", "0.5400215", "0.5393857", "0.53852105", "0.538174", "0.53791744", "0.53742987", "0.53729063", "0.53708327", "0.53564173", "0.5339503", "0.53362066", "0.53337276", "0.5327776", "0.53219473", "0.5315156", "0.53137577", "0.5299583", "0.5296949", "0.52949995", "0.5283657" ]
0.7683565
0
Exception when array times is empty.
def empty_times r = {times: 'should not be empty'} return not_found r end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def must_choose_at_least_one_time\n \tif compact_times_available.size <= 0\n \t\tself.errors[:base] << \"Must choose at least one time slot\"\n \tend\n end", "def test_empty_0\n # Changes: had to rewrite arrays as @cls\n # assert_equal true, [].empty?\n # assert_equal false, [1].empty?\n # assert_equal false, [1, 1, 4, 2, 5, 4, 5, 1, 2].empty?\n assert_equal true, @cls[].empty?\n assert_equal false, @cls[1].empty?\n assert_equal false, @cls[1, 1, 4, 2, 5, 4, 5, 1, 2].empty?\n end", "def test_empty_0\n # Changes: had to rewrite arrays as @cls\n # assert_equal true, [].empty?\n # assert_equal false, [1].empty?\n # assert_equal false, [1, 1, 4, 2, 5, 4, 5, 1, 2].empty?\n assert_equal true, @cls[].empty?\n assert_equal false, @cls[1].empty?\n assert_equal false, @cls[1, 1, 4, 2, 5, 4, 5, 1, 2].empty?\n end", "def any_time\n times(-1)\n end", "def times\n\t\t\tprogram = pop\n\t\t\tn = pop\n\t\t\traise ArgumentError, \"TIMEs: second element is not an Array.\" unless program.is_a? Array\n\t\t\tn.times { ~program.dup }\n\t\tend", "def time?\n !times.empty?\n end", "def test_returns_count\n assert(\n FromArray.new([1, 2, 3]).count == 3\n )\n assert(\n FromArray.new([]).count.zero?\n )\n end", "def test_mean_empty_array\n expected_sum = 0\n assert_equal expected_sum, Stats.average(Array.new)\n end", "def any_empty_time_segment?\n self.empty?(self, \"time_segments\", false)\n end", "def test_array_number_negative\n @numbers.each do |value, expected|\n # add auto negative values\n value = value.is_a?(String) ? '-' + value : value * -1\n expected = expected == '0' ? expected : '-' + expected\n\n assert_equal expected, @TS_Array.format(value)\n end\n end", "def test_average_of_empty_array_returns_zero\n assert_equal array_average([]), 0\n end", "def test_sum_empty_array\n expected_sum = 0\n assert_equal expected_sum, Stats.sum(Array.new)\n end", "def test_check_invalid_length\n assert_equal check_valid([2, 1]), [1, nil, nil, nil]\n end", "def test_empty_array_not_equal_1\r\n\t\tassert_equal(false,Array == 1)\r\n\tend", "def test_maps_no_elements\n stream = FromArray.new([])\n collected = stream.map { |val| val.to_s }.collect\n assert(collected.empty?)\n end", "def assert_not_empty\n if options.empty?\n raise \":length, :maxmimum or :minimum must be given as option\"\n end\n end", "def test_any_match_empty\n stream = FromArray.new([])\n assert(\n !stream.any_match { raise ScriptError, 'Should not be called' },\n 'Stream is empty, any_match should be false!'\n )\n end", "def test_day_output_too_many\r\n location = Minitest::Mock.new(\"test_location_arr\")\r\n assert_raises('found_rubies should only contain 2 integers!') { @g.day_output([2, 3, 4], 1, location) }\r\n end", "def test_computes_sum_of_empty_array\n\t\tassert_equal(0, sum([]))\n\tend", "def test_schedule_empty\n s = Schedule.new\n assert_empty s\n assert_nil s.next_tick\n assert_nil s.pop(nil)\n end", "def test_array_number_positive\n @numbers.each do |value, expected|\n assert_equal expected, @TS_Array.format(value)\n end\n end", "def test_all_match_no_elements\n stream = FromArray.new([])\n assert(\n stream.all_match { |val| val % 2 == 1 },\n 'Expected true because the stream is empty!'\n )\n end", "def never\n times 0\n end", "def same_length_validator(array1, array2)\n if array1.length != array2.length\n raise HarmonicsHelper::Errors::LengthError.new(\"length of each array is different\") \n end\n end", "def invariant\n\t\t\tassert(@filesWatched.kind_of? Array)\n\t\tend", "def test_arrayget_nil_on_negative_index\n collection = Sketchup.active_model.attribute_dictionaries\n expected = nil\n result = collection['']\n assert_equal(expected, result,\n 'Expected does not match result.')\n end", "def validate_time_slot_ids times\n\n empty_times if times.size == 0\n\n times.each do |id|\n time_slot = TimeSlot.find(id)\n end\n true\n\n rescue ActiveRecord::RecordNotFound\n r = {times: 'Record Not Found'}\n return not_found r\n end", "def test_arrayget_nil_on_nonexistent_index\n collection = Sketchup.active_model.attribute_dictionaries\n expected = nil\n result = collection['some_nonexistent_key']\n assert_equal(expected, result,\n 'Expected does not match result.')\n end", "def check_possible_times\n @possible_times = Event::POSSIBLE_TIMES_CONST\n end", "def test_arrayget_nil_on_nonexistent_index\n collection = Sketchup.active_model.pages\n expected = nil\n result = collection[collection.size]\n assert_equal(expected, result,\n 'Expected does not match result.')\n end", "def empty_squares\r\n @data.select {|_, square| square.empty?}.values # .values returns [] of squares [square1, square3,..etc] (not hash as .select does)\r\n end", "def missing(array, data)\n array_total = 0\n data_total = 0\n array.each {|n| array_total += n}\n data.each {|n| data_total += n }\n p (data_total - array_total)\nend", "def test_array_shortform_invalid\n assert_raises Exceptions::InvalidSchemaError do\n Schema.new do\n type(:array, %i[array integer], min: 2)\n end\n end\n end", "def length(array)\n raise NotImplementedError\nend", "def empty_slots\n # INITIALIZE an array of empty slots\n empty_slots_indices = []\n # FOR EACH empty slot access its index\n @slots.each_with_index do |slot_num, index|\n # IF slot_num is 0\n if slot_num == 0\n # ADD its index in the collection of empty slots\n empty_slots_indices << index\n end\n end\n empty_slots_indices\n end", "def missing?\n time.nil?\n end", "def empty?; size == 0 end", "def test_missing_numbers_some_missing\n result = @sudoku_1.missing_numbers(@sudoku_1.squares[3])\n assert_equal([1, 3, 5, 6], result)\n end", "def test_parser_handles_unsupported_email_array\n email_array_assert nil, nil\n email_array_assert nil, 123\n email_array_assert nil, {}\n email_array_assert nil, []\n end", "def test_empty\n order = orders(:santa_next_christmas_order)\n assert !order.empty?\n assert order.order_line_items.size > 0\n order.empty!\n assert order.empty?\n assert_equal order.order_line_items.size, 0\n end", "def times\n (@times || 1).to_i\n end", "def test_arrayget_nil_on_nonexistent_index\n collection = Sketchup.active_model.rendering_options\n expected = nil\n result = collection['foobar']\n assert_equal(expected, result,\n 'Expected does not match result.')\n end", "def test_number_101\n\t\t\n\t\t\tassert_nil(nil, mineminds_array[100])\n\t\tend", "def empty?\n @timers.empty?\n end", "def test_parser_handles_empty_email_array\n empty_string = ''\n\n email_array_assert empty_string, empty_string\n end", "def test_check_invalid_prospectors\n assert_equal check_valid([2, 0, 1]), [1, nil, nil, nil]\n end", "def off_times\n load_curve.count(&:zero?)\n end", "def missing_ranges()\n return [] if @time_map.nil?\n @time_map.missing_ranges()\n end", "def unknown(options = {:length => 0x1})\n# array :initial_length => options[:length] do\n# uint32 #:check_value => lambda { value == v }\n# end\n string :length => options[:length]*4, :truncate => true\n end", "def assert_empty meth, exp, exp_orig\n unless exp.empty? then\n msg = \"exp not empty after #{self.class}.#{meth} on #{exp.inspect}\"\n msg += \" from #{exp_orig.inspect}\" if $DEBUG\n raise NotEmptyError, msg\n end\n end", "def test_deck_draw_emptyDeck\n deck = Deck.new\n assert_nothing_raised {81.times {deck.draw}}\n end", "def test_args_check_less\n\t\targs_checker = ArgsChecker::new\n\t\tarr = []\n\t\tassert_raises(\"I need one number bud, try again\") { args_checker.check_args arr }\n\tend", "def empty?\n return @fill_count == 0\n end", "def empty_curve\n Array.new(FRAMES, 0.0)\n end", "def test_empty\n list = []\n assert_empty list\n end", "def test_empty\n list = []\n assert_empty list\n end", "def test_empty\n list = []\n assert_empty list\n end", "def test_computes_sum_of_empty_array\n result = @calculator.computes_sum([])\n expected = 0\n assert_equal expected, result\n end", "def test_args_check_nil\n\t\targs_checker = ArgsChecker::new\n\t\tarr = nil\n\t\tassert_raises(\"I need one number bud, try again\") { args_checker.check_args arr }\n\tend", "def test_exception_raised_if_array_of_one_element\n assert_raises ArgumentError do\n Party.new([Character.new])\n end\n end", "def test_10_times_0_is0\n\t\tassert_equal(0, multi(10,0))\t\t\n\tend", "def test_array_number_of_elements\n num_of_elem = nil\n array = [1,2,3,4]\n num_of_elem = array.count\n assert_equal 4, num_of_elem\n end", "def len\n timevec.length\n end", "def assert_no_conflict\n if length and (minimum or maximum)\n raise \":length option is XOR to (:minimum or :maximum)\"\n end\n end", "def check_array!(key, arr)\n if arr\n if arr.any?{|val| val.nil?}\n handle_error(key, :invalid_type, \"invalid value in array parameter #{param_name(key)}\")\n end\n else\n handle_error(key, :missing, \"missing parameter for #{param_name(key)}\")\n end\n end", "def check_single_calling_core(time_between)\n time_between.delete_at(0)\n time_between = [0] if time_between == []\n time_between\nend", "def simple_array_validator(val, name, size = T.unsafe(nil)); end", "def simple_array_validator(val, name, size = T.unsafe(nil)); end", "def validate_time_slots times\n time_models = []\n times.each do |time|\n t = TimeSlot.new(from: time[:from], to: time[:to], opinion_poll: @opinion_poll)\n\n bad_request t.errors.messages and return unless t.valid?\n time_models.append t\n end\n time_models\n end", "def test_empty_distinct\n stream = FromArray.new([])\n collected = stream.distinct.collect\n assert(collected.length.zero?)\n end", "def next_times(count)\n\n next_time ? [ next_time ] : []\n end", "def empty?\r\n @arr.empty?\r\n end", "def remove_times(event)\n\t\tevent.times.each do |t|\n\t\t\tif t[1].to_i-t[0].to_i < event.length\n\t\t\t\tevent.times.delete(t)\n\t\t\tend\n\t\tend\n\tend", "def is_empty?\n size == 0\n end", "def assert_nothing_harvested_for_segment_errors\n traces = harvest_error_traces\n events = harvest_error_events\n\n assert_equal 0, traces.length\n assert_equal 0, events.length\n end", "def empty()\n @size == 0\n end", "def empty()\n @arr1.empty?\n end", "def validate_time_blocks(time_blocks)\n b = time_blocks.select(&:collision_free?)\n\n # Test environment has unreliable data entry for start times.\n b = b.select(&:in_future?) unless Rails.env.test?\n\n b\n end", "def zero?\n size.nil? || size == 0\n end", "def test_get_element_nil_if_done\n s = Sequence.new(2, 1) {}\n assert_nil s[2]\n end", "def nilitems\n size - nitems\n end", "def test_locations_is_empty\n\t\tassert_equal [], @road.locations\n\tend", "def times()\n \t\terror?\n \t\t@stack << (@stack.pop * @stack.pop)\n end", "def solved?\n empty_slots.empty? # => same as empty_slots.length == 0\n end", "def not_available\n (0...@size).reject { |index| bit_on?(index) }\n end", "def is_empty()\n \n end", "def check_corrupted\n raise ArrayCorruptedError, \"Too late to call. Corrupted.\" if @array_corrupted\n end", "def test_skips_all_elements_count_gt_size\n stream = FromArray.new([1, 2, 3])\n collected = stream.skip(4).collect\n assert(\n collected == [],\n 'Expected ' + [].to_s + ' but got ' + collected.to_s\n )\n end", "def assert_no_enqueued_emails(&block)\n assert_enqueued_emails 0, &block\n end", "def check_key(key, array)\n return true if ![nil, '', '-'].include?(array[key])\n raise RuntimeError, \"#{key} is empty\"\n end", "def test_std_dev_empty_array\n expected_sum = 0\n assert_equal expected_sum, Stats.std_dev(Array.new)\n end", "def test_array2\n a = [1, 2, 3]\n assert_equal(3, a.length)\n end", "def test_that_full_tile_rack_doesnt_need_any_tiles\n 7.times{|num| @newTileRack.append(:A)}\n assert_equal(0,@newTileRack.number_of_tiles_needed)\n end", "def test_ASET_raises_error_if_input_is_not_in_frame\n a = @cls.new\n assert_raise(ArgumentError) { a[0] = 1 }\n assert_raise(ArgumentError) { a[0,1] = [1] }\n assert_raise(ArgumentError) { a[0,1] = [[1,2]] }\n end", "def test_empty_spaces_some_empty\n result = @sudoku_1.empty_spaces(@sudoku_1.squares[1])\n assert_equal([[0, 5], [1, 3], [1, 5], [2, 4]], result)\nend", "def test_day_output_negative_location\r\n location = Minitest::Mock.new(\"test_location_arr\")\r\n assert_raises('Invalid index!') { @g.day_output([1, 1], -1, location) }\r\n end", "def empty(array, length)\r\n i = 0;\r\n while i < array.length\r\n array[i] = 'SPECIAL_VALUE';\r\n i++;\r\n end\r\nend", "def empty?\n @size.zero?\n end", "def is_empty?\n @array.length == 0\n # if @array.length = 0\n # true\n # else\n # false\n # end\n end", "def test_empty_dict\r\n assert @dict .empty?\r\n end" ]
[ "0.614483", "0.6060145", "0.6060145", "0.5903699", "0.58698183", "0.5848611", "0.5832767", "0.5687147", "0.568666", "0.55943704", "0.5593099", "0.55908155", "0.5562388", "0.55398685", "0.54875576", "0.5483156", "0.5477802", "0.54491466", "0.5438058", "0.5428361", "0.54014957", "0.53662276", "0.5337575", "0.53347474", "0.53310263", "0.5327517", "0.53177625", "0.53083056", "0.5287444", "0.5278202", "0.52747595", "0.5268372", "0.5261427", "0.5261058", "0.5254597", "0.5238657", "0.5234861", "0.5225233", "0.52100396", "0.5202159", "0.5195783", "0.51955825", "0.5146943", "0.5140961", "0.51350176", "0.5131796", "0.5117738", "0.51175433", "0.51151025", "0.5112872", "0.5107152", "0.5102491", "0.5096728", "0.5086882", "0.5077439", "0.5077439", "0.5077439", "0.5072294", "0.5070025", "0.5068334", "0.505762", "0.5044744", "0.50445646", "0.504175", "0.5036367", "0.50301766", "0.50104123", "0.50104123", "0.500688", "0.5002209", "0.49882594", "0.49841607", "0.49754545", "0.49699503", "0.49607843", "0.4956599", "0.49481598", "0.4937959", "0.49379432", "0.49339724", "0.4927647", "0.49265113", "0.49199107", "0.49188247", "0.49183214", "0.49132138", "0.49111778", "0.49081817", "0.490794", "0.49067894", "0.4901302", "0.48986232", "0.48979115", "0.48877612", "0.4885978", "0.48846278", "0.4884519", "0.4883612", "0.4883461", "0.488036" ]
0.67978966
0
Authenticates user via api key The api key should be handed by request header "xaccesstoken" or get/post parameter "api_key" if the authentication fails, renders error message
def authenticate! api_key = request.headers["x-access-token"] || params.delete(:api_key) if api_key.nil? self.current_advertiser = self.current_publisher = nil else self.current_advertiser = Trac::Advertiser.find_by(advertiser_api_key: api_key) logger.info "Advertiser [#{current_advertiser.name}] logged in." if current_advertiser self.current_publisher = current_advertiser.nil? ? Trac::Publisher.find_by(publisher_api_key: api_key) : nil logger.info "Publisher [#{current_publisher.name}] logged in." if current_publisher end render status: :unauthorized, json: { message: "Wrong API token!" } if current_advertiser.nil? && current_publisher.nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def api_authenticate\n unless params[:api_key] == \"oz\" || api_user\n render :json => {:error => \"API key not found\"}, :status => :unauthorized\n end\n end", "def authenticate\n @apikey = request.headers[:apikey]\n if @apikey==nil || @apikey!= APIKEY\n json_response={\n error: 'autorization error'\n }\n respond_with json_response, location: nil\n end\n end", "def authenticate_api_key!\n return if current_auth_api_key.present?\n\n render nothing: true, status: :unauthorized\n end", "def api_auth \n # output the APIkey from the header\n # puts request.headers[\"X-APIkey\"]; \n user = User.find_by(email: params[:email].downcase)\n if user && user.authenticate(params[:password])\n render json: { auth_token: encodeJWT(user) }\n else\n render json: { error: 'Invalid username or password' }, status: :unauthorized\n end\n end", "def authenticate_with_api_key\n if @current_user.nil? && request.headers['Authorization'].nil?\n @current_user = authenticate_with_http_token(&method(:authenticator))\n end\n end", "def authenticate\n api_token = request.headers[\"ApiToken\"]\n apiUser = ApiUser.where(api_token: api_token).first\n\n if !apiUser.nil?\n user =\n AuthenticateUser.new(auth_params[:email], auth_params[:password],apiUser.id, true).call\n\n render json: user\n else\n json_response({ message: Message.invalid_api_token }, 422)\n end \n end", "def authenticate_knox_api_key!\n authenticate_for ApiKey\n end", "def authenticate_with_api_key!\n if @current_user.nil? && !request.headers['Authorization'].nil?\n @current_user = authenticate_or_request_with_http_token(&method(:authenticator))\n end\n end", "def api_auth\n # output the APIkey from the header\n # puts request.headers[\"X-APIkey\"];\n creator = Creator.find_by(creator: request.headers[:creator])\n if creator && creator.authenticate(request.headers[:password])\n render json: { auth_token: encodeJWT(creator), id: creator.id}\n else\n render json: { error: 'Invalid username or password' }, status: :unauthorized\n end\n end", "def check_api_key_auth\n User.current = User.find_by_api_key(params[:key])\n unless User.current\n render :text => \"Not Authorized\", :status => 403\n return\n end\n end", "def authenticate_user\n @current_user = User.find_by_api_key(params[:api_key])\n end", "def authenticate_with_api_key!\n \t\t@current_bearer = authenticate_or_request_with_http_token &method(:authenticator)\n \tend", "def authenticate_with_api_key(api_key)\n self.api_key == api_key\n end", "def authenticate!\n\t\t@current_user = AuthorizeApiRequest.call(request.headers).result\n\t\t# If unauthorized return an error to the front end\n\t\trender json: {error: 'Not Authorized'}, status: 401 unless @current_user\n\tend", "def authenticate\n token = params['api_key']\n return if token.nil?\n\n @visitor = Visitor.find_by_api_key(token)\n return if @visitor.present?\n\n response_json = { status: Visitor::INVALID_API_KEY }\n respond_with :api, :v1, response_json, status: :unauthorized\n end", "def authenticate_with_api_key\n\t @current_bearer = authenticate_with_http_token &method(:authenticator)\n\t end", "def authenticate_by_key\n @user = User.find_by_api_key(params[:key])\n if (@user.nil?)\n render :text => \"Unable to authenticate using key \" + params[:key]\n end\n logger.debug \"User by token : \" + @user.login unless @user.nil?\n # now we can use all the candy from Redmine\n User.current = @user\n end", "def authenticate_request\n auth_header_token = request.headers[\"Authorization\"]\n @current_user = AuthorizeApiRequest.new(auth_header_token).call\n render json: { error: \"Not Authorized\" }, status: 401 unless @current_user\n end", "def api_key\r\n user_application = UserApplication.find_by_api_key(params[:api_key])\r\n unless user_application\r\n error_message = ErrorMessage.new('401','Applikationen saknar giltig api-nyckel',\r\n \"Serverfel. Kontakta utvecklare.\")\r\n render json: error_message, status: :unauthorized\r\n end\r\n end", "def api_auth\n api_response(403, \"Invalid Authorization header\") unless api_user\n end", "def getkey\n user = User.try_to_login(params[:username], params[:password])\n if user.nil?\n render :text => \"Not Authorized\", :status => 403\n return\n elsif user.new_record?\n render :text => \"Not Authorized\", :status => 403\n return\n else \n render :text => user.api_key\n end\n end", "def verify_access_with_api_key\n api_key = request.headers[\"HTTP_API_KEY\"] || params[:api_key]\n andrew_id = request.headers[\"HTTP_ANDREW_ID\"] || params[:andrew_id]\n if (api_key.nil? || andrew_id.nil?)\n render json: {error: \"Error, bad request\"}, status: 400\n elsif !(key_matches?(api_key, andrew_id))\n render json: {error: \"Error, unauthorized user or API key\"}, status: 401\n # Inactive users are not allowed to use their keys for any reason.\n elsif !@cur_user.active\n render json: {error: \"Error, the account associated with this andrew ID has been suspended\"}, status: 401\n end\n end", "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'Not Authorized' }, status: 401 unless @current_user\n end", "def require_api_user_or_token\n authenticate_user\n rescue AuthenticationError => e\n api_log_error(\"AuthenticationError: #{e.message}\")\n response.headers[\"Content-Type\"] = \"application/json\"\n error_message = ErrorSerializer.new(:unauthorized, e).serialize(true).to_json\n render :status => 401, :json => error_message\n log_api_response\n end", "def authenticate_api!\n Rails.logger.info(\"Enter Authenticate Api\")\n \n # just to test we are using HTTP_HOST in test mode as HTTP_ORIGIN cant be set\n Rails.env == \"test\" ? origin = request.env['HTTP_HOST'] : origin = request.env['HTTP_ORIGIN']\n\n if !params[\"token\"].blank? and origin.blank? # API Access\n\n account_id = AccountsCache.access_token(params[\"token\"])\n\n raise et(\"application.unauthorized\") if account_id.blank?\n \n # set account_id in params\n if params[:controller] == \"accounts\" and current_account\n params[:id] = current_account._id.to_s if params[:id].blank?\n else\n params[:account_id] = current_account._id.to_s if params[:account_id].blank?\n end\n\n # set the request type\n params[:request_type] = AppConstants.request_type_api\n\n # mark already authenticated\n set_authenticated\n\n # make api request synchronous as of now\n make_sync_request\n end\n rescue => e \n Rails.logger.error(\"**** ERROR **** #{er(e)}\")\n head :unauthorized\n end", "def show_api_key\n if @current_user.api_key != nil\n # If the user already has an api key, return it\n render json: { api_key: @current_user.api_key }, status: :ok\n else\n head :not_found\n end\n end", "def get_api_key\n @api = Hash.new\n if authenticate!\n if current_user.api_key.nil?\n current_user.generate_new_api_key!\n end\n @api = {:api_key => current_user.api_key}\n else\n @api = {:error => \"The combination of login and password is invalid.\"}\n end\n respond_to do |format|\n format.json do\n render :json => @api.as_json, :callback => params[:jsoncallback]\n end\n end\n end", "def authenticate_by_api_key_in_params\n if api_key = params[:api_key]\n User.where(:api_key => api_key).first\n end\n end", "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'Not Authorized' }, status: 401 unless @current_user\n end", "def authenticate_with_api_key(user, key)\n user && OpenSSL::Digest::SHA256.new(\"#{user.username}:#{user.api_secret}\") == key\n end", "def authenticate_user_from_token!\n\t\t@api_token = ApiToken.find_by_token(params[:token])\n @user = @api_token.try(:user)\n if @user.nil?\n render json: { error: 'Not authorized' }, status: 401\n end\n end", "def verify_key\n @user = get_api_user\n if @user.nil?\n render :nothing => true, :status => 503\n else\n render :layout => false\n end\n end", "def api_auth\n creator = Creator.find_by(username: request.headers[:username])\n if creator && creator.authenticate(request.headers[:password])\n render json: { auth_token: encodeJWT(creator) }\n else\n render json: { error: 'Invalid username or password' }, status: :unauthorized\n end\n end", "def authenticate_by_api_key_in_http_auth\n authenticate_or_request_with_http_basic do |api_key, _|\n return User.where(:api_key => api_key).first\n end\n nil\n end", "def autenticate_user\n auth_token = request.headers[:HTTP_AUTH_TOKEN] #auth_token in header\n return render_message ({status:ERR_STATUS, responseMessage: \"Sorry! You are not an authenticated user.\",responseCode: ERROR}) unless auth_token\n @user = User.find_by(auth_token: auth_token)\n unless @user\n return render_message({status:ERR_STATUS,responseMessage: UNAUTHORIZED_MESSAGE,responseCode: UNAUTHORIZED})\n end\n end", "def authenticate_user_from_token!\n # user_id = params[:user_id].presence\n # user = user_id && User.find(user_id)\n # api_token = params[:api_token] || env['HTTP_API_TOKEN']\n # if user && Devise.secure_compare(user.api_token, api_token)\n # sign_in user, store: false and return\n # end\n\n # render_error({ :error => \"Please sign in first.\" })\n end", "def authenticate\n api_key = parse_auth_token(request.headers['HTTP_AUTHORIZATION'])\n return user_not_authorized if api_key.nil?\n @real_user = User.find_by(api_key: parse_auth_token(request.headers['HTTP_AUTHORIZATION']))\n user_not_authorized if @real_user.nil?\n end", "def authenticate_with_basic_auth\n name, token = ActionController::HttpAuthentication::Basic.user_name_and_password(request)\n @api_client = ApiClient.find_by(name: name)\n\n render(json: { errors: [{ detail: \"Access Denied\" }] }, status: 401) unless valid_key(token)\n end", "def authenticate!\n response = post(USERS_URL, { \"email\" => @username, \"password\" => @password})\n raise 'Could not authenticate, are you sure you have the right credentials?' if !response['secretApiKey']\n\n @api_key = response['secretApiKey']\n end", "def current_api_user\n unless current_api_user?\n render json: { errors: \"Not authenticated\" },\n status: :unauthorized\n end\n end", "def authenticate_user_from_token\n unless authenticate_with_http_token { |token, options| User.find_by(api_token: token) }\n render json: { error: 'Bad Token'}, status: 401\n end\n end", "def authorize_api_key\n # If it's blank, send a 403\n if params[:api_key].blank?\n head :forbidden\n return\n end\n\n # Search for the key\n key = ApiKey.where(key: params[:api_key])\n\n # If there's no key, it's not authorized, 403 it\n if key.blank?\n head :forbidden\n return\n end\n\n # Update the key with the current time so we know it's being used\n key.first.update last_used: DateTime.now\n session[:current_key_id] = key.first.id\n end", "def authenticate_api!\n find_case\n return true if @case&.public? || current_user\n\n render json: { reason: 'Unauthorized!' },\n status: :unauthorized\n end", "def authenticate\n # return if unauthorized?\n\n # render json: {\n # message: I18n.t('api.v1.error_messages.unauthorized')\n # }, status: :unauthorized\n end", "def authenticate\n \n authenticate_token || render_unauthorized\n end", "def authenicate_contact_api_key_role\n unless(admin_signed_in?)\n api_key_roles = request.headers['X-Api-Roles'].to_s.split(\",\")\n unless(api_key_roles.include?(\"api-umbrella-contact-form\"))\n render(:json => { :error => \"You need to sign in or sign up before continuing.\" }, :status => :unauthorized)\n return false\n end\n end\n end", "def authenticate_request!\n\t\t# unless is if in reverse. If user_id_in_token == false then render error\n\t unless user_id_in_token?\n\t render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n\t return\n\t end\n\t @current_user = User.find(auth_token[:user_id])\n\trescue JWT::VerificationError, JWT::DecodeError\n\t render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n\tend", "def authenticate!\n error!(\"401 Unauthorized\", 401) unless check_auth_token \n end", "def authenticate_token\n render json: {message: \"Unauthorized\"}, status: 401 unless decode_token(bearer_token)\n end", "def api_authorize\n api_authenticate\n\n unless api_user.api_secret && api_user.api_secret == params[:api_secret]\n render :json => {:error => \"API secret mismatch\"}, :status => :unauthorized\n end\n end", "def authenticate\n #render :text => params[:action]\n if (params[:controller] != \"api/sessions\")\n if (params[:controller] == \"api/users\" && params[:action] == \"create\")\n return\n end\n user = User.find_by(token: params[:token])\n if !user || user.valid_up < DateTime.now\n render json: '{\"error\":\"Unauthorized\"}', status: 401\n end\n end\n if (params[:controller] == \"api/sessions\" && params[:action] == \"chekToken\")\n user = User.find_by(token: params[:token])\n if !user || user.valid_up < DateTime.now\n render json: '{\"error\":\"Unauthorized\"}', status: 401\n end\n end\n #\"controller\":\"users\",\"action\":\"show\",\"id\":\"login\" si se va a registrar dejar pasar\n #@product = '[{\"mytoken\":\"'+params[:token]+'\"}]'\n # if !User.find_by(token: params[:token])\n # #render json: '[{\"error\":\"Unauthorized\"}]', status: 401\n # end\n end", "def authenticate username, api_key, account: Conjur.configuration.account\n account ||= Conjur.configuration.account\n if Conjur.log\n Conjur.log << \"Authenticating #{username} to account #{account}\\n\"\n end\n JSON.parse url_for(:authn_authenticate, account, username).post(api_key, content_type: 'text/plain')\n end", "def api_login\n employee = Employee.find_by(IDnum: params[:IDnum])\n if employee && employee.authenticate(params[:password])\n \tif employee.status = \"Active\"\n \t\ttoken = employee.generate_api_token\n \tdistribute_api_token(employee.IDnum, token)\n \trender(json: {\"api_token\" => employee.api_token}.to_json, status: 201)\n \telse\n \t\tmsg = { :status => \"ERROR\", :message => \"Access Denied: No longer active employee\" }\n \trender :json => msg, status: :forbidden\n \tend\n else\n msg = { :status => \"ERROR\", :message => \"Invalid ID number and password combination\" }\n render :json => msg, status: :forbidden\n end\n end", "def authenticate_manual \n api_key = request.headers['X-Api-Key']\n @app = App.where(api_key: api_key).first if api_key\n\n unless @app\n head status: :unauthorized\n return false\n end\n end", "def create\n user = User.where(email: params[:email]).first\n\n if user && user.authenticate(params[:password])\n api_key = user.find_api_key(params[:scope])\n\n if !api_key.is_locked\n api_key.last_access = Time.now\n\n if !api_key.access_token || api_key.is_expired?\n puts \"non existant or expired key, generating\"\n api_key.set_expiry_date\n api_key.generate_access_token\n end\n\n api_key.save\n\n render json: api_key, status: 201\n else\n render json: { errors: 'Your account has been locked.' }, status: 401\n end\n\n else\n render json: { errors: 'Could not authenticate properly.' }, status: 401\n end\n end", "def require_api_key\n api_key = params[:api_key]\n return if api_key == ENV['ADMIN_API_KEY'] && !ENV['ADMIN_API_KEY'].nil?\n response = {\n status: 'error',\n version: 1,\n error: 'Invalid API key'\n }\n respond_with response, status: :forbidden\n end", "def edit\n @user = User.find(current_user.id)\n if @user.api.key.nil?\n @user.api.key = SecureRandom.hex\n [email protected]\n redirect_to @user\n flash[:success] = 'New api key' [email protected] + ' was created'\n else\n render @user\n flash.now[:danger] = 'Api key could not be saved'\n end\n else\n @user.api.key = nil\n @user.api.save\n redirect_to user_path\n flash[:success] = 'Api key was removed'\n end\n end", "def verify_key\n\t\t\tunless (Happyfunrun::app_id==params[:app_id] and Happyfunrun::api_key==params[:api_key])\n\t\t\t\trender :json=>{:status=>'300', :error=>'Access Denied'}\n\t\t\t\treturn\n\t\t\tend\n\t\tend", "def authenticate_request\n if auth_token_expired?\n fail AuthenticationTimeoutError\n elsif !@current_user\n render json: { error: \"401\" }, status: :unauthorized\n end\n end", "def get_api_key\r\n\t\t#we search for the keys if existed\r\n\t\t#binding.pry\r\n\t\tif request.headers[\"XAPIKEY\"]\r\n\t if request.headers[\"ENVAPIKEY\"] && request.headers[\"ENVAPIKEY\"] == APP_CONFIG['API_Key'] \r\n\t \tapi_key =request.headers[\"XAPIKEY\"]\r\n\t \tenv_api_key = request.headers[\"ENVAPIKEY\"]\r\n\t \tif api_key.empty?\r\n\t\t \treset_session #kill session ite hacker attemted\r\n\t\t \ttoken_error\r\n\t \telse\r\n\t\t \t@user=User.where({authentication_token: api_key}).first\r\n\t\t\t if @user.nil?\r\n\t\t\t \treset_session #kill session ite hacker attemted\r\n\t\t\t \tlogin_token_error\r\n\t\t\t else\r\n\t\t\t \tsession[:user] = @user\r\n\t\t\t \tparams[:user] = @user\r\n\t\t\t \tparams[:env_api_key] = env_api_key\r\n\t\t\t \tparams[:api_key] = api_key #we on development so we do not need make sure that header has X-API-KEY in requests\r\n\t\t\t end\r\n\t \tend\r\n \telse \r\n\t\t \treset_session #kill session ite hacker attemted\r\n\t\t \ttoken_error\r\n \tend\r\n else\r\n \ttoken_error\r\n end\r\n\tend", "def authenticate_with_api_token!\n unless Project.where(id: params[:project_id], api_token: params[:api_token]).exists?\n render_error_with_message(t('controllers.api.v1.groups.invalid_api_token'), :unauthorized)\n end\n end", "def developer_key_authentication\n authenticate_or_request_with_http_token do |token|\n Api.exists?(key: token)\n end\n end", "def tokenizing\n authenticate_api || unauthorized_api\n end", "def authenticate\n authenticate_token || render_unauthorized\n end", "def optional_api_user_or_token\n authenticate_user\n rescue AuthenticationError => e\n api_log_warn(\"AuthenticationError: #{e.message} (on #{request.method} that doesn't require it... ignoring)\")\n end", "def authorize!\n api_key = ApiKey.find_by_access_token(params[:access_token])\n head :unauthorized unless api_key\n return false\n end", "def authorize\n unless params[:token] == Rails.configuration.api_token\n return render(plain: \"Unauthorized API token\\n\", status: :unauthorized)\n end\n end", "def authenticate!\n # if the authentication header is an acceptible value\n if @env['HTTP_X_MY_API'] == 'foobar'\n user = { :id => 1, :name => \"some user\" }\n # warden doesn't care what the user is, so long as it's not nil.\n success! user, \"success\"\n end\n end", "def authenticate_api_token\n if request.headers[\"Authorization\"].present?\n \n auth_header = request.headers['Authorization'].split(' ').last\n \n #try to get the data from jwt token\n @payload = decode auth_header\n \n #couldnt get data for whatever reason\n if !@payload\n render json: { error: \"Problem med autentiseringssträngen. Försök att logga in igen.\" }, status: :bad_request \n #success!\n else\n @payload\n end\n #no token was sent with header \n else\n render json: { error: \"En autentiseringssträng krävs.\"}, status: :forbidden # The header isn´t present\n end\n end", "def api_authenticate\n if request.headers[\"Authorization\"].present?\n # Take the last part in The header (ignore Bearer)\n auth_header = request.headers['Authorization'].split(' ').last\n # Are we feeling alright!?\n @token_payload = decodeJWT auth_header.strip\n if !@token_payload\n render json: { error: 'The provided token wasn´t correct' }, status: :bad_request\n end\n else\n render json: { error: 'Need to include the Authorization header' }, status: :forbidden # The header isn´t present\n end\n end", "def authenticate_user\n authenticate_or_request_with_http_token do |token, options|\n @user = User.find_by_auth_key(token)\n head :unauthorized unless @user\n return\n end\n end", "def api_authenticate\n if request.headers[\"Authorization\"].present?\n auth_header = request.headers['Authorization'].split(' ').last\n @token_payload = decodeJWT auth_header.strip\n if !@token_payload\n render json: { error: 'The provided token wasn´t correct' }, status: :bad_request \n end\n else\n render json: { error: 'Need to include the Authorization header' }, status: :forbidden # The header isn´t present\n end\n end", "def authenticate\n authenticate_token || render_unauthorized\n end", "def api_token\n return @api_token if @api_token\n\n response = http.post('/login') do |req|\n req.body = { apikey: API_KEY }.to_json\n req.headers['Content-Type'] = 'application/json'\n req.headers['Accept'] = 'application/json'\n end\n\n raise \"#{response.status}: API Key is invalid.\" unless response.success?\n\n @api_token = JSON.parse(response.body)['token']\n end", "def authenticate_client\r\n client_id = request.headers['client-id']\r\n client_secret = request.headers['client-secret']\r\n\r\n unless client_id == Rails.application.secrets.api_key && client_secret == Rails.application.secrets.api_secret\r\n render json: ErrorResponse.new(\r\n code: 401, message: 'Unauthorized Request'\r\n ), adapter: :json, status: :unauthorized\r\n nil\r\n end\r\n\r\n end", "def token\n\n authenticate_with_http_basic do |email, password|\n user = User.find_by(email: email)\n if user && user.authenticate(password) \n render json: { token: user.api_token }\n else\n render json: { error: 'Incorrect credentials' }, status: 401\n end\n\n end\n end", "def show\n if User.find_by_authentication_token(params[:Token])\n @user = User.find_by_authentication_token(params[:Token])\n batsd_log_success\n elsif !params[:Token]\n batsd_log_error(:type => :auth)\n respond_error(\"No token supplied.\")\n else\n batsd_log_error(:type => :auth)\n respond_error(\"Invalid API key.\")\n end \n end", "def api_key\n type = params[:type].to_s\n id = params[:id].to_s\n value = params[:value].to_s\n @user = get_session_user!\n key = ApiKey.safe_find(id)\n if !key\n fail :runtime_no_match_id.l(type: :api_key, id: id)\n elsif key.user != @user\n fail :runtime_not_owner_id.l(type: :api_key, id: id)\n else\n case type\n when \"activate\"\n key.verify!\n render(text: \"\")\n when \"edit\"\n if value.blank?\n fail :runtime_api_key_notes_cannot_be_blank.l\n else\n key.update_attribute(:notes, value.strip_squeeze)\n end\n render(text: key.notes)\n else\n fail \"Invalid type for api_key: #{type.inspect}\"\n end\n end\n end", "def verify_api_key\n api_key = request.headers['HB-APIKey']\n if (api_key.nil?)\n api_key = params[:api_key]\n if api_key.nil?\n render :status => 403, :json => {:message => \"Api key missing\"}\n return\n end\n end\n \n api_key_object = ApiKey.find_by_key(api_key)\n if api_key_object.nil?\n render :status => 403, :json => {:message => 'Invalid API Key'}\n return\n end\n end", "def authenticate\n #Hace el llamado de la clase AuthenticaUser, manda los parametros de :username y :password\n #Realiza el metodo call para obtener el Token del user_id\n #Arroja el token como Json_response\n auth_token = AuthenticateUser.new(auth_params[:username], auth_params[:password]).call \n json_response(auth_token: auth_token)\n end", "def require_api_user_or_token\n case auth_mechanism\n when :system\n authenticate_with_system_token(request.headers[HttpHeaders::MIQ_TOKEN])\n when :token\n authenticate_with_user_token(request.headers[HttpHeaders::AUTH_TOKEN])\n when :ui_session\n raise AuthenticationError unless valid_ui_session?\n auth_user(session[:userid])\n when :jwt\n authenticate_with_jwt(jwt_token)\n when :basic, :basic_async, nil\n success = authenticate_with_http_basic do |u, p|\n begin\n timeout = ::Settings.api.authentication_timeout.to_i_with_method\n\n if oidc_configuration?\n # Basic auth, user/password but configured against OpenIDC.\n # Let's authenticate as such and get a JWT for that user.\n #\n user_jwt = get_jwt_token(u, p)\n token_info = validate_jwt_token(user_jwt)\n user_data, membership = user_details_from_jwt(token_info)\n define_jwt_request_headers(user_data, membership)\n end\n user = User.authenticate(u, p, request, :require_user => true, :timeout => timeout)\n auth_user(user.userid)\n rescue MiqException::MiqEVMLoginError => e\n raise AuthenticationError, e.message\n end\n end\n raise AuthenticationError unless success\n end\n log_api_auth\n rescue AuthenticationError => e\n api_log_error(\"AuthenticationError: #{e.message}\")\n response.headers[\"Content-Type\"] = \"application/json\"\n case auth_mechanism\n when :jwt, :system, :token, :ui_session, :basic_async\n render :status => 401, :json => ErrorSerializer.new(:unauthorized, e).serialize(true).to_json\n when :basic, nil\n request_http_basic_authentication(\"Application\", ErrorSerializer.new(:unauthorized, e).serialize(true).to_json)\n end\n log_api_response\n end", "def authenticate\n \n authenticate_or_request_with_http_token do |token|\n begin\n decoded = decode(token)\n @current_user = User.find_by(id: decoded[0][\"user_id\"]) \n \n rescue JWT::DecodeError\n render json: {authorized: false }, status: 401 \n end\n end \n end", "def authenticate!\n user_id = get_user_id_from_token\n if user_id\n @current_user = User.find(user_id)\n else\n render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n end\n rescue JWT::ExpiredSignature\n render json: { errors: ['Authentication Timeout'] }, status: 419\n rescue JWT::VerificationError, JWT::DecodeError\n render json: { errors: ['Not Authenticated'] }, status: :unauthorized\n end", "def set_current_user\n users = User.where(api_key: api_key_param)\n render json: {error: \"Wrong credentials\"}, status: 403 unless users.count > 0\n @user = users.first\n end", "def authenticate(admin: false)\n if admin\n @key = api_keys(:admin_api_key).key\n else\n @key = api_keys(:default_api_key).key\n end\n\n request.headers['Authorization'] = \"Token token=#{@key}\"\n end", "def authenticate\n raise 'Sierra API key not present' unless ENV['SIERRA_API_KEY']\n raise 'Sierra API secret not present' unless ENV['SIERRA_API_SECRET']\n\n if authentication_expired?\n credentials = Base64.strict_encode64(ENV['SIERRA_API_KEY'] + ':' + ENV['SIERRA_API_SECRET'])\n # throw error if api key or secret key is missing.\n\n response = Faraday.post(API_BASE + '/token') do |req|\n req.headers['Host'] = 'catalog-lib.dartmouth.edu'\n req.headers['Authorization'] = \"Basic #{credentials}\"\n req.headers['Content-Type'] = 'application/x-www-form-urlencoded'\n req.body { 'grant_type=client_credentials' }\n end\n body = JSON.parse(response.body)\n\n # if response is sucessful\n @access_token = body['access_token']\n @expires_in = Time.now + (body['expires_in'] - 10)\n # return true\n # else return false\n\n end\n end", "def authenticate\n logger.debug { 'ApiClient#authenticate' }\n auth_api = TriglavClient::AuthApi.new(@api_client)\n credential = TriglavClient::Credential.new(\n username: username, password: password, authenticator: authenticator\n )\n handle_auth_error do\n logger.debug { 'TriglavClient::AuthApi' }\n result = auth_api.create_token(credential)\n token = {access_token: result.access_token}\n update_current_token(token)\n end\n end", "def validate_api_filter\n if params[:token].nil?\n token = params[params.keys.reject { |k| [:action, :controller].include?(k) }.first][:token]\n unless token.nil?\n params[:token] = token\n params[params.keys.reject { |k| [:action, :controller].include?(k) }.first].delete(:token)\n end\n end\n @user = User.api_key_authentication(params[:token]) if params[:token]\n unless @user\n render :xml => \"<xml><error><response>Invalid API Key</response></error></xml>\", :status => :forbidden\n false\n end\n end", "def authenticate_user!\n unless current_user\n render :json => {'error' => 'authentication error'}, :status => 401\n end\n end", "def authenticate_token!\n return render_error(\"Problem with Authentication Token\",401, 401) unless Token.find_by(access_token: params[:access_token])\n end", "def authenticate\n auth_token =\n AuthenticateUser.new(auth_params[:email], auth_params[:password]).call\n # kindly refactor and add more keys to the response object when needed\n response = { \n status: Message.success,\n data: {\n token: auth_token\n } \n }\n json_response(response, 200)\n end", "def auth(key)\n\t\t#TODO\n\t\t#return response\n\t\tstatus 201\n\tend", "def find_user_by_api_key\n unless Rails.env.test?\n @user = User.find_by_api_key(params[:key])\n unless @user || user_signed_in?\n redirect_to root_path, notice: \"Please append your api key to your request\"\n end\n end\n end", "def authenticate_user!\n # check for API/signed requests\n if request.headers.env[\"HTTP_AUTHORIZATION\"] || request.headers.env[\"Authorization\"] then\n agent = Agent.where(:access_key => ApiAuth.access_id(request)).first\n begin\n if not(agent and ApiAuth.authentic?(request, agent.secret_key)) then\n return render :text => Bixby::JsonResponse.new(\"fail\", \"authentication failed\", nil, 401).to_json, :status => 401\n end\n rescue ApiAuth::ApiAuthError => ex\n return render :text => Bixby::JsonResponse.new(\"fail\", ex.message, nil, 401).to_json, :status => 401\n end\n @current_user = agent # TODO hrm.. hack much?\n return false\n end\n\n # authenticate a request from a browser session\n super\n end", "def api_login\n creator = Creator.find_by(name: request.headers['name'])\n if creator && creator.authenticate(request.headers['password'])\n encode = encodeJWT(creator)\n selected_format({jwt: encode,creator_id: creator.id,name: creator.name,submits:creator.submits},:ok)\n else\n selected_format({ error: 'Invalid username or password' },:unauthorized)\n end\n end", "def authenticate_user\n authenticate_or_request_with_http_token do |token, options|\n @user = User.find_by_auth_key(token)\n head :unauthorized unless @user\n return\n end\n end", "def verify_api_key\n # Confirm that it's a json request. This is irrelevant otherwise.\n if request.format && request.format.symbol && request.format.symbol == :json\n # We must have a key, either way. If no key, pass forbidden response.\n if params[:key].nil? && (request.env['HTTP_REFERER'] =~ Regexp.new(request.env['HTTP_HOST'])).nil?\n render :json => { :errors => \"Invalid API key.\" }, :status => :forbidden\n else\n if (request.env['HTTP_REFERER'] =~ Regexp.new(request.env['HTTP_HOST'])).nil?\n # Find by key\n @key = ApiKey.find_by_key(params[:key])\n if @key.nil?\n # Throw error if no key found.\n render :json => { :errors => \"Invalid API key.\" }, :status => :forbidden\n end\n end\n end\n end\n end", "def authenticate_request\n begin\n uid = JWT.decode(request.headers['Authorization'], Rails.application.secrets.secret_key_base)[0]['uid']\n @current_user = User.find_by(uid: uid)\n rescue JWT::DecodeError\n render json: 'authentication failed', status: 401\n end\n end", "def authenticate_user!\n return if current_user\n render json: json_message(errors: 'Acceso denegado. Por favor ingresa.'), status: 401\n end", "def authenticate_admin\n user = User.where(\"email = ? AND password = ?\", params[:user_email], params[:user_password]).first\n if user.api_key != 'RF70F4yyqXEzdMgklqKQLAtt'\n render json:{'error': 'You are credntials are authorized to access user'}, status: :unprocessable_entity\n end\n rescue\n render json:{'error': 'You are not admin to access user'}, status: :unprocessable_entity\n end" ]
[ "0.7944754", "0.7858201", "0.7823399", "0.76797473", "0.74314576", "0.7402341", "0.73600787", "0.7352987", "0.73324823", "0.7315078", "0.72946626", "0.7286719", "0.72200686", "0.72186196", "0.7139922", "0.7112355", "0.710506", "0.7060924", "0.70552266", "0.6992541", "0.6960451", "0.6959379", "0.69390804", "0.6939036", "0.6913134", "0.69117993", "0.69100845", "0.68920267", "0.68606347", "0.6860282", "0.68247867", "0.6783689", "0.6783448", "0.67832017", "0.66975516", "0.66923404", "0.66578525", "0.6650643", "0.6643961", "0.6621846", "0.66002387", "0.6573799", "0.6560104", "0.6553627", "0.6527506", "0.6517237", "0.651173", "0.6472152", "0.64592505", "0.64515984", "0.6451003", "0.6440914", "0.64231753", "0.6418348", "0.63979197", "0.63939923", "0.63899153", "0.6372865", "0.636763", "0.63618565", "0.6358314", "0.6354019", "0.6353331", "0.63495845", "0.6347438", "0.6344404", "0.6343857", "0.63307166", "0.63302684", "0.6325205", "0.6322504", "0.63211906", "0.6318461", "0.6309068", "0.63030314", "0.6300459", "0.6297408", "0.62858075", "0.6266309", "0.6261978", "0.62557155", "0.62530375", "0.62436223", "0.62316936", "0.6215986", "0.62097746", "0.62066764", "0.6205893", "0.6190529", "0.61811", "0.6179678", "0.61741567", "0.61609447", "0.61564714", "0.6152328", "0.6149602", "0.6139238", "0.6126328", "0.61244076", "0.6121754" ]
0.6911132
26
Returns the resource from the created instance variable
def resource instance_variable_get(:"@#{resource_name}") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_resource\n\t\t\t\tinstance_variable_get(\"@#{resource_name}\")\n\t\t\tend", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def get_resource\n instance_variable_get(\"@#{resource_name}\")\n end", "def resource\n @resource ||= begin\n resource_constant.new(attributes)\n end\n end", "def build_resource\n get_resource_ivar || begin\n set_resource_ivar class_name.new\n end\n end", "def get_resource_ivar #:nodoc:\n instance_variable_get(\"@#{resource_instance_name}\")\n end", "def resource\n @resource ||= resource_set.createResource(uri)\n end", "def resource\n @resource ||= resource_klass.new object\n end", "def resource\n @resource ||= Resource.new(self)\n end", "def build_resource\n get_resource_ivar || set_resource_ivar(built_resource)\n end", "def get_resource_ivar #:nodoc:\n if instance_variable_defined?(:\"@#{resource_instance_name}\")\n instance_variable_get(\"@#{resource_instance_name}\")\n else\n nil\n end\n end", "def resource\n self.class.resource\n end", "def resource\n klass, param = resource_class\n klass&.find(params[param.to_sym])\n end", "def get!(resource)\n resource.instance_variable_get(instance_variable_name)\n end", "def get_resource_ivar # rubocop:disable Naming/AccessorMethodName\n instance_variable_get resource_ivar\n end", "def get!(resource)\n resource.instance_variable_get(instance_variable_name)\n end", "def resource_ivar\n \"@#{class_name.model_name.singular}\"\n end", "def resource\n return @resource\n end", "def resource\n return @resource\n end", "def resource\n return @resource\n end", "def resource\n return @resource\n end", "def resource\n return @resource\n end", "def resource\n return @resource\n end", "def resource\n resource_klass.new(attributes.symbolize_keys.merge(new_record: false))\n end", "def resource\n @resource ||= Resource.new(uri, graph: graph)\n end", "def convert!\n @resource ||= resource\n end", "def read_resource(resource)\n resource\n end", "def read_resource(resource)\n resource\n end", "def resource\n @resource\n end", "def resource\n @resource\n end", "def resource\n return Object unless resource_type\n return resource_type.constantize unless resource_id\n return _resource\n end", "def resource_model\n resource = \"#{resource_param}\".constantize\n end", "def resource(path)\n Resource.new(self, path)\n end", "def resource\n get_resource_ivar || set_resource_ivar(end_of_association_chain.send(method_for_find, params[:id]))\n end", "def instantiate\n resource.new(data)\n end", "def build_resource(hash = {})\n self.resource = resource_class.new(hash)\n end", "def get_resource resource_uuid\n return resource_uuid if resource_uuid.is_a?(Resource)\n \n tmp = @resources.find{|res|res.uuid == resource_uuid}\n \n raise \"unknown resource with uuid #{resource_uuid}\" unless tmp\n \n tmp\n end", "def set_resource\n instance_variable_set(\"@#{resource_name}\", load_resource)\n end", "def get_resource(id)\n raise 'To be implemented in child classes'\n end", "def retrieve\n fail \"Provider #{provider.class.name} is not functional on this host\" if self.provider.is_a?(Puppet::Provider) and ! provider.class.suitable?\n\n result = Puppet::Resource.new(type, title)\n\n # Provide the name, so we know we'll always refer to a real thing\n result[:name] = self[:name] unless self[:name] == title\n\n if ensure_prop = property(:ensure) or (self.class.validattr?(:ensure) and ensure_prop = newattr(:ensure))\n result[:ensure] = ensure_state = ensure_prop.retrieve\n else\n ensure_state = nil\n end\n\n properties.each do |property|\n next if property.name == :ensure\n if ensure_state == :absent\n result[property] = :absent\n else\n result[property] = property.retrieve\n end\n end\n\n result\n end", "def resource\n @resource ||= begin\n r = self.singleton_class.resource_class.new(digital_object ? self.class.rdf_subject.call(self) : nil)\n r.singleton_class.properties = self.class.properties\n r.singleton_class.properties.keys.each do |property|\n r.singleton_class.send(:register_property, property)\n end\n r.datastream = self\n r.singleton_class.accepts_nested_attributes_for(*nested_attributes_options.keys) unless nested_attributes_options.blank?\n r << deserialize\n r\n end\n end", "def get_resource_ivar\n instance_variable_get(\"@#{self.controller_name.singularize}\")\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def get_resource(name)\n resource = Resource.new\n resource.name = name\n resource.get_resource\n yield resource.resource if block_given?\n resource\n end", "def resource\n @resource\n end", "def new_resource_content\n resource_query = model_class.new\n\n instance_variable_set(\"@#{instance_name}\", resource_query)\n end", "def resource\n instance_variable_get(resource_name) || params[:id] && set_resource(controller_model.find(params[:id]))\n end", "def get_resource_to_use\n return @resources.first\n end", "def load_resource_instance\n parent\n\n if new_actions.include?(params[:action].to_sym)\n build_resource\n elsif params[:id]\n Spree::Variant.find(params[:id])\n end\n end", "def load_resource_instance\n parent\n\n if new_actions.include?(params[:action].to_sym)\n build_resource\n elsif params[:id]\n Spree::Variant.find(params[:id])\n end\n end", "def new_from_resource(rsrc); self.class.new_from_resource(rsrc) end", "def build_resource\n self.resource = resource_class.new(resource_params)\n end", "def load_current_resource\n @current_resource ||= Resource::ShipyardAgentConfig.new(\n new_resource.name\n )\n @current_resource.install_type(new_resource.install_type)\n @current_resource.created = created?\n @current_resource\n end", "def load_resource\n record = resource_model.includes(include_resources).find(params[:id])\n instance_variable_set(\"@#{ resource_name }\", record)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def build_resource(hash = {})\n self.resource = resource_class.new_with_session(hash, session)\n end", "def build_resource(hash = {})\n self.resource = resource_class.new_with_session(hash, session)\n end", "def get_resource(resource_type)\n\n Occi::Log.debug(\"Instantiating #{resource_type} ...\")\n\n if @model.get_by_id resource_type\n # we got a resource type identifier\n Occi::Core::Resource.new resource_type\n elsif @model.kinds.select { |kind| kind.term == resource_type }.any?\n # we got a resource type name\n Occi::Core::Resource.new @model.kinds.select {\n |kind| kind.term == resource_type\n }.first.type_identifier\n else\n raise \"Unknown resource type! [#{resource_type}]\"\n end\n\n end", "def get_resource\n execute(resource_path, method: :get)\n end", "def load_resource\n if action_name.in? %w(edit update destroy)\n resource_name = controller_name.singularize\n model_class = resource_name.capitalize.constantize\n resource = model_class.find(params[:id])\n instance_variable_set \"@#{resource_name}\", resource\n end\n end", "def resource\n @resource ||= begin\n resource_query\n .new(relation: resource_scope)\n .find_for_show(find_by_conditions: find_by_conditions)\n end\n end", "def build_resource(hash = nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n end", "def find_resource\n set_resource_ivar class_name.find(params[:id])\n end", "def resource\n @resource ||= if %w[destroy_error destroy_manifest].include?(params[:action])\n @file_model.find(params[:id]).resource\n else\n Resource.find(params[:resource_id])\n end\n end", "def reference_resource\n attributes = self.class.resources[reuse_as][:attributes]\n name = \"reference_resource_#{SecureRandom.hex(8)}_for_#{attributes.delete(:name)}\"\n\n Project.fabricate_via_api! do |project|\n self.class.resources[reuse_as][:attributes].each do |attribute_name, attribute_value|\n project.instance_variable_set(\"@#{attribute_name}\", attribute_value) if attribute_value\n end\n project.name = name\n project.path = name\n project.path_with_namespace = \"#{project.group.full_path}/#{project.name}\"\n end\n end", "def convert!\n resource\n end", "def [](attr)\n build_resource(raw[attr])\n end", "def create_resource\n class_name.new(get_secure_params).tap do |model|\n model.save\n set_resource_ivar model\n end\n end", "def resource\n attrs = @is.attrs.merge(@should.attrs)\n @changes.each { |c| attrs[c.attr] = c.is }\n Libral::Resource.new(@is.name, attrs)\n end", "def resource\n resource_model.find(params[:id])\n end", "def base_resource\n\t\t\t Subresource.new persisted? ? self.class.identify(self) : self.class.base_resource\n\t\t\tend", "def current_member() instance_variable_get(\"@#{resource_singular}\") end", "def load_current_resource\n @current_resource ||= Resource::WebhookCli.new(new_resource.name)\n end", "def load_resource_instance\n if new_actions.include?(params[:action].to_sym)\n build_resource\n elsif params[:id]\n find_resource\n end\n end", "def set_resource(resource_variable = nil)\n resource_variable ||= resource_class.find(params[:id])\n instance_variable_set(:\"@#{resource_name}\", resource_variable)\n end", "def find_resource\n @resource = resource_class.find(params[:id])\n end", "def resource(uri, opts = {})\n #resource = Resource.new(self, uri, opts)\n @resources ||= {}\n @resources[uri] ||= Resource.new(self, uri, opts)\n end", "def find_or_create_resource_for(name)\n resource_name = name.to_s.camelize\n resource_name.constantize\n rescue NameError\n resource = self.class.const_set(resource_name, Class.new(ActiveResource::Base))\n resource.prefix = self.class.prefix\n resource.site = self.class.site\n resource\n end", "def build_resource(hash=nil)\n super\n end", "def set_resource\n instance_variable_set(resource, @model.find(params[:id]))\n end" ]
[ "0.7880105", "0.7842488", "0.78156567", "0.7742631", "0.7742631", "0.7742631", "0.7726993", "0.7726993", "0.76276875", "0.76276875", "0.76276875", "0.76276875", "0.7468592", "0.7436348", "0.72905236", "0.7194489", "0.7149006", "0.70893526", "0.7079484", "0.70715827", "0.69233173", "0.69135433", "0.6905768", "0.68641114", "0.68239886", "0.6810514", "0.6809654", "0.6809654", "0.6809654", "0.6809654", "0.6809654", "0.6809654", "0.67428595", "0.6735657", "0.66815525", "0.66724133", "0.66724133", "0.6650403", "0.6650403", "0.66081953", "0.65284806", "0.65216243", "0.6505497", "0.65023875", "0.6498008", "0.6479229", "0.6469345", "0.6466935", "0.64642894", "0.6448918", "0.64489114", "0.6448029", "0.64437675", "0.6431521", "0.6414718", "0.64063644", "0.6397248", "0.6393336", "0.6393336", "0.63832104", "0.6359583", "0.6333236", "0.6329321", "0.6326996", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.63269085", "0.6320243", "0.6320243", "0.6293349", "0.6290768", "0.6286066", "0.62857914", "0.6273359", "0.6271175", "0.625208", "0.6248571", "0.62435746", "0.62343174", "0.62022996", "0.616442", "0.6161118", "0.6159828", "0.6157926", "0.6144942", "0.61435896", "0.61243516", "0.6123051", "0.61169964", "0.61157775", "0.61025345", "0.6099864" ]
0.7751867
4
Returns the allowed parameters for searching Override this method in each API controller to permit additional parameters to search on
def query_params {} end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_custom_search_params; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def allowed_query_params\n %w[include fields filter sort page]\n end", "def search_params\n return {} unless params[:q]\n params.require(:q).permit!\n end", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "def authorize_params\n super.tap do |params|\n options[:authorize_options].each do |k|\n params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])\n end\n end\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 params_for_search(params_to_merge = {})\n # params hash we'll return\n my_params = to_h.merge(self.class.new(params_to_merge, blacklight_config, controller))\n\n if block_given?\n yield my_params\n end\n\n if my_params[:page] && (my_params[:per_page] != params[:per_page] || my_params[:sort] != params[:sort])\n my_params[:page] = 1\n end\n\n Parameters.sanitize(my_params)\n end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def search_params\n allowed_attrs = %i[name categories]\n params.permit(*allowed_attrs)\n end", "def query_parameters\n end", "def query_parameters\n params = {}\n params['filter'] = @optional['filter'] if @optional['filter']\n params\n end", "def accepted_parameters\n required_parameters + optional_parameters\n end", "def request_params; end", "def search_params\n # params[:search]\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def permitted_params\n declared(params, include_missing: false)\n end", "def get_resource_params\n \traise NotImplementedError\n end", "def resource_filter_permitted_params\n %i[page per_page]\n end", "def params\n raise NotImplementedError\n end", "def filtering_params(params)\n params.slice(:omnisearch)\n end", "def authorize_params\n super.tap do |params|\n %w(scope team redirect_uri).each do |v|\n if !request.params[v].to_s.empty?\n params[v.to_sym] = request.params[v]\n end\n end\n log(:debug, \"Authorize_params #{params.to_h}\")\n end\n end", "def resource_params\n raise NotImplementedError\n end", "def index\n @search_params = SearchParam.all\n end", "def set_params\n # Check if it's a proper commit search action\n @search_action = params.permit(:commit)[:commit]\n # Search parameters\n @keywords = params.permit(:keywords)[:keywords]\n @location = params.permit(:location)[:location]\n @location_radius = params.permit(:location_radius)[:location_radius]\n @manufacturer_or_publisher = params.permit(:manufacturer_or_publisher)[:manufacturer_or_publisher]\n @category = params.permit(:category)[:category]\n @seller_name = params.permit(:seller_name)[:seller_name]\n end", "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n\n params[:scope] ||= DEFAULT_SCOPE\n params[:approval_prompt] ||= 'force'\n end\n end", "def query_params; end", "def solr_search_params(user_params = params || {})\n solr_parameters = {}\n solr_search_params_logic.each do |method_name|\n send(method_name, solr_parameters, user_params)\n end\n\n return solr_parameters\n end", "def query_params\n get_query_params\n end", "def request_parameters; end", "def has_search_parameters?\n result = super || !params[:t].blank? || !params[:l].blank? || !params[:resolve].blank?\n end", "def sanitize_params\n begin\n return params = params.slice(:search) if params[:search]\n return params = params.slice(:search_location) if params[:search_location]\n rescue NoMethodError\n return params\n end\n end", "def list_available_params\n cg_reader.list_available_params\n end", "def accepted_params\n [\n :Amount,\n :isPreAuth,\n :ServiceId, \n :RequestLang, \n :FullName, \n :Email, \n :Phone, \n :MaxInstallments,\n :MerchantTrns,\n :CustomerTrns,\n :SourceCode,\n :PaymentTimeOut,\n :ExpirationDate,\n :AllowRecurring,\n :Tags,\n :AllowTaxCard,\n :ActionUser,\n :DisableCash,\n :DisableCard\n ]\n end", "def query_parameters; end", "def request_params( params = {} )\n params\n end", "def filtered_parameters; end", "def api_params(q = {})\n @api[:optional].deep_merge(@api[:required]).deep_merge(q)\n end", "def format_params(params)\n \n # this is just used for multi_index search\n params[:indexes] ||= ['documents', 'people', 'topics', 'places' ]\n \n \n # return loaded models?\n params[:load] ||= true\n \n # will_paginate settings\n params[:page] ||= 1\n params[:per_page] ||= 25\n params[:offset] = ( ( params[:page].to_i - 1) * params[:per_page].to_i)\n\n # sort by\n params[:sort_by], params[:order_by] = params[:sort].split(\":\") if params[:sort]\n params[:order_by] = \"desc\" unless params[:order_by] == \"asc\"\n\n # facet filters and query\n params[:facet] ||= []\n params[:facet].compact!\n\n params[:request_query] = params[:q] ? params[:q].compact : \"*\"\n \n # facet filtering/limits\n params[:facet_filters] = params[:facet].collect do |f|\n facet, value = f.split(\":\")\n lambda { |boolean| boolean.must { term facet.to_sym, value } }\n end\n \n # facets to be returned\n params[:request_facets] ||= self.facets\n params[:facet_query] = {} \n params[:request_facets].each { |f| params[:facet_query][f] = params[:\"#{f}_page\"] ? ( ( params[:\"#{f}_page\"].to_i * 10 ) + 1 ) : 11 }\n \n return params\n end", "def all_params; end", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def validate_query_params(additional_params = nil)\n params.permit(*ApiConstants::DEFAULT_INDEX_PARAMS, *additional_params)\n end", "def get_all()\n @params\n end", "def parameters(params)\n allowed = [:start,:num,:type,:id,:filter,:tagged,:search,:state,:email,:password]\n params.merge! defaults if defaults\n params.reject {|key,value| !allowed.include? key }\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def authorize_params\n\n # Trick shamelessly borrowed from the omniauth-facebook gem!\n super.tap do |params|\n %w[scope].each { |v| params[v.to_sym] = request.params[v] if request.params[v] }\n params[:scope] ||= DEFAULT_SCOPE # ensure that we're always request *some* default scope\n end\n end", "def search_params\n params.require(:search).permit(:searchType, :fullTextSearch, :flightNumber, :pic, :sic, :airfield, :revenue, :memberName, :dateStart, :dateEnd, :prepMin, :prepMax, :caterMin, :caterMax, :depMin, :depMax, :flightMin, :flightMax, :arrMin, :arrMax, :maintMin, :maintMax, :catering, :maint, :createdBy, :hasComments, :save_search, :save_search_name, :overallmin, :overallmax, :user_id)\n end", "def search_options(request)\n params = request.params\n limit = params['limit']\n offset = params['offset']\n options = {}\n options[:limit] = limit.to_i if limit\n options[:offset] = offset.to_i if offset\n options\n end", "def param_whitelist\n [:role, :title]\n end", "def filter_parameters; end", "def filter_parameters; end", "def request_params(params = {})\n params\n end", "def custom_get_request_with_params?\n request.method =~ /get/i && !%w(index show).include?(params[:action]) && !params.nil?\n end", "def considering_params\n params[:considering]\n end", "def solr_opensearch_params(field, extra_controller_params={})\n solr_params = solr_search_params(extra_controller_params)\n solr_params[:per_page] = 10\n solr_params[:fl] = Blacklight.config[:index][:show_link]\n solr_params\n end", "def token_params\n super.tap do |params|\n options[:token_options].each do |k|\n params[k] = request.params[k.to_s] unless [nil, ''].include?(request.params[k.to_s])\n end\n end\n end", "def model_params\n params.require(:search_field).permit(:name, :title, :sort_order, :options)\n end", "def search_options(options)\n {\n search: {\n parameters: options\n }\n }\n end", "def api_params\n params[:api]\n end", "def search(params)\n raise NotImplementedError\n end", "def request_params(params = {})\n params\n end", "def list(params={})\n [:search, 'search'].each do |search|\n params.delete search\n end\n super params\n end", "def list(params={})\n [:search, 'search'].each do |search|\n params.delete search\n end\n super params\n end", "def list(params={})\n [:search, 'search'].each do |search|\n params.delete search\n end\n super params\n end", "def usersearch_params\n\n params.permit( :q , :usersearch => [:keyword , :country_id , :language_id , :category_id , :news_source_id])\n\n end", "def search_params\n params.permit(:q)\n end", "def search_params\n params[:name]\n end", "def search_params\n params.fetch(:search, {})\n end", "def search_params\n params.fetch(:search, {})\n end", "def search_params\n params.fetch(:search, {})\n end", "def param_whitelist\n [:rating, :review]\n end", "def setup_search_options\n @original_search_parameter = params[:search]\n params[:search] ||= \"\"\n params.keys.each do |param|\n if param =~ /(\\w+)_id$/\n unless params[param].blank?\n query = \"#{$1} = #{params[param]}\"\n params[:search] += query unless params[:search].include? query\n end\n end\n end\n end", "def discovery_api_params(app_params)\n if app_params['advanced'].include? 'true'\n api_params = generate_advanced_query(app_params)\n else\n api_params = app_params\n end\n api_params[\"facetFields\"] = ['inLanguage:10', 'itemType:10', 'creator:10']\n api_params[\"heldBy\"] = library_symbols if app_params['scope'].nil? or app_params['scope'].first != 'worldcat'\n api_params\n end", "def valid_params_request?; 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 query_params\n validate_params!\n \n qargs = {\n Ebay::Search::Api::OPERATION_NAME[:key] => Ebay::Search::Api::OPERATION_NAME[:value],\n Ebay::Search::Api::SERVICE_VERSION[:key] => Ebay::Search::Api::SERVICE_VERSION[:value],\n Ebay::Search::Api::SECURITY_APPNAME[:key] => self.app_name,\n Ebay::Search::Api::GLOBAL_ID[:key] => self.global_id,\n Ebay::Search::Api::RESPONSE_DATA_FORMAT[:key] => Ebay::Search::Api::RESPONSE_DATA_FORMAT[:value],\n Ebay::Search::Api::PER_PAGE[:key] => self.per_page,\n Ebay::Search::Api::KEYWORDS[:key] => self.keywords\n }\n \n query_formatter(qargs) do |params|\n params.join(\"&\")\n end\n end", "def get_params()\n return self.params.keys\n end", "def permit_all_params options = {}\n prepend_before_filter do\n self.params.deep_permit!\n end\n end", "def api_params\n params.fetch(:api, {})\n end", "def permitted_params\n []\n end", "def search_params\n params.permit(:search_string)\n end", "def api_params\n params[:api]\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 index\n @search_parameters = SearchParameter.all\n end", "def query_parameters\n request.GET\n end", "def http_params\n {}\n end", "def params() request.params end", "def params\n request.params\n end", "def params\n request.params\n end", "def filter_parameters\n if @filter_parameters\n @filter_parameters || []\n else\n defined?(Rails) && Rails.application.config.filter_parameters\n end\n end", "def params\n base_params.\n merge(tracker_default_params).\n merge(global_options_params).\n merge(hit_params).\n merge(custom_dimensions).\n merge(custom_metrics).\n merge(custom_params).\n reject {|_,v| v.nil?}\n end", "def custom_params\n return @custom_params ||= read_custom_params\n end", "def params_keys\n default_keys + advanced_keys\nend", "def official_search_params\n params.permit(:official_ids, :keyword)\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 search_params\n params.fetch(:genius, {})\n end", "def advancedsearch\n params[:filter] = true;\n end", "def search_params\n params.require(:search).permit(:ris)\n end", "def parameters\n url_params = \"\"\n\n if @resource == :catalog\n url_params += \"&\" + \"offset=#{URI.escape(@offset.to_s)}\" if @offset\n url_params += \"&\" + \"size=#{URI.escape(@size.to_s)}\" if @size\n url_params += \"&\" + \"search=#{URI.escape(@search)}\" if @search\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n url_params += \"&\" + \"state=#{URI.escape(@state)}\" if @state\n url_params += \"&\" + \"sort=#{URI.escape(@sort)}\" if @sort\n url_params += \"&\" + \"instock=#{@instock}\" if @instock\n elsif @resource == :categorymap\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n url_params += \"&\" + \"search=#{URI.escape(@search)}\" if @search\n elsif @resource == :reference\n url_params += \"&\" + \"filter=#{URI.escape(@filter)}\" if @filter\n end\n\n return url_params\n end", "def search_monitor_params\n params.permit(:title, :tenderTitle, :valueFrom, :valueTo, :buyer, :sort_by, :sort_direction, :submission_date_to, :submission_date_from, codeList:[], countryList:[], statusList:[], keywordList:[], status: [])\n end", "def get_query_params\n {}\n end" ]
[ "0.7116617", "0.7066794", "0.70283854", "0.6910947", "0.6677572", "0.6677378", "0.6674495", "0.65911496", "0.65735656", "0.6535017", "0.6516017", "0.6495849", "0.6493942", "0.64545274", "0.64497447", "0.6444509", "0.6444509", "0.64414024", "0.6433928", "0.63995445", "0.6386736", "0.63863224", "0.63597345", "0.6357915", "0.6356218", "0.6354788", "0.63541657", "0.6345192", "0.6340253", "0.6327518", "0.63239056", "0.6323509", "0.63141954", "0.63117707", "0.6303932", "0.62983996", "0.62955624", "0.62909245", "0.6290714", "0.62747574", "0.62704074", "0.6269114", "0.62549883", "0.6253743", "0.62492305", "0.6236712", "0.6220573", "0.62189966", "0.62161195", "0.6212769", "0.6212769", "0.6211275", "0.6205765", "0.620295", "0.6198922", "0.6194332", "0.61846805", "0.61736923", "0.6173423", "0.61667603", "0.6163704", "0.61629224", "0.61629224", "0.61629224", "0.6148924", "0.61438704", "0.6136958", "0.61339235", "0.61339235", "0.61339235", "0.6128198", "0.61250144", "0.6123643", "0.611996", "0.6114283", "0.6107504", "0.6105163", "0.6101718", "0.6096009", "0.60904026", "0.60803956", "0.6076762", "0.60738903", "0.6065478", "0.60575336", "0.6048881", "0.6048756", "0.6047918", "0.6047918", "0.6044089", "0.6035002", "0.60316986", "0.6030893", "0.6028927", "0.6028559", "0.60273176", "0.60230196", "0.6022288", "0.6017861", "0.601571", "0.6011208" ]
0.0
-1
The resource class based on the controller
def resource_class @resource_class ||= resource_class_name.constantize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_class\n @resource_class ||= self.controller_name.singularize.classify.constantize\n end", "def resource_class\n name = controller.controller_name\n return \"active\" if name == \"resources\"\n end", "def resource_klass\n resource_klass_name.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n class_name\n end", "def get_resource_class\n \tresource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n\t\t\t\t@resource_class ||= resource_name.classify.constantize\n\t\t\tend", "def resource_class\n @resource_class ||= self.class.to_s.split(\":\").last\n end", "def resource_class\n \t@resource_class ||= get_resource_class\n end", "def class_of_resource\n @class_of_resource ||= resource_name.classify.constantize\n end", "def resource_klass\n @resource_klass ||= resource_name.classify.constantize\n end", "def resource_class\n # TODO does this need to have draft?\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_klass\n Valkyrie.config.resource_class_resolver.call(internal_resource)\n end", "def resource_klass\n Valkyrie.config.resource_class_resolver.call(internal_resource)\n end", "def resource_class\n resource_finder.is_a?(Class) ? resource_finder : resource_finder.name.classify.constantize\n end", "def resource_klass\n Valkyrie.config.resource_class_resolver.call(internal_resource)\n end", "def resource_class\n resource_specification.klass\n end", "def resource_class\n @resource_class ||= begin\n resource_parts = params[:namespaces] ? params[:namespaces].split('/') : []\n resource_parts << params[:resource_name]\n resource_parts.map(&:classify).join('::').constantize\n end\n end", "def resource_class\n\n ActiveSupport::Dependencies.constantize(resource_class_name)\n\n end", "def resource_class\n (self.class.name.split('::').last || '').downcase\n end", "def resource_class\n @options[:resource_class]\n end", "def resource_klass\n @resource_klass ||= JsonApi::Resources::Discovery\n .resource_for_name object,\n resource_class: @resource_class\n end", "def resource_klass_name\n resource_name.classify\n end", "def get_resource_name\n \tself.controller_name.singularize\n end", "def resource_class_name\n @resource_class_name ||= resource_name.classify.constantize\n end", "def resource_for(klass)\n resources[klass]\n end", "def resource_model\n \"::#{resource_name}\".constantize\n end", "def resource_model\n Object.const_get options[:resource].classify\n end", "def resource_class\n case class_name\n when false then\n name.to_sym\n when String then\n class_name.constantize\n else\n raise ArgumentError, \"unexpected class_name: #{class_name}\"\n end\n end", "def resource\n self.class.resource\n end", "def resource_name\n name.to_s.chomp('Controller').demodulize.singularize\n end", "def resource_class\n case @options[:class]\n when false\n name.to_sym\n when nil\n namespaced_name.to_s.camelize.constantize\n when String\n @options[:class].constantize\n else\n @options[:class]\n end\n end", "def parent_resource_class\n @parent_resource_class ||= parent_resource_name.classify.constantize\n end", "def resource_name\n @@resource_name ||= self.class.to_s.split('::').last.gsub('Controller', '').singularize.underscore\n end", "def resource_name\n controller_name.demodulize.singularize\n end", "def resource_name\n controller_name.demodulize.singularize\n end", "def resource_name\n controller_name.demodulize.singularize\n end", "def controller_for(resource)\n return resource if resource.is_a?(Class) && resource.ancestors.include?(ActionController::Base)\n \"#{resource.to_s.underscore}_controller\".classify.constantize\n rescue NameError\n raise ResourceFull::ResourceNotFound, \"not found: #{resource}\"\n end", "def representer_klass\n resource_module::Representer::Resource\n end", "def published_resource_class\n @published_resource_class ||= resource_name.classify.pluralize.constantize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def initialize_resources_class_accessors! #:nodoc:\n # First priority is the namespaced model, e.g. User::Group\n self.resource_class ||= begin\n namespaced_class = self.name.sub(/Controller$/, '').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n # Second priority is the top namespace model, e.g. EngineName::Article for EngineName::Admin::ArticlesController\n self.resource_class ||= begin\n namespaced_classes = self.name.sub(/Controller$/, '').split('::')\n namespaced_class = [namespaced_classes.first, namespaced_classes.last].join('::').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n # Third priority the camelcased c, i.e. UserGroup\n self.resource_class ||= begin\n camelcased_class = self.name.sub(/Controller$/, '').gsub('::', '').singularize\n camelcased_class.constantize\n rescue NameError\n nil\n end\n\n # Otherwise use the Group class, or fail\n self.resource_class ||= begin\n class_name = self.controller_name.classify\n class_name.constantize\n rescue NameError => e\n raise unless e.message.include?(class_name)\n nil\n end\n\n self.parents_symbols = self.parents_symbols.try(:dup) || []\n\n # Initialize resources configuration hash\n self.resources_configuration = self.resources_configuration.try(:dup) || {}\n self.resources_configuration.each do |key, value|\n next unless value.is_a?(Hash) || value.is_a?(Array)\n self.resources_configuration[key] = value.dup\n end\n\n config = (self.resources_configuration[:self] ||= {})\n config[:collection_name] = self.controller_name.to_sym\n config[:instance_name] = self.controller_name.singularize.to_sym\n\n config[:route_collection_name] = config[:collection_name]\n config[:route_instance_name] = config[:instance_name]\n\n # Deal with namespaced controllers\n namespaces = self.controller_path.split('/')[0..-2]\n\n # Remove namespace if its a mountable engine\n namespaces.delete_if do |namespace|\n begin\n \"#{namespace}/engine\".camelize.constantize.isolated?\n rescue StandardError, LoadError\n false\n end\n end\n\n config[:route_prefix] = namespaces.join('_').to_sym unless namespaces.empty?\n\n # Deal with default request parameters in namespaced controllers, e.g.\n # Forum::Thread#create will properly pick up the request parameter\n # which will be forum_thread, and not thread\n # Additionally make this work orthogonally with instance_name\n config[:request_name] = self.resource_class.to_s.underscore.gsub('/', '_')\n\n # Initialize polymorphic, singleton, scopes and belongs_to parameters\n polymorphic = self.resources_configuration[:polymorphic] || { symbols: [], optional: false }\n polymorphic[:symbols] = polymorphic[:symbols].dup\n self.resources_configuration[:polymorphic] = polymorphic\n end", "def resource_class\n raise NotImplementedError\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_type\n case model\n when \"Cinstance\"\n 'application'\n else\n model.singular\n end\n end", "def controller\n @controller ||= controller_name.constantize\n end", "def resource\n self.class.to_s.split('::').last.downcase\n end", "def getKlass #:doc:\n @Klass = self.controller_name.classify.constantize\n @Klass\n end", "def type_as_class(resource_name)\n\t resource_name.singularize.capitalize.constantize\n\tend", "def model_type\n self.class.name[/(.*)Controller/,1].singularize.constantize\n end", "def model_type\n self.class.name[/(.*)Controller/,1].singularize.constantize\n end", "def resource_name\n @resource_name ||= controller_name.singularize\n end", "def resource_name\n @resource_name ||= controller_name.singularize\n end", "def controller_class; end", "def controller_class; end", "def resource_name\n\t\t\t\t@resource_name ||= self.controller_name.singularize\n\t\t\tend", "def initialize_resources_class_accessors! #:nodoc:\n\n\n # First priority is the namespaced model, e.g. User::Group\n self.resource_class ||= begin\n namespaced_class = self.name.sub(/Controller/, '').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n\n\n # Second priority is the top namespace model, e.g. EngineName::Article for EngineName::Admin::ArticlesController\n self.resource_class ||= begin\n namespaced_classes = self.name.sub(/Controller/, '').split('::')\n namespaced_class = [namespaced_classes.first, namespaced_classes.last].join('::').singularize\n namespaced_class.constantize\n rescue NameError\n nil\n end\n\n\n\n # Third priority the camelcased c, i.e. UserGroup\n self.resource_class ||= begin\n camelcased_class = self.name.sub(/Controller/, '').gsub('::', '').singularize\n camelcased_class.constantize\n rescue NameError\n nil\n end\n\n\n\n # Otherwise use the Group class, or fail\n self.resource_class ||= begin\n class_name = self.controller_name.classify\n class_name.constantize\n rescue NameError => e\n raise unless e.message.include?(class_name)\n nil\n end\n\n\n\n self.resource_instance_name = self.controller_name.singularize.to_sym #test_name\n\n self.collection_name = self.controller_name.to_sym\n\n\n\t\tself.resource_name = resource_class.to_s\n\n end", "def resource_model\n resource = \"#{resource_param}\".constantize\n end", "def resource_name\n @resource_name ||= controller_name.singularize\n end", "def resource_name\n :\"@#{controller_name.singularize}\"\n end", "def resource_type\n case\n when controller_name.starts_with?('search')\n params[:record_type]\n when is_variable_controller?\n 'variables'\n when is_services_controller?\n 'services'\n when is_tools_controller?\n 'tools'\n else\n # default\n 'collections'\n end\n end", "def resource_as_constant_name\n if klass_or_instance.is_a?(Class)\n klass_or_instance.name\n else\n klass_or_instance.class.name\n end\n end", "def resources_name\n controller_name\n end", "def class_for_controller_name\n controller_model\n end", "def controller_class\n @controller_class ||= @controller&.class || self.class.class_for(@key)\n end", "def resource_query\n resource_class\n end", "def model\n controller_name.classify.constantize\n end", "def resource_name\n controller_name.humanize\n end", "def model_class\n resource_class = @options[:resource]\n if resource_class.nil?\n @name.to_s.camelize.constantize\n elsif resource_class.kind_of? String\n resource_class.constantize\n else\n resource_class # could be a symbol\n end\n end", "def controller_name\n self.class.to_s\n end", "def resource\n return Object unless resource_type\n return resource_type.constantize unless resource_id\n return _resource\n end", "def resource_finder\n case finder = crudify_options[:finder]\n when Symbol : send(finder)\n when Proc : instance_exec(&finder)\n else self.class.read_inheritable_attribute(:resource_class) || self.class.controller_name.classify.constantize\n end\n end", "def klass_from_controller(c = controller_name)\n c.singularize.camelize.constantize\n end", "def resource_klass(name)\n eval('RedboothRuby::' + camelize(name)) rescue nil\n end", "def resource_module\n klass.name.to_s.split('::')[0..-3].join('::').constantize\n end", "def type\n controller_name.singularize\n end", "def model\n\t\tObject.const_get(controller_name.classify)\n\tend", "def resource\n @resource\n end", "def resource\n @resource\n end", "def resource\n @resource ||= resource_klass.new object\n end", "def get_resource_ivar\n instance_variable_get(\"@#{self.controller_name.singularize}\")\n end", "def resource_class\n params.each do |name, _value|\n if /(.+)_id$/.match?(name)\n model = name.match(%r{([^\\/.]*)_id$})\n return model[1].classify.constantize, name\n end\n end\n nil\n end", "def resource\n instance_variable_get(resource_name) || params[:id] && set_resource(controller_model.find(params[:id]))\n end", "def resource\n klass, param = resource_class\n klass&.find(params[param.to_sym])\n end", "def set_resource\n resource_class_name = controller_name.classify\n resource = \"@#{ resource_class_name.underscore }\"\n instance_variable_set(resource, resource_class_name.constantize.find(params[:id]))\n end", "def controller_name\n [namespace.module_name, resource_name.plural.camelize + \"Controller\"].compact.join(\"::\")\n end", "def resource\n self\n end", "def thing\n controller_name.classify.constantize\n end" ]
[ "0.8618411", "0.8433249", "0.82288253", "0.81042385", "0.80970544", "0.80970544", "0.80970544", "0.80751187", "0.8063445", "0.8029621", "0.8029621", "0.8029621", "0.8021062", "0.8001003", "0.79841983", "0.7955573", "0.791964", "0.7886186", "0.78640455", "0.78640455", "0.7859555", "0.7833819", "0.7816878", "0.77120566", "0.7655689", "0.7643518", "0.7631206", "0.76235384", "0.75792444", "0.757474", "0.75210553", "0.7369758", "0.7357335", "0.73467886", "0.73415095", "0.7337017", "0.7325974", "0.7307217", "0.72959995", "0.72702914", "0.72680736", "0.72680736", "0.72680736", "0.72601914", "0.7256937", "0.7254147", "0.72385377", "0.72385377", "0.72385377", "0.7237336", "0.7237336", "0.722277", "0.7218791", "0.7213652", "0.7213652", "0.7212916", "0.721076", "0.72086495", "0.71922904", "0.7188609", "0.715661", "0.71540093", "0.71540093", "0.71476966", "0.71476966", "0.71440667", "0.71440667", "0.7141243", "0.7133118", "0.7116785", "0.71025354", "0.7097857", "0.7081293", "0.70585024", "0.7052794", "0.70335865", "0.70132494", "0.7013155", "0.7012703", "0.69936967", "0.6993055", "0.698824", "0.69782233", "0.69546115", "0.6952505", "0.69391894", "0.69318813", "0.6930755", "0.69288707", "0.6906386", "0.6906386", "0.68989897", "0.68832856", "0.68751043", "0.68695134", "0.6858134", "0.6853058", "0.6809004", "0.680455", "0.68006235" ]
0.7984989
14
The singular name for the resource class based on the controller
def resource_name @resource_name ||= self.controller_name.singularize end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_name\n name.to_s.chomp('Controller').demodulize.singularize\n end", "def get_resource_name\n \tself.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= controller_name.singularize\n end", "def resource_name\n @resource_name ||= controller_name.singularize\n end", "def resource_name\n controller_name.demodulize.singularize\n end", "def resource_name\n controller_name.demodulize.singularize\n end", "def resource_name\n controller_name.demodulize.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n\t\t\t\t@resource_name ||= self.controller_name.singularize\n\t\t\tend", "def resource_name\n @resource_name ||= self.controller_name.singularize\n end", "def resource_name\n @@resource_name ||= self.class.to_s.split('::').last.gsub('Controller', '').singularize.underscore\n end", "def singular_resource_name\n @singular_resource_name ||= ZendeskAPI::Helpers.snakecase_string(to_s.split(\"::\").last)\n end", "def resource_name\n \"#{self.class.to_s.split(\"::\").last.downcase}s\"\n end", "def resource_name\n @resource_name ||= controller_name.singularize\n end", "def resource_name\n resource.name.singularize.underscore\n end", "def resource_singular_name\n @singular_name ||= resource_plural_name.singularize\n end", "def resource_name\n resources_name.singularize\n end", "def resource_name\n controller_name.humanize\n end", "def resource_name\n :\"@#{controller_name.singularize}\"\n end", "def resource_name\n resource[:name].gsub(/\\s/, '_').downcase.singularize\n end", "def resource_klass_name\n resource_name.classify\n end", "def resource_name\n @resource_name ||= Inflection.plural(singular_resource_name)\n end", "def controller_name\n self.name.underscore.pluralize\n end", "def to_resource_name\n singularize.underscore\n end", "def resource_name\n self.class.name.ns_underscore.pluralize\n end", "def resource_name\n name.ns_underscore.pluralize\n end", "def resource_name\n @resource_name ||= singular_resource_name.pluralize\n end", "def controller_name\n [namespace.module_name, resource_name.plural.camelize + \"Controller\"].compact.join(\"::\")\n end", "def resource_name\n resource_class.slice(0,1).downcase + resource_class.slice(1,resource_class.length)\n end", "def plural_resource_name\n @plural_resource_name ||= controller_name\n end", "def resource_class_name\n @resource_class_name ||= resource_name.classify.constantize\n end", "def resource_class\n (self.class.name.split('::').last || '').downcase\n end", "def resource_name\n @resource_name ||= plural_resource_name.singularize\n end", "def resource_name\n resource_class.resource_name\n end", "def controller_name\n @controller_name ||=\n if @resource_options.key?(:controller_name)\n tools.string.underscore(@resource_options.fetch(:controller_name)).\n sub(/_controller\\z/, '')\n else\n plural_resource_name\n end # if-else\n end", "def controller_name\n self.class.name.downcase.pluralize\n end", "def name\n self.class.to_s.gsub(/controller$/i, \"\")\n end", "def object_name\n self.class.name.underscore.split('/').last.sub(/_controller$/, '').singularize\n end", "def object_name\n controller_name.singularize\n end", "def resource_name\n @resource_name ||= plural_name\n end", "def resource_name\n @resource_name ||= model_name.element.pluralize\n end", "def get_resource_class\n \tresource_name.classify.constantize\n end", "def resource\n self.class.to_s.split('::').last.downcase\n end", "def resource_as_constant_name\n if klass_or_instance.is_a?(Class)\n klass_or_instance.name\n else\n klass_or_instance.class.name\n end\n end", "def model_name\n self.class.name[/(.*)Controller/,1].singularize.underscore\n end", "def resources_name\n controller_name\n end", "def resource_klass\n resource_klass_name.constantize\n end", "def singular_resource_route_with_controller_prefixes\n resource_with_controller_prefixes(model.name.as_singular)\n end", "def type_as_class(resource_name)\n\t resource_name.singularize.capitalize.constantize\n\tend", "def resource_class\n @resource_class ||= self.controller_name.singularize.classify.constantize\n end", "def resource_text_from_controller\n internationalized_resource_name(controller_name.singularize.camelize, false)\n end", "def resource_text_from_controller\n internationalized_resource_name(controller_name.singularize.camelize, false)\n end", "def to_resource\n name.underscore.pluralize\n end", "def type\n controller_name.singularize\n end", "def name\n @resource.name\n end", "def resource_human_name\n resource_class.model_name.human\n end", "def controller_name\n self.class.controller_name\n end", "def resources_name(resources = nil)\n resources ? resources.model.to_s.pluralize.underscore : controller_name.pluralize\n end", "def resource_sym\n mapping.singular\n end", "def controller_name\n self.class.to_s\n end", "def resource_class\n class_name\n end", "def plural_published_resource_name\n @plural_published_resource_name ||= controller_name\n end", "def resource_name\n resource_module.to_s.demodulize\n end", "def controller_name(name)\n @controller_class_name = \"#{name}_controller\".camelize\n end", "def singularize\n ActiveSupport::Inflector.singularize(self)\n end", "def resource_class\n name = controller.controller_name\n return \"active\" if name == \"resources\"\n end", "def plural_resource_route_with_controller_prefixes\n resource_with_controller_prefixes(model.name.as_singular.pluralize)\n end", "def resources_name\n controller_name\n end", "def resources_name\n self.class.resources_name\n end", "def resource_class\n\t\t\t\t@resource_class ||= resource_name.classify.constantize\n\t\t\tend", "def resource_name\n @resource_name\n end", "def qualified_resource_name\n @qualified_resource_name ||=\n begin\n @resource_class.name.split('::').map do |str|\n tools.string.underscore(str)\n end.join('-')\n end # name\n end", "def localized_resource_class_name(resource)\n resource_class = ::Link2::Support.find_resource_class(resource)\n resource_name = ::Link2::Support.human_name_for(resource_class) rescue resource_class.to_s.humanize\n resource_name.underscore\n end", "def to_resources_name\n pluralize.underscore\n end", "def model_name\n @model_class ? @model_class.name.demodulize.underscore : self.controller_name.singularize\n end", "def full_implementation_controller_name\n \"#{model_class_name.pluralize}Controller\"\n end", "def name\n @name ||= [action, resource.name, resource.type].compact.map(&:to_s).join('_').underscore\n end", "def enclosing_resource_name\n enclosing_resource.class.name.underscore\n end", "def resource_item_name\n resource_name.to_s.singularize.to_sym\n end", "def resource_name\n current_definition.resource_name\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_class\n @resource_class ||= resource_name.classify.constantize\n end", "def resource_ivar\n \"@#{class_name.model_name.singular}\"\n end", "def derived_name\n return controller_name if respond_to?(:controller_name)\n return model_name.plural if respond_to?(:model_name)\n name ? name.underscore.pluralize : nil\n end", "def resource_name\n return @resource_name\n end", "def resource_name\n return @resource_name\n end", "def resource_name\n return @resource_name\n end", "def partial_name\n last = @resources.last\n klass = last.is_a?(Class) ? last : last.class\n klass.model_name.underscore\n end", "def resource_name\n @resource_name ||= self.class.to_s.underscore.gsub(%r{.*/([^/]+)\\z}, '\\1')\n end", "def resource_item_name\n resource_name.to_s.singularize.to_sym\n end", "def full_object_name\n if class_parent_name != 'Object'\n \"#{class_parent_name.underscore}__#{controller_name.singularize}\"\n else\n controller_name.singularize\n end\n end", "def class_of_resource\n @class_of_resource ||= resource_name.classify.constantize\n end", "def controller_full_name\n controller.class.name.sub('Controller','').gsub('::','_').underscore\n end" ]
[ "0.861274", "0.85466033", "0.85093474", "0.85093474", "0.8507382", "0.8507382", "0.84701234", "0.84701234", "0.84701234", "0.8435745", "0.8435745", "0.8416853", "0.84051806", "0.83983785", "0.8360254", "0.83439785", "0.8292862", "0.8240594", "0.8230048", "0.81918824", "0.8179842", "0.8115256", "0.8093607", "0.8022751", "0.7997846", "0.79967517", "0.7933617", "0.7905342", "0.78972113", "0.78892684", "0.7881545", "0.78800255", "0.78765696", "0.78544325", "0.7825495", "0.78242904", "0.77595365", "0.7746483", "0.7723311", "0.7712998", "0.7711815", "0.7706723", "0.76837295", "0.7615906", "0.76122177", "0.76097834", "0.7598253", "0.7597773", "0.75806177", "0.7577312", "0.7549147", "0.75350386", "0.7518377", "0.7478665", "0.7478665", "0.7464277", "0.7462978", "0.7401541", "0.74008185", "0.7396401", "0.73672795", "0.7362561", "0.735355", "0.73512244", "0.73412037", "0.73275584", "0.7324022", "0.7315262", "0.72578", "0.72419566", "0.7241035", "0.7214925", "0.7206514", "0.71965843", "0.71943474", "0.7190073", "0.7189412", "0.7172537", "0.7166918", "0.71478444", "0.71396846", "0.71264803", "0.7122088", "0.71209466", "0.71209466", "0.71209466", "0.71076113", "0.71067256", "0.7106473", "0.7098283", "0.7098283", "0.7098283", "0.70828754", "0.7071133", "0.7071021", "0.70604926", "0.70530015", "0.7047238" ]
0.8278734
19
Use callbacks to share common setup or constraints between actions.
def set_resource(resource_variable = nil) resource_variable ||= resource_class.find(params[:id]) instance_variable_set(:"@#{resource_name}", resource_variable) 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
Deprecated metrics not used anymore
def generateDelayToIntegrationByMergeScenario(projectName, localClone, pathOutput) prefixProjectName = formatProjectName(projectName) integrationLine = [] integrationLineAuthorDateList = [] integrationLineCommitDateList = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |f1| while line = f1.gets f1.each_line do |line| leftAuthorsList = [] rightAuthorsList = [] campos = line.split(",")#.length mergeCommitID = campos[0].gsub("\r","").gsub("\n","") isConflicting = campos[1].gsub("\r","").gsub("\n","") leftCommits = campos[10].split("@@") rightCommits = campos[11].split("@@") leftDelayIntegration = 0 rightDelayIntegration = 0 arithmeticMeanDelayIntegration = 0 geometricMeanDelayIntegration = 0 deltaIntegration = 0 if leftCommits.include?("\n") leftCommits.delete("\n") end if rightCommits.include?("\n") rightCommits.delete("\n") end # Metric startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{leftCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") leftDelayIntegration = (endDate - startDate).to_i startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{rightCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") rightDelayIntegration = (endDate - startDate).to_i leftDelayLessThanZero = false if (leftDelayIntegration==0) leftDelayIntegration = 1 end rightDelayLessThanZero = false if (rightDelayIntegration==0) rightDelayIntegration = 1 end if leftDelayIntegration > rightDelayIntegration deltaIntegration = leftDelayIntegration - rightDelayIntegration elsif rightDelayIntegration > leftDelayIntegration deltaIntegration = rightDelayIntegration - leftDelayIntegration else deltaIntegration = 0 end if (rightDelayIntegration <0) leftDelayLessThanZero = true end if((leftDelayIntegration * rightDelayIntegration) <0) if(leftDelayIntegration <0) leftDelayIntegration = 1 else rightDelayIntegration = 1 end end arithmeticMeanDelayIntegration = (Float(leftDelayIntegration + rightDelayIntegration)/2).round(2) geometricMeanDelayIntegration = Math.sqrt(Float(leftDelayIntegration*rightDelayIntegration)).round(2) linha = mergeCommitID+","+isConflicting+","+leftDelayIntegration.to_s+","+rightDelayIntegration.to_s+","+arithmeticMeanDelayIntegration.to_s+","+geometricMeanDelayIntegration.to_s+","+deltaIntegration.to_s integrationLine.push(linha.gsub("\n", "")) File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, leftDelayIntegration, rightDelayIntegration, arithmeticMeanDelayIntegration, geometricMeanDelayIntegration, deltaIntegration" integrationLine.each do |dado| file.puts "#{dado}" end end # exploring more data - extra internal test startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{leftCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") leftDelayIntegration = (endDate - startDate).to_i startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{rightCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%cd" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") rightDelayIntegration = (endDate - startDate).to_i if leftDelayIntegration > rightDelayIntegration deltaIntegration = leftDelayIntegration - rightDelayIntegration elsif rightDelayIntegration > leftDelayIntegration deltaIntegration = rightDelayIntegration - leftDelayIntegration else deltaIntegration = 0 end if leftDelayIntegration * rightDelayIntegration < 0 if leftDelayIntegration < 0 leftDelayIntegration = leftDelayIntegration * -1 else rightDelayIntegration = rightDelayIntegration * -1 end end arithmeticMeanDelayIntegration = (Float(leftDelayIntegration + rightDelayIntegration)/2).round(2) geometricMeanDelayIntegration = Math.sqrt(Float(leftDelayIntegration*rightDelayIntegration)).round(2) linha = mergeCommitID+","+isConflicting+","+leftDelayIntegration.to_s+","+rightDelayIntegration.to_s+","+arithmeticMeanDelayIntegration.to_s+","+geometricMeanDelayIntegration.to_s+","+deltaIntegration.to_s integrationLineCommitDateList.push(linha.gsub("\n", "")) File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationCommitDatesList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, leftDelayIntegration, rightDelayIntegration, arithmeticMeanDelayIntegration, geometricMeanDelayIntegration, deltaIntegration" integrationLineCommitDateList.each do |dado| file.puts "#{dado}" end end # exploring more data - extra test startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{leftCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") leftDelayIntegration = (endDate - startDate).to_i startDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{rightCommits[0]}).gsub("\r","").gsub("\n","") endDate = Date.parse %x(git --no-pager log -1 --pretty=format:"%ad" --date=local #{mergeCommitID}).gsub("\r","").gsub("\n","") rightDelayIntegration = (endDate - startDate).to_i if leftDelayIntegration > rightDelayIntegration deltaIntegration = leftDelayIntegration - rightDelayIntegration elsif rightDelayIntegration > leftDelayIntegration deltaIntegration = rightDelayIntegration - leftDelayIntegration else deltaIntegration = 0 end if leftDelayIntegration * rightDelayIntegration < 0 if leftDelayIntegration < 0 leftDelayIntegration = leftDelayIntegration * -1 else rightDelayIntegration = rightDelayIntegration * -1 end end arithmeticMeanDelayIntegration = (Float(leftDelayIntegration + rightDelayIntegration)/2).round(2) geometricMeanDelayIntegration = Math.sqrt(Float(leftDelayIntegration*rightDelayIntegration)).round(2) linha = mergeCommitID+","+isConflicting+","+leftDelayIntegration.to_s+","+rightDelayIntegration.to_s+","+arithmeticMeanDelayIntegration.to_s+","+geometricMeanDelayIntegration.to_s+","+deltaIntegration.to_s integrationLineAuthorDateList.push(linha.gsub("\n", "")) File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationAuthorDatesList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, leftDelayIntegration, rightDelayIntegration, arithmeticMeanDelayIntegration, geometricMeanDelayIntegration, deltaIntegration" integrationLineAuthorDateList.each do |dado| file.puts "#{dado}" end end end #f1eachline end #while end #Fileopen puts "end running generateDelayToIntegrationByMergeScenario from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def additional_metrics\n []\n end", "def setup_metrics\n end", "def setup_metrics\n end", "def setup_metrics\n end", "def cpu_metrics\n super\n end", "def metrics\n @metrics ||= collect_metrics\n end", "def custom_metrics\n @custom_metrics ||= {}\n end", "def metrics\n @metrics ||= []\n end", "def collect_metrics(*)\n raise NotImplementedError, 'Must implement collect_metrics'\n end", "def get_metrics\n {\n method: \"Performance.getMetrics\"\n }\n end", "def fan_metrics\n super\n end", "def build_metrics\n {}\n end", "def summary_metrics\n []\n end", "def metrics\n standard.unit.convert_to_metric imperials\n end", "def initialize\n @metrics = { processed: 0, skipped: 0, failed: 0, updated: 0,\n unchanged: 0, start_time: 0, failed_list: [],\n warning: 0 }\n end", "def metrics\n @metrics ||= parent_klass.metrics.dup\n end", "def collect(metrics)\n metrics\n end", "def metrics\n with_stats_lock do\n @stats_hash.keys.map { |spec| spec.to_s }\n end\n end", "def metrics=(new_metrics)\n @metrics = new_metrics\n @metrics[:missing] = @metrics.first[1] unless @metrics[:missing]\n end", "def temperature_metrics\n super\n end", "def metric(*names)\n metrics = names.map do |name|\n id = name.to_s.downcase.gsub(/\\W+/, '_').to_sym\n Vanity.playground.metrics[id] ||= Vanity::Metric.new(Vanity.playground, name)\n end\n names.size == 1 ? metrics.first : metrics\n end", "def set_metrics\n if rails?\n @metrics = MetricFu::AVAILABLE_METRICS + [:stats, :rails_best_practices]\n else\n @metrics = MetricFu::AVAILABLE_METRICS\n end\n end", "def metric(data={})\n if @@metrics_buffer.empty?\n @@metrics_buffer = [data]\n else\n @@metrics_buffer << data\n end\n end", "def update_metrics!(*args)\n self.class.metrics.each do |metric, options|\n send(metric, *args)\n end\n end", "def get_metric(key)\n metrics[key] || meta[key]\n end", "def application_metrics\n metrics = Danbooru::Metric::Set.new({\n danbooru_info: [:counter, \"Information about the current application build.\"],\n danbooru_artists_total: [:gauge, \"The total number of artists.\"],\n danbooru_artist_urls_total: [:gauge, \"The total number of artist URLs.\"],\n danbooru_artist_versions_total: [:counter, \"The total number of artist versions.\"],\n danbooru_background_jobs_total: [:gauge, \"The total number of background jobs.\"],\n danbooru_bans_total: [:gauge, \"The total number of user bans.\"],\n danbooru_bulk_update_requests_total: [:gauge, \"The total number of bulk update requests.\"],\n danbooru_comments_total: [:gauge, \"The total number of comments.\"],\n danbooru_comment_votes_total: [:gauge, \"The total number of comment votes.\"],\n danbooru_favorites_total: [:gauge, \"The total number of favorites.\"],\n danbooru_favorite_groups_total: [:gauge, \"The total number of favorite groups.\"],\n danbooru_forum_posts_total: [:gauge, \"The total number of forum posts.\"],\n danbooru_forum_topics_total: [:gauge, \"The total number of forum topics.\"],\n danbooru_media_assets_total: [:gauge, \"The total number of media assets. Excludes processing or failed assets.\"],\n danbooru_media_assets_file_size_bytes_total: [:gauge, \"The total file size of all active media assets. Does not include thumbnails.\"],\n danbooru_media_assets_pixels_total: [:gauge, \"The total number of pixels in all active media assets (that is, the sum of width * height for all images). Does not account for animated images.\"],\n danbooru_media_assets_duration_seconds_total: [:gauge, \"The total runtime of all active media assets. Includes videos, animated GIFs and PNGs, and ugoiras.\"],\n danbooru_post_votes_total: [:gauge, \"The total number of post votes.\"],\n danbooru_posts_total: [:gauge, \"The total number of posts.\"],\n danbooru_post_appeals_total: [:gauge, \"The total number of post appeals.\"],\n danbooru_post_flags_total: [:gauge, \"The total number of post flags.\"],\n danbooru_notes_total: [:gauge, \"The total number of notes.\"],\n danbooru_note_versions_total: [:counter, \"The total number of note versions.\"],\n danbooru_pools_total: [:gauge, \"The total number of pools.\"],\n danbooru_pools_post_count_total: [:gauge, \"The total number of posts in pools.\"],\n danbooru_tags_total: [:gauge, \"The total number of tags (excluding empty tags).\"],\n danbooru_tags_post_count_total: [:gauge, \"The total number of tags on posts.\"],\n danbooru_uploads_total: [:gauge, \"The total number of uploads.\"],\n danbooru_users_total: [:counter, \"The total number of users.\"],\n danbooru_user_feedbacks_total: [:gauge, \"The total number of user feedbacks (excluding deleted feedbacks).\"],\n danbooru_wiki_pages_total: [:gauge, \"The total number of wiki pages.\"],\n danbooru_wiki_page_versions_total: [:counter, \"The total number of wiki page versions.\"],\n })\n\n status = ServerStatus.new\n versions = {\n danbooru_version: status.danbooru_version,\n ruby_version: status.ruby_version,\n rails_version: status.rails_version,\n puma_version: status.puma_version,\n distro_version: status.distro_version,\n libvips_version: status.libvips_version,\n ffmpeg_version: status.ffmpeg_version,\n exiftool_version: status.exiftool_version,\n }\n metrics[:danbooru_info][versions].set(1)\n\n Artist.group(:is_deleted).pluck(Arel.sql(\"is_deleted, COUNT(*)\")).each do |deleted, count|\n metrics[:danbooru_artists_total][deleted: deleted].set(count)\n end\n\n ArtistURL.group(:is_active).pluck(Arel.sql(\"is_active, COUNT(*)\")).each do |active, count|\n metrics[:danbooru_artist_urls_total][active: active].set(count)\n end\n\n ArtistVersion.pluck(Arel.sql(\"COUNT(*)\")).each do |count|\n metrics[:danbooru_artist_versions_total].set(count)\n end\n\n metrics[:danbooru_background_jobs_total][status: \"queued\"].set(BackgroundJob.queued.count)\n metrics[:danbooru_background_jobs_total][status: \"running\"].set(BackgroundJob.running.count)\n metrics[:danbooru_background_jobs_total][status: \"finished\"].set(BackgroundJob.finished.count)\n metrics[:danbooru_background_jobs_total][status: \"discarded\"].set(BackgroundJob.discarded.count)\n\n Ban.pluck(Arel.sql(\"COUNT(*)\")).each do |count|\n metrics[:danbooru_bans_total].set(count)\n end\n\n BulkUpdateRequest.group(:status).pluck(Arel.sql(\"status, COUNT(*)\")).each do |status, count|\n metrics[:danbooru_bulk_update_requests_total][status: status].set(count)\n end\n\n Comment.group(:is_deleted).pluck(Arel.sql(\"is_deleted, COUNT(*)\")).each do |deleted, count|\n metrics[:danbooru_comments_total][deleted: deleted].set(count)\n end\n\n CommentVote.group(:score).active.pluck(Arel.sql(\"score, COUNT(*)\")).each do |score, count, score_sum|\n metrics[:danbooru_comment_votes_total][type: score > 0 ? \"up\" : \"down\"].set(count)\n end\n\n FavoriteGroup.group(:is_public).pluck(Arel.sql(\"is_public, COUNT(*)\")).each do |is_public, count|\n metrics[:danbooru_favorite_groups_total][public: is_public].set(count)\n end\n\n ForumPost.group(:is_deleted).pluck(Arel.sql(\"is_deleted, COUNT(*)\")).each do |deleted, count|\n metrics[:danbooru_forum_posts_total][deleted: deleted].set(count)\n end\n\n ForumTopic.group(:is_deleted).pluck(Arel.sql(\"is_deleted, COUNT(*)\")).each do |deleted, count|\n metrics[:danbooru_forum_topics_total][deleted: deleted].set(count)\n end\n\n MediaAsset.active.group(:file_ext).pluck(Arel.sql(\"file_ext, COUNT(*), SUM(file_size), SUM(image_width*image_height), COALESCE(SUM(duration), 0)\")).each do |file_ext, count, file_size, pixels, duration|\n metrics[:danbooru_media_assets_total][file_ext: file_ext].set(count)\n metrics[:danbooru_media_assets_file_size_bytes_total][file_ext: file_ext].set(file_size)\n metrics[:danbooru_media_assets_pixels_total][file_ext: file_ext].set(pixels)\n metrics[:danbooru_media_assets_duration_seconds_total][file_ext: file_ext].set(duration.round(4))\n end\n\n Post.pluck(Arel.sql(\"SUM(up_score), ABS(SUM(down_score)), SUM(fav_count), COUNT(*) FILTER (WHERE is_pending), COUNT(*) FILTER (WHERE is_flagged), COUNT(*) FILTER (WHERE is_deleted), COUNT(*)\")).each do |upvote_count, downvote_count, favorite_count, pending_count, flagged_count, deleted_count, total_count|\n metrics[:danbooru_post_votes_total][type: \"up\"].set(upvote_count)\n metrics[:danbooru_post_votes_total][type: \"down\"].set(downvote_count)\n metrics[:danbooru_favorites_total].set(favorite_count)\n\n metrics[:danbooru_posts_total][status: \"pending\"].set(pending_count)\n metrics[:danbooru_posts_total][status: \"flagged\"].set(flagged_count)\n metrics[:danbooru_posts_total][status: \"deleted\"].set(deleted_count)\n metrics[:danbooru_posts_total][status: \"active\"].set(total_count - pending_count - deleted_count - flagged_count)\n end\n\n PostAppeal.group(:status).pluck(Arel.sql(\"status, COUNT(*)\")).each do |status, count|\n metrics[:danbooru_post_appeals_total][status: status].set(count)\n metrics[:danbooru_posts_total][status: \"appealed\"].set(count) if status == \"pending\"\n end\n\n PostFlag.group(:status).pluck(Arel.sql(\"status, COUNT(*)\")).each do |status, count|\n metrics[:danbooru_post_flags_total][status: status].set(count)\n end\n\n Note.group(:is_active).pluck(Arel.sql(\"is_active, COUNT(*)\")).each do |active, count|\n metrics[:danbooru_notes_total][deleted: !active].set(count)\n end\n\n NoteVersion.pluck(Arel.sql(\"COUNT(*)\")).each do |count|\n metrics[:danbooru_note_versions_total].set(count)\n end\n\n Pool.group(:category).pluck(Arel.sql(\"category, COUNT(*), SUM(cardinality(post_ids))\")).each do |category, count, post_count|\n metrics[:danbooru_pools_total][category: category].set(count)\n metrics[:danbooru_pools_post_count_total][category: category].set(post_count)\n end\n\n Tag.nonempty.group(:category).pluck(Arel.sql(\"category, COUNT(*), SUM(post_count)\")).each do |category, count, post_count|\n metrics[:danbooru_tags_total][category: TagCategory.reverse_mapping[category]].set(count)\n metrics[:danbooru_tags_post_count_total][category: TagCategory.reverse_mapping[category]].set(post_count)\n end\n\n Upload.group(:status).pluck(Arel.sql(\"status, COUNT(*)\")).each do |status, count|\n metrics[:danbooru_uploads_total][status: status].set(count)\n end\n\n User.pluck(Arel.sql(\"COUNT(*)\")).each do |count|\n metrics[:danbooru_users_total].set(count)\n end\n\n UserFeedback.active.group(:category).pluck(Arel.sql(\"category, COUNT(*)\")).each do |category, count|\n metrics[:danbooru_user_feedbacks_total][category: category].set(count)\n end\n\n WikiPage.group(:is_deleted).pluck(Arel.sql(\"is_deleted, COUNT(*)\")).each do |deleted, count|\n metrics[:danbooru_wiki_pages_total][deleted: deleted].set(count)\n end\n\n WikiPageVersion.pluck(Arel.sql(\"COUNT(*)\")).each do |count|\n metrics[:danbooru_wiki_page_versions_total].set(count)\n end\n\n metrics\n end", "def metric_names\n @metrics.keys\n end", "def report_metrics(metrics=MetricFu.metrics)\n MetricFu.configuration.metrics.sort_by! {|x| x == :hotspots ? 1 : 0 }\n MetricFu.configuration.metrics\n end", "def metric_prefixes\n %w(k M G T P E Z Y)\nend", "def cpu_usage_trend(&_block)\n raise(NotImplementedError, \"#{self.class}##{__method__} implementation not found.\")\n end", "def collect_metrics(name, check_cfg)\n metrics = []\n begin\n # invoke method name method on metric object\n metrics = @metrics.send(name, check_cfg)\n # :nocov:\n rescue NoMethodError => e\n log.error(\n \"Method '#{name}' is not present on Metrics object: '#{e}'\"\n )\n end\n # :nocov:\n metrics\n end", "def delayed_update\n self.delay.update_metrics!\n end", "def register_metrics!\n return if @registered\n @registered = true\n with_instance do |t|\n # Worker related\n t.add_gauge :dynflow_active_workers, 'The number of currently busy workers',\n [:queue, :world]\n t.add_counter :dynflow_worker_events, 'The number of processed events',\n [:queue, :world, :worker]\n\n # Execution plan related\n t.add_gauge :dynflow_active_execution_plans, 'The number of active execution plans',\n [:action, :world, :state]\n t.add_gauge :dynflow_queue_size, 'Number of items in queue',\n [:queue, :world]\n t.add_counter :dynflow_finished_execution_plans, 'The number of execution plans',\n [:action, :world, :result]\n\n # Step related\n # TODO: Configure buckets in a sane manner\n t.add_histogram :dynflow_step_real_time, 'The time between the start end end of the step',\n [:action, :phase]\n t.add_histogram :dynflow_step_execution_time, 'The time spent executing a step',\n [:action, :phase]\n\n # Connector related\n t.add_counter :dynflow_connector_envelopes, 'The number of envelopes handled by a connector',\n [:world, :direction]\n\n # Persistence related\n t.add_histogram :dynflow_persistence, 'The time spent communicating with the database',\n [:world, :method]\n end\n end", "def power_supply_metrics\n super\n end", "def collect_metrics(data: {}, labels: {})\n metric(:pool_jobs_waiting_total)&.observe(data['pool_jobs_waiting_total'].to_i, labels)\n metric(:pool_ready_workers_total)&.observe(data['pool_ready_workers_total'].to_i, labels)\n metric(:pool_workers_total)&.observe(data['pool_workers_total'].to_i, labels)\n metric(:pool_initial_size)&.observe(data['pool_initial_size'].to_i, labels)\n metric(:poll_period)&.observe(data['poll_period'].to_i, labels)\n metric(:thread_pool_exhausted)&.observe(data['thread_pool_exhausted'].to_i, labels)\n end", "def names\n @metrics.keys.dup.freeze\n end", "def metrics_with_methods\n {metrics: @metrics, methods: @methods}\n end", "def metrics_with_methods\n {metrics: @metrics, methods: @methods}\n end", "def metric(name,type,value)\n @metrics[name] = {\n :type => type,\n :value => value\n }\nend", "def statsd_measure(method, name, deprecated_sample_rate_arg = nil, deprecated_tags_arg = nil, as_dist: false,\n sample_rate: deprecated_sample_rate_arg, tags: deprecated_tags_arg, prefix: nil, no_prefix: false)\n\n add_to_method(method, name, :measure) do\n define_method(method) do |*args, &block|\n key = StatsD::Instrument.generate_metric_name(name, self, *args)\n prefix ||= StatsD.prefix\n StatsD.measure( # rubocop:disable StatsD/MeasureAsDistArgument, StatsD/MetricPrefixArgument\n key, sample_rate: sample_rate, tags: tags, prefix: prefix, no_prefix: no_prefix, as_dist: as_dist\n ) do\n super(*args, &block)\n end\n end\n end\n end", "def metrics\n manager_instance(MetricManager)\n end", "def initialize(...)\n @metrics = {}\n register(...)\n end", "def to_metric_ton(**options) = convert_to('metric-ton', **options)", "def registry\n UnicornMetrics::Registry\n end", "def reset_metrics\n flush_cache\n self\n end", "def gauges\n metrics(Gauge)\n end", "def metrics?\n @metrics\n end", "def metrics(data)\n results = Crack::XML.parse(perform('/stats', :data => data))['scores']\n return if results.nil? # we have no stats about our data\n AfterTheDeadline::Metrics.new results['metric']\n end", "def get_metrics metrics, since\n # compute the length of the interval between the last time\n # this monitor ran and now\n last_report_timestamp = accumulators.get(report_timestamp_key).to_i\n now = Time.now.to_i\n interval = now - last_report_timestamp\n\n accumulators.keys.each do |target|\n next if target == report_timestamp_key\n next unless regexp && regexp =~ target\n current_count = accumulators.getset(target, 0) rescue 0.0\n\n # if we don't know when the last time we ran was, we bail,\n # resetting the accumulated count to 0 in preparation for\n # the next iteration\n #\n # we lost a data point this way (say the monitor went down\n # for a while and we brought it back up) but we also don't\n # ruin the scale of the graph...\n next if last_report_timestamp == 0\n \n rate = current_count.to_f / interval.to_f rescue 0.0\n metrics << [target, rate] # no need to scope as targets are pre-scoped\n end\n\n # store the timestamp for this run for the next\n accumulators.set(report_timestamp_key, now)\n end", "def usage_interval\n\n end", "def measure; end", "def metrics\n @metrics ||= Mongo.collection(\"slanger.metrics.data\")\n end", "def [](key)\n @metrics[key]\n end", "def stats\n ## TODO:\n end", "def stats; end", "def stats; end", "def global_cpu_usage_extended_information\n super\n end", "def convert_to_metric(measurement, conversion_factor)\n measurement * conversion_factor\nend", "def convert_to_metric(measurement, conversion_factor)\n measurement * conversion_factor\nend", "def base_metric_name\n nil\n end", "def initialize(metrics)\n @metrics = metrics\n end", "def gc_metrics_enabled?\n gc_metrics_enabled\n end", "def increment_failures_metric\n metric_increment(:failures)\n end", "def to_metric\n Metric.new(\n Instrumentation.series,\n {\n duration: real_time.in_milliseconds.to_i,\n cpu_duration: cpu_time.in_milliseconds.to_i,\n call_count: call_count\n },\n method: @name\n )\n end", "def get_metrics_list\n\t\ttest_file\n\t\t[@metric]\n end", "def counters\n metrics(Counter)\n end", "def get_metric_statistics(options={})\n # Period (60 sec by default)\n period = (options[:period] && options[:period].to_i) || 60\n # Statistics ('Average' by default)\n statistics = Array(options[:statistics]).flatten\n statistics = statistics.blank? ? ['Average'] : statistics.map{|statistic| statistic.to_s.capitalize }\n # Times (5.min.ago up to now by default)\n start_time = options[:start_time] || (Time.now.utc - 5*60)\n start_time = start_time.utc.strftime(\"%Y-%m-%dT%H:%M:%S+00:00\") if start_time.is_a?(Time)\n end_time = options[:end_time] || Time.now.utc\n end_time = end_time.utc.strftime(\"%Y-%m-%dT%H:%M:%S+00:00\") if end_time.is_a?(Time)\n # Measure name\n measure_name = options[:measure_name] || 'CPUUtilization'\n # Dimentions (a hash, empty by default)\n dimentions = options[:dimentions] || {}\n #\n request_hash = { 'Period' => period,\n 'StartTime' => start_time,\n 'EndTime' => end_time,\n 'MeasureName' => measure_name }\n request_hash['Unit'] = options[:unit] if options[:unit]\n request_hash['CustomUnit'] = options[:custom_unit] if options[:custom_unit]\n request_hash['Namespace'] = options[:namespace] if options[:namespace]\n request_hash.merge!(amazonize_list('Statistics.member', statistics))\n # dimentions\n dim = []\n dimentions.each do |key, values|\n Array(values).each { |value| dim << [key, value] }\n end\n request_hash.merge!(amazonize_list(['Dimensions.member.?.Name', 'Dimensions.member.?.Value'], dim))\n #\n link = generate_request(\"GetMetricStatistics\", request_hash)\n request_info(link, GetMetricStatisticsParser.new(:logger => @logger))\n end", "def metric_with_unit(unit)\n metrics.select {|m| Unit.new(m) <=> Unit.new(unit)}\n end", "def gtm_memory_usage_statistics\n super\n end", "def medical_use; end", "def statistics; end", "def all_cpu_usage_extended_information\n super\n end", "def disabled_warnings; end", "def metrics(*args)\n @metrics = args.map { |id| @playground.metric(id) } unless args.empty?\n @metrics\n end", "def set_metrics(metrics, batch)\n _this_ts, label, latency, error, threads, http_code = metrics\n ['ALL', label].each do |key|\n # load test worker threads are recorded at the start of the interval\n batch[key]['threads'] = threads unless batch[key]['threads']\n batch[key]['requests'] += 1\n batch[key]['errors'] += error\n batch[key]['http_code_distribution'][http_code] += 1\n # latency samples are not counted for failed requests\n unless error == 1\n batch[key]['latency_distribution'][latency] += 1\n batch[key]['latency_sum'] += latency\n end\n end\n end", "def metrics=(array=[])\n @metrics = array.map { |m| m.is_a?(Metric) ? m : Metric.by_key(m) }.compact\n end", "def deprecated\n attributes.fetch(:deprecated)\n end", "def deprecated\n attributes.fetch(:deprecated)\n end", "def cpu_usage_information\n super\n end", "def collect(metrics)\n metrics[:polled_total] = rand(100)\n metrics\n end", "def gauge_metrics(metrics, params = { :ago => DEFAULT_RANGE })\n metrics_request_string = metrics.join(',')\n metrics_json = query_api(metrics_request_string, params)\n\n metrics.map { |metric_name| metrics_json[metric_name] }\n end", "def stats\n end", "def stats\n end", "def to_metric\n Metric.new(\n Instrumentation.series,\n {\n duration: real_time,\n cpu_duration: cpu_time,\n call_count: call_count\n },\n method: @name\n )\n end", "def extract_line_metrics(ln)\n raise('Subclass must define extract_line_metrics method')\n end", "def legacy_statistics\n {\n batch_size: batch_size,\n total_batch_size: total_batch_size,\n priority_count: legacy_priority_count\n }\n end", "def http_metrics?\n http_metrics\n end", "def timers\n metrics(Timer)\n end", "def get_metrics_latest\n get_metrics_days_back(45)\n end", "def reset_metrics_buffer\n @@metrics_buffer = []\n end", "def get_metrics_hash(messages)\n metrics = []\n messages.each do |m|\n metric = m['metrics']\n if metric != nil\n metric.each do |name, value|\n\t\t metrics[name] = value\n\t end\n end\n end\n return metrics\n end", "def get_metrics_hash(messages)\n metrics = []\n messages.each do |m|\n metric = m['metrics']\n if metric != nil\n metric.each do |name, value|\n\t\t metrics[name] = value\n\t end\n end\n end\n return metrics\n end", "def meters \n metrics(Meter)\n end", "def enabled_metrics\n @group.enabled_metrics\n end", "def metric_desc\n \"#{config[:metric_name]} for #{config[:efs_name]}\"\n end", "def silence_deprecations; end", "def metric\n if log.dimensions\n name = log.metric.to_s.sub(/\\A\\/+/, '')\n name.gsub!('/', '.')\n hash[:metric] = name\n else\n hash[:metric] = metric_name\n end\n end", "def metrics(*fields)\n @metrics ||= ListParameter.new(:metrics, [])\n @metrics << fields\n end", "def instance_metrics\n metrics = Dir.glob(\"tmp/drb-process-metrics-*.sock\").map do |filename|\n application_metrics = DRbObject.new_with_uri(\"drbunix:#{filename}\")\n application_metrics.update_process_metrics\n rescue IOError, DRb::DRbConnError\n # XXX Ignore any errors we may receive when fetching metrics from a remote process that has shut down (usually by the Puma worker killer)\n Danbooru::Metric::Set.new\n end\n\n metrics.reduce(&:merge) || Danbooru::Metric::Set.new\n end", "def warnings; end", "def warnings; end" ]
[ "0.725618", "0.71900743", "0.71900743", "0.71900743", "0.69524914", "0.6940736", "0.69379634", "0.69339013", "0.67721003", "0.65621305", "0.65298617", "0.64481145", "0.6427784", "0.64030856", "0.6345231", "0.6332598", "0.6320169", "0.62699753", "0.6227215", "0.6115263", "0.6109894", "0.610307", "0.6100838", "0.60598546", "0.60034347", "0.598988", "0.5976324", "0.5974468", "0.5963053", "0.59568846", "0.5956174", "0.59536314", "0.5939604", "0.59325325", "0.5907642", "0.59051216", "0.5902592", "0.5902592", "0.5875188", "0.5866317", "0.5838948", "0.5831339", "0.58191395", "0.5813644", "0.5786929", "0.577871", "0.57640827", "0.57549274", "0.57508814", "0.5745038", "0.57403183", "0.57257366", "0.5715379", "0.57147026", "0.56952584", "0.56952584", "0.56878096", "0.56743574", "0.56743574", "0.5672518", "0.56720823", "0.56719345", "0.5665165", "0.56588113", "0.56346905", "0.5626325", "0.56215066", "0.56160676", "0.5610912", "0.5600381", "0.5598356", "0.5596819", "0.55967265", "0.55917084", "0.55864334", "0.55787426", "0.55733633", "0.55733633", "0.55696523", "0.5569326", "0.55551934", "0.55500764", "0.55500764", "0.5546793", "0.55454683", "0.5544887", "0.554181", "0.5539895", "0.5538775", "0.55329716", "0.552067", "0.552067", "0.5514686", "0.550236", "0.5470039", "0.54682535", "0.54682225", "0.54588366", "0.5458789", "0.5450171", "0.5450171" ]
0.0
-1
method Changed Files and Lines
def getNumberOfChangedFilesAndChangedLines (projectName, localClone, pathInput, pathOutput) prefixProjectName = formatProjectName(projectName) filesList = [] dataList = [] countTemp = 0 #_ParentsFiles File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |fileMerges| while line = fileMerges.gets fileMerges.each_line do |line| camposMerge = line.split(",") File.open(localClone+pathInput+prefixProjectName+"_MergeScenarioList.csv", 'r') do |fileTEMP| while lineTEMP = fileTEMP.gets fileTEMP.each_line do |lineTEMP| camposParents = lineTEMP.split(",") if (camposMerge[0].eql? camposParents[0]) data = camposMerge[0].gsub("\"", "").gsub("\n","")+","+camposMerge[1].gsub("\"", "").gsub("\n","")+","+camposMerge[10].gsub("\"", "").gsub("\n","")+","+camposMerge[11].gsub("\"", "").gsub("\n","")+","+camposParents[4].gsub("\"", "").gsub("\n","")+","+camposParents[6].gsub("\"", "").gsub("\n","") dataList.push(data) countTemp +=1 end end end end end end end File.open(localClone+pathOutput+prefixProjectName+"_CommitListAndFilesList.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, listLeftCommits, listRightCommits, leftFiles, rightFiles" dataList.each do |dado| file.puts "#{dado}" end end projectsList = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitListAndFilesList.csv", 'r') do |f1| while line = f1.gets f1.each_line do |line| campos = line.split(",")#.length mergeCommitID = campos[0].gsub("\r","").gsub("\n","") isConflicting = campos[1].gsub("\r","").gsub("\n","") leftCommits = campos[2].split("@@") rightCommits = campos[3].split("@@") leftFiles = campos[4][1..campos[4].length-2].split("@") if !campos[5].include?("\n") rightFiles = campos[5][1..campos[5].length-2].split("@") else rightFiles = campos[5][1..campos[5].length-3].split("@") end #leftFiles=[] countLeftLines =0 countRightLines=0 #rightFiles arithmeticMeanChangedFiles = 0 geometricMeanChangedFiles = 0 if leftCommits.include?("\n") leftCommits.delete("\n") end if rightCommits.include?("\n") rightCommits.delete("\n") end leftCommits.each do |commit| data = %x(git --no-pager log -1 --stat #{commit}) listInfo = data.split("\n") leftFiles.each do |f| listInfo.each do |item| if item.include?(f+" ") and item.include?("|") and (!f.include?(".bmp") and !f.include?(".dib") and !f.include?(".jpg") and !f.include?(".jpeg") and !f.include?(".jpe") and !f.include?(".jfif") and !f.include?(".gif") and !f.include?(".tif") and !f.include?(".tiff") and !f.include?(".png") and !f.strip.eql?("Gemfile.lock")) tmpItem = item.split("|") countLeftLines += tmpItem[1][/\d+/].to_i end end end end rightCommits.each do |commit| data = %x(git --no-pager log -1 --stat #{commit}) listInfo = data.split("\n") rightFiles.each do |f| listInfo.each do |item| if item.include?(f+" ") and item.include?("|") and (!f.include?(".bmp") and !f.include?(".dib") and !f.include?(".jpg") and !f.include?(".jpeg") and !f.include?(".jpe") and !f.include?(".jfif") and !f.include?(".gif") and !f.include?(".tif") and !f.include?(".tiff") and !f.include?(".png") and !f.strip.eql?("Gemfile.lock")) tmpItem = item.split("|") countRightLines += tmpItem[1][/\d+/].to_i end end end end if (countLeftLines == 0) countLeftLines = 1 end if (countRightLines == 0) countRightLines = 1 end arithmeticMeanChangedLines = (Float(countLeftLines + countRightLines)/2).round(2) geometricMeanChangedLines = Math.sqrt(Float(countLeftLines*countRightLines)).round(2) dados = mergeCommitID+","+isConflicting+","+"#{countLeftLines}"+","+"#{countRightLines}"+","+"#{arithmeticMeanChangedLines}"+","+"#{geometricMeanChangedLines}" projectsList.push(dados.gsub("\"", "")) end end end File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedLines.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, countLeftLines, countRightLines, arithmeticMeanChangedLines, geometricMeanChangedLines" projectsList.each do |dado| file.puts "#{dado}" end end projectsList = [] projectsFilesList = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitListAndFilesList.csv", 'r') do |f1| while line = f1.gets f1.each_line do |line| campos = line.split(",")#.length mergeCommitID = campos[0].gsub("\r","").gsub("\n","") isConflicting = campos[1].gsub("\r","").gsub("\n","") leftFiles = campos[4].split("@") rightFiles = campos[5].split("@") countLeftFiles = leftFiles.length countRightFiles = rightFiles.length arithmeticMeanChangedFiles = 0 geometricMeanChangedFiles = 0 arithmeticMeanChangedFiles = (Float(countLeftFiles + countRightFiles)/2).round(2) geometricMeanChangedFiles = Math.sqrt(Float(countLeftFiles*countRightFiles)).round(2) dados = mergeCommitID+","+isConflicting+","+"#{countLeftFiles}"+","+"#{countRightFiles}"+","+"#{arithmeticMeanChangedFiles}"+","+"#{geometricMeanChangedFiles}" projectsFilesList.push(dados.gsub("\"", "")) end end end File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedFiles.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, countLeftFiles, countRightFiles, arithmeticMeanChangedFiles, geometricMeanChangedFiles" projectsFilesList.each do |dado| file.puts "#{dado}" end end puts "end running getNumberOfChangedFilesAndChangedLines from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def modified_files; end", "def on_change(modified, added, deleted)\n # Modifications and additions are treated the same.\n (modified + added).uniq.each do |path|\n if file = Ichiban::ProjectFile.from_abs(path)\n begin\n @loader.change(file) # Tell the Loader that this file has changed\n file.update\n rescue Exception => exc\n Ichiban.logger.exception(exc)\n end\n end\n end\n \n # Deletions are handled specially.\n deleted.each do |path|\n Ichiban::Deleter.new.delete_dest(path)\n end\n \n # Finally, propagate this change to any dependent files.\n (modified + added + deleted).uniq.each do |path|\n begin\n Ichiban::Dependencies.propagate(path)\n rescue => exc\n Ichiban.logger.exception(exc)\n end\n end\n end", "def change_lines_in_file(file_path, &change)\n print \"Fixing #{file_path}...\\n\"\n\n contents = []\n\n file = File.open(file_path, 'r')\n file.each_line do | line |\n contents << line\n end\n file.close\n\n File.open(file_path, 'w') do |f|\n f.puts(change.call(contents))\n end\nend", "def change_lines_in_file(file_path, &change)\n print \"Fixing #{file_path}...\\n\"\n \n contents = []\n \n file = File.open(file_path, 'r')\n file.each_line do | line |\n contents << line\n end\n file.close\n \n File.open(file_path, 'w') do |f|\n f.puts(change.call(contents))\n end\nend", "def source_change(change, filename)\n end", "def change_lines_in_file(file_path, &change)\n print \"Fixing #{file_path}...\\n\"\n\n contents = []\n\n file = File.open(file_path, 'r')\n file.each_line do |line|\n contents << line\n end\n file.close\n\n File.open(file_path, 'w') do |f|\n f.puts(change.call(contents))\n end\n end", "def lex\n file_beg_changed\n notify_file_beg_observers(@file_name)\n\n super\n\n file_end_changed\n notify_file_end_observers(count_trailing_newlines(@original_file_text))\n end", "def show_changed_files(status)\n status.each_line do |line|\n if line =~ /^#\\t/ # only print out the changed files (I think)\n if line =~ /new file:|modified:|deleted:/\n puts \" #{line}\" \n else\n puts \" #{line.chop}\\t\\t(may need to be 'git add'ed)\" \n end\n end\n end\nend", "def run_on_change(paths)\n end", "def updated_source_file; end", "def changed_files\n DeliveryTruck::Helpers.changed_files(\n DeliveryTruck::Helpers.pre_change_sha(node),\n node['delivery']['change']['sha'],\n node\n )\n end", "def each_change\n old_ln = old_ln_cache = 0\n new_ln = new_ln_cache = 0\n\n @changes.each_with_index do |line, i|\n if line =~ /@ -(\\d+),\\d+ \\+(\\d+),\\d+/\n old_ln_cache = $1.to_i\n new_ln_cache = $2.to_i\n end\n\n type = LINE_TYPES[line[0]]\n case type\n when :add\n old_ln = ''\n new_ln = new_ln_cache\n new_ln_cache += 1\n when :del\n old_ln = old_ln_cache\n old_ln_cache += 1\n new_ln = ''\n when :info\n old_ln = new_ln = '...'\n else\n new_ln = new_ln_cache\n old_ln = old_ln_cache\n old_ln_cache += 1\n new_ln_cache += 1\n end\n\n yield(line, type, @index + i, old_ln, new_ln)\n end\n end", "def modified_files(options); end", "def modified_files(options); end", "def edited(&block)\n self.listen_to :event => :lineupdated, &block\n end", "def notify_line(lineno, count, text)\n unless @path_notified\n Concov.error(\"path of original source code is not found\") \n end\n\n @blk.call(:line, lineno, count, text)\n end", "def make line_to_change, phrase_we_have_now, phrase_we_want_to_have, file_path\n verbose = $conf[:verbose]\n if verbose\n puts \"\\e[39m-----------------------------\"\n puts \"I'm changing:\\n#{phrase_we_have_now}\"\n puts '-----------------------------'\n puts \"to:\\n#{phrase_we_want_to_have}\"\n puts '-----------------------------'\n end\n\n #Change every occurence\n puts \"in file:\\n#{file_path}\" if verbose\n data = File.read(file_path)\n puts \"\\n\\e[31m++Old version: \\e[30m\\n\" if verbose\n puts data + \"\\n\" if verbose\n\n line_changed = line_to_change.gsub(phrase_we_have_now, phrase_we_want_to_have)\n data.sub! line_to_change, line_changed\n\n puts \"\\n\\e[32m++New version: \\e[30m\\n\" if verbose\n puts data + \"\\n\" if verbose\n puts \"\\e[31mOld line:\\n #{line_to_change}\\e[32m\\nNew line:\\n#{line_changed}\\e[30m\" #Standard info. verbose = true -> shows all file\n #Write the file\n res = false\n res = File.open(file_path, \"w\") do |f|\n f.write(data)\n end\n if res\n return true\n end\n false\n end", "def run_on_change(paths)\n copy_all_functions \"Functions have changed, copying over\"\n end", "def path_changed(p_index)\n\t\t\n\t\t\t# Enable Ok Button, release Keyboard from Line Edit\n\t\t\[email protected](true)\n\t\t\n\t\t\t# Get Path for the clicked File\n\t\t\t@path = @shell_tree_view.model.fileInfo(p_index).canonicalFilePath\n\t\t\t\n\t\t\t# Reverse slashes if on Windows, looks more \"native\"\n\t\t\[email protected]!(\"/\", \"\\\\\") unless @path.nil? || !@is_win32 \n\t\t\t\n\t\t\t# Set text, if valid\n\t\t\t@path_edit.setText(@path) if @path.is_a?(String)\n\t\tend", "def files_changed(file, event)\n puts motivate\n # return true so that the watch loop keeps running\n return true\n end", "def altered_files\n raise NotImplementedError.new(\"altered_files() must be implemented by subclasses of AbstractChangeset.\")\n end", "def updated_source_file?; end", "def altered_files\n parse!\n @altered_files\n end", "def replaced_files; end", "def file_watcher; end", "def file_watcher; end", "def on_file_changed(content, out, path)\n SpacewalkHtmlClean.generate_diff(content, out, path)\n end", "def emit_changed(stuff) \n\t\tif stuff == nil\n\t\t\t@changed_handler.call(RangeList.new((0...num_lines)))\n\t\telse\n\t\t\t@changed_handler.call(RangeList.new(stuff))\n\t\tend\n\tend", "def changed_files\n until @changed.empty?\n descriptor = @changed.shift\n file = @watcher.watch_descriptors.delete(descriptor)\n watch(file)\n yield(file)\n end\n end", "def update!(**args)\n @file = args[:file] if args.key?(:file)\n @line = args[:line] if args.key?(:line)\n @function_name = args[:function_name] if args.key?(:function_name)\n end", "def extract_modified_lines(file_path, options); end", "def extract_modified_lines(file_path, options); end", "def changed_files\n # FIXME: Implement properly once changed detection is available.\n files\n end", "def lines_affected\n @lines_affected = line_codes_affected.map {|l| Line.get(l.strip)}\n end", "def modified_lines_in_file(_file)\n EMPTY_SET\n end", "def update!(**args)\n @file = args[:file] if args.key?(:file)\n @function = args[:function] if args.key?(:function)\n @line = args[:line] if args.key?(:line)\n end", "def changed_files\n @files.each do |file, stat|\n if new_stat = safe_stat(file)\n if new_stat.mtime > stat.mtime\n @files[file] = new_stat\n yield(file)\n end\n end\n end\n end", "def modify_lines (code)\n line_number = 0\n event_number = 0\n initial_line_number = @list_of_events[0].line_number\n @list_of_events.each do |modify|\n temp_string = modify.trace\n temp_line = modify.line_number\n line_number = temp_line % initial_line_number\n if code[line_number] == 'newline' || code[line_number] == '\\\\t'\n line_number += 1\n else\n original_line = temp_line.to_s\n new_line = line_number.to_s\n temp_string.gsub! original_line, new_line\n modified_event = Event.new\n modified_event.set_event(temp_string)\n modified_event.set_line(line_number)\n @list_of_events[event_number] = modified_event\n event_number += 1\n end\n end\n end", "def edit_verse()\n\n# @todo refactor to recognise file values using isMap rather than the string prefix\n# @todo refactor the Remove, Show, Read and Write use cases as well as this one.\n\n exit(100) unless has_line?()\n\n current_value = @verse[ @now_name ]\n\n# @todo instead of store and delete use the hash key rename method\n @verse.store( @new_name, current_value ) unless is_file?()\n @verse.store( \"#{Indices::INGESTED_FILE_LINE_NAME_KEY}#{@new_name}\", current_value ) if is_file?()\n\n @verse.delete( \"#{Indices::INGESTED_FILE_LINE_NAME_KEY}#{@now_name}\" )\n @verse.delete( @now_name )\n\n end", "def on_change(modified, added, removed)\n # Puase the listener to avoid spurious triggers from build output\n @listener.pause if @listener\n \n # summarise the changes made\n changes = modified + added + removed\n \n statusline = ('-' * removed.length).red\n statusline << ('.' * modified.length).blue\n statusline << ('+' * added.length).green\n puts \"#{statusline} #{changes.length.to_s.magenta.bold} changes\"\n \n @config.hooks.each do |hook|\n hook.run changes\n end\n\n run_command\n \n # return to listening\n @listener.unpause if @listener\n rescue Exception => e\n puts e.message\n puts e.backtrace\n end", "def process(orig_file)\n end", "def update!(**args)\n @file_path = args[:file_path] if args.key?(:file_path)\n @function_name = args[:function_name] if args.key?(:function_name)\n @line_number = args[:line_number] if args.key?(:line_number)\n end", "def refs(file, line, col); end", "def refs(file, line, col); end", "def altered_files; raw_changeset.files; end", "def modified_lines_in_file(file)\n subcmd = 'show --format=%n'\n @modified_lines ||= {}\n @modified_lines[file] ||=\n Overcommit::GitRepo.extract_modified_lines(file, subcmd: subcmd)\n end", "def run_on_change(paths)\n jammit\n end", "def refresh!\n @lines = load_from_file\n end", "def file_changed(choo_file, lab)\n file = choo_file.filename\n file = \"\" \n if file == nil\n lab.text = file\n end\nend", "def run_on_change(paths)\n UI.info \"Functions have changed, copying over\"\n ::Forge::Guard.builder.clean_functions\n ::Forge::Guard.builder.copy_functions\n ::Forge::Guard.builder.clean_includes\n ::Forge::Guard.builder.copy_includes\n end", "def cmd_after_replace(file, lineno, content, cmd)\n change_line(file, lineno, content)\n cmd\n end", "def git_modified_files_info()\n modified_files_info = Hash.new\n updated_files = (git.modified_files - git.deleted_files) + git.added_files\n updated_files.each {|file|\n modified_lines = git_modified_lines(file)\n modified_files_info[File.expand_path(file)] = modified_lines\n }\n modified_files_info\n end", "def on_other_file; end", "def original_line; end", "def updated_lines\n io = @diff.each_line\n path = nil\n\n found = []\n\n while true\n line = io.next\n if line =~ FILE_PATTERN\n path = $1\n end\n\n if hunk_header?(line)\n line_numbers = line_numbers_for_destination(line)\n found << [ path, line_numbers ]\n end\n end\n rescue StopIteration\n return found\n end", "def ask_for_several_change_in_file line_to_change, file_path\n if @change_all\n puts \"\\n\\e[39m******************************************\"\n puts '* *'\n puts '* Automatically changes has been started *'\n puts '* *'\n puts \"\\nFile: #{file_path}\\n\\n\"\n return true\n end\n puts \"\\n\\e[39m******************************************\"\n puts '* *'\n puts '* Follow the instructions below to *'\n puts '* make changes in file *'\n puts \"\\nPhrase:\\n #{line_to_change}\\nfound in file:\\n#{file_path}\\n\"\n print \"\\e[31m\\e[1;4m\\nDo I have to change this phrase [y/n/all] (default \\e[32m\\e[1;4mYes\\e[31m) ?\\n\"\n choise = STDIN.gets.chomp.upcase\n res = false\n if choise == 'Y' || choise.length == 0\n res = true\n elsif choise == 'A'\n res = true\n @change_all = true\n end\n res\n end", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def changed\n @deleted = false\n @changed = true\n end", "def modified?; end", "def altered_files; (modified + added + removed).sort; end", "def run_on_changes(paths)\n run(paths)\n end", "def new_files; end", "def changed_paths_check(revision,repo)\n `svnlook changed -r #{revision} #{repo}`.split(\"\\n\")\n end", "def file_line=(_arg0); end", "def changed?\n @changed ||= sorted_file != IO.read(file)\n end", "def cmd_changed\n print_tree(ChangedEditor, nil, true)\n end", "def scan_changed(&block) # :yields: file\n known_files.each do |known_file|\n new_mtime = mtime_for(known_file)\n if new_mtime != last_mtime[known_file]\n block.call(known_file)\n last_mtime[known_file]= new_mtime\n end\n end\n end", "def git_changed_line\n `git diff | grep ' #{name} (' | grep '+ '`\n end", "def finished_file(_file, _lints); end", "def _increment_file_line()\n\t\t@reading_line += 1\n\tend", "def change_line(file, lineno, new_line)\n lines = File.readlines(file).tap { |c| c[lineno - 1] = \"#{new_line}\\n\" }\n\n File.open(file, \"w\") { |f| f.write(lines.join) }\n end", "def patch_lines\n old_line, new_line = old_start, new_start\n \n old_lines = diff.old_object && diff.old_object.data_lines\n new_lines = diff.new_object && diff.new_object.data_lines\n \n diff_data = summary.split(/(\\d+)/)\n lines = []\n i = 0\n while i < diff_data.length\n line_type, line_count = diff_data[i][0], diff_data[i + 1].to_i\n i += 2\n line_count.times do\n case line_type\n when ?+\n line = [nil, new_line, nil, nil]\n new_line += 1\n when ?-\n line = [old_line, nil, nil, nil]\n old_line += 1\n when ?\\\\\n newline_text = '\\\\ No newline at end of file'\n line = [old_line, new_line, newline_text, newline_text]\n else\n line = [old_line, new_line, nil, nil]\n old_line += 1\n new_line += 1\n end\n line[2] ||= line[0] && old_lines[line[0] - 1]\n line[3] ||= line[1] && new_lines[line[1] - 1]\n lines << line\n end\n end\n lines\n end", "def modified_lines_in_file(file)\n staged = squash?\n refs = 'HEAD^ HEAD' if merge_commit?\n @modified_lines ||= {}\n @modified_lines[file] ||=\n Overcommit::GitRepo.extract_modified_lines(file, staged: staged, refs: refs)\n end", "def run_on_changes(paths)\n run_all()\n end", "def edit_file( path)\n\t\tVim::command(\"edit #{path}\")\n\tend", "def changed\n _find_changed_twins!(@_changes)\n\n @_changes\n end", "def test_changed\n dir = \"changed_dir\"\n dir1 = \"changed_dir1\"\n dir2 = \"changed_dir2\"\n dir_path = File.join(@wc_path, dir)\n dir1_path = File.join(@wc_path, dir1)\n dir2_path = File.join(@wc_path, dir2)\n dir_svn_path = dir\n dir1_svn_path = dir1\n dir2_svn_path = dir2\n\n file1 = \"changed1.txt\"\n file2 = \"changed2.txt\"\n file3 = \"changed3.txt\"\n file4 = \"changed4.txt\"\n file5 = \"changed5.txt\"\n file1_path = File.join(@wc_path, file1)\n file2_path = File.join(dir_path, file2)\n file3_path = File.join(@wc_path, file3)\n file4_path = File.join(dir_path, file4)\n file5_path = File.join(@wc_path, file5)\n file1_svn_path = file1\n file2_svn_path = [dir_svn_path, file2].join(\"/\")\n file3_svn_path = file3\n file4_svn_path = [dir_svn_path, file4].join(\"/\")\n file5_svn_path = file5\n\n first_rev = nil\n\n log = \"added 3 dirs\\nanded 5 files\"\n make_context(log) do |ctx|\n\n ctx.mkdir([dir_path, dir1_path, dir2_path])\n\n FileUtils.touch(file1_path)\n FileUtils.touch(file2_path)\n FileUtils.touch(file3_path)\n FileUtils.touch(file4_path)\n FileUtils.touch(file5_path)\n ctx.add(file1_path)\n ctx.add(file2_path)\n ctx.add(file3_path)\n ctx.add(file4_path)\n ctx.add(file5_path)\n\n commit_info = ctx.commit(@wc_path)\n first_rev = commit_info.revision\n\n editor = traverse(Svn::Delta::ChangedEditor, commit_info.revision, true)\n assert_equal([\n file1_svn_path, file2_svn_path,\n file3_svn_path, file4_svn_path,\n file5_svn_path,\n ].sort,\n editor.added_files)\n assert_equal([], editor.updated_files)\n assert_equal([], editor.deleted_files)\n assert_equal([].sort, editor.updated_dirs)\n assert_equal([].sort, editor.deleted_dirs)\n assert_equal([\n \"#{dir_svn_path}/\",\n \"#{dir1_svn_path}/\",\n \"#{dir2_svn_path}/\"\n ].sort,\n editor.added_dirs)\n end\n\n log = \"deleted 2 dirs\\nchanged 3 files\\ndeleted 2 files\\nadded 3 files\"\n make_context(log) do |ctx|\n\n dir3 = \"changed_dir3\"\n dir4 = \"changed_dir4\"\n dir3_path = File.join(dir_path, dir3)\n dir4_path = File.join(@wc_path, dir4)\n dir3_svn_path = [dir_svn_path, dir3].join(\"/\")\n dir4_svn_path = dir4\n\n file6 = \"changed6.txt\"\n file7 = \"changed7.txt\"\n file8 = \"changed8.txt\"\n file9 = \"changed9.txt\"\n file10 = \"changed10.txt\"\n file6_path = File.join(dir_path, file6)\n file7_path = File.join(@wc_path, file7)\n file8_path = File.join(dir_path, file8)\n file9_path = File.join(dir_path, file9)\n file10_path = File.join(dir_path, file10)\n file6_svn_path = [dir_svn_path, file6].join(\"/\")\n file7_svn_path = file7\n file8_svn_path = [dir_svn_path, file8].join(\"/\")\n file9_svn_path = [dir_svn_path, file9].join(\"/\")\n file10_svn_path = [dir_svn_path, file10].join(\"/\")\n\n File.open(file1_path, \"w\") {|f| f.puts \"changed\"}\n File.open(file2_path, \"w\") {|f| f.puts \"changed\"}\n File.open(file3_path, \"w\") {|f| f.puts \"changed\"}\n ctx.rm_f([file4_path, file5_path])\n FileUtils.touch(file6_path)\n FileUtils.touch(file7_path)\n FileUtils.touch(file8_path)\n ctx.add(file6_path)\n ctx.add(file7_path)\n ctx.add(file8_path)\n ctx.cp(file1_path, file9_path)\n ctx.cp(file2_path, file10_path)\n ctx.mv(dir2_path, dir3_path)\n ctx.cp(dir1_path, dir4_path)\n ctx.rm(dir1_path)\n\n commit_info = ctx.commit(@wc_path)\n second_rev = commit_info.revision\n\n editor = traverse(Svn::Delta::ChangedEditor, commit_info.revision, true)\n assert_equal([file1_svn_path, file2_svn_path, file3_svn_path].sort,\n editor.updated_files)\n assert_equal([file4_svn_path, file5_svn_path].sort,\n editor.deleted_files)\n assert_equal([file6_svn_path, file7_svn_path, file8_svn_path].sort,\n editor.added_files)\n assert_equal([].sort, editor.updated_dirs)\n assert_equal([\n [file9_svn_path, file1_svn_path, first_rev],\n [file10_svn_path, file2_svn_path, first_rev],\n ].sort_by{|x| x[0]},\n editor.copied_files)\n assert_equal([\n [\"#{dir3_svn_path}/\", \"#{dir2_svn_path}/\", first_rev],\n [\"#{dir4_svn_path}/\", \"#{dir1_svn_path}/\", first_rev],\n ].sort_by{|x| x[0]},\n editor.copied_dirs)\n assert_equal([\"#{dir1_svn_path}/\", \"#{dir2_svn_path}/\"].sort,\n editor.deleted_dirs)\n assert_equal([].sort, editor.added_dirs)\n end\n end", "def lines; end", "def lines; end", "def changes\n additions + deletions\n end", "def added_change what, from_start, from_end, to_start, to_end = nil\n make_fdiff_change format(added_msg_fmt, what), from_start, from_end, to_start, to_end || loctext(to_start, what)\n end", "def file_watcher=(_arg0); end", "def file_watcher=(_arg0); end", "def lint_lines(_lines)\n raise NotImplementedError, \"must implement ##{__method__}\"\n end", "def update_line_numbers!\n each_with_index do |lo, new_line_number|\n lo.line_number = new_line_number\n end\n end", "def changeset\n raise NotImplementedError.new(\"changeset() must be implemented by subclasses of AbstractVersionedFile.\")\n end", "def update!(**args)\n @line = args[:line] if args.key?(:line)\n end", "def run_on_change(paths)\n perform\n end", "def run\n # Try to get the diff_filename and open it for the comparison\n # And if this is the first time the import is run, there wont be any diff_filename whatsoever, so we loop from the file directly =)\n get_diff_from_previous_file if @diff_filename.nil?\n \n # If this is run for the first time, we are not gonna have the diff_file, so\n # What we are doing is to read all of the lines, and put them under \"added\" section\n if (File.file? @diff_filename)\n # Parse the diff file\n parse_diff \n else\n # We read it from the file directly\n parse_file\n end\n \n # Return with the hash representation of the difference\n return self.line_diff\n end", "def file_changed(start_commit, end_commit, filepath)\n command = \"git diff --name-only '#{start_commit}..#{end_commit}' -- #{filepath}\"\n changed_file = `#{command}`.strip\n return !changed_file.empty?\n end", "def update_info_from_file()\n @ole.UpdateInfoFromFile()\n end", "def callback(paths, ignores, modified)\n @logger.info(\"File change callback called!\")\n @logger.info(\" - Paths: #{paths.inspect}\")\n @logger.info(\" - Ignores: #{ignores.inspect}\")\n @logger.info(\" - Modified: #{modified.inspect}\")\n\n tosync = []\n paths.each do |hostpath, folders|\n # Find out if this path should be synced\n found = catch(:done) do\n modified.each do |changed|\n match = nil\n ignores.each do |ignore|\n next unless match.nil?\n match = ignore.match(changed)\n end\n\n next unless match.nil?\n throw :done, true if changed.start_with?(hostpath)\n end\n\n # Make sure to return false if all else fails so that we\n # don't sync to this machine.\n false\n end\n\n # If it should be synced, store it for later\n tosync << folders if found\n end\n\n # Sync all the folders that need to be synced\n tosync.each do |folders|\n folders.each do |opts|\n ssh_info = opts[:machine].ssh_info\n do_rsync(opts[:machine], ssh_info, opts[:opts]) if ssh_info\n end\n end\n end", "def run_on_changes(paths)\n restart\n end", "def update_file(filename, old, replacement)\n\n#filename = (File.expand_path(filename))\n\n#file_temp = Tempfile.new('temp')\n\nFileUtils.mv(filename, filename + '.temp')\n\nFile.open(filename, 'w') do |line|\n\n IO.foreach(file_temp) do |line_temp|\n line_temp.gsub!(/#{old}/, replacement) if line_temp =~ /#{old}/ \n line << line_temp\n end\n\nend\n\nFileUtils.rm(filename + \".temp\", :force => true)\n\n#file_temp.unlink\n\nend", "def change(file)\n @previous = dup if change?(file)\n set(file)\n end", "def update_file\n output = (@blocks[:before] + @blocks[:attributes] + @blocks[:after]).join(\"\\n\").strip + \"\\n\"\n File.open(@filename,'w') { |f| f.write(output) } if output != @file\n end", "def changed_files(parent_sha, change_sha, node)\n response = shell_out!(\n \"git diff --name-only #{parent_sha} #{change_sha}\",\n :cwd => node['delivery']['workspace']['repo']\n ).stdout.strip\n\n changed_files = []\n response.each_line do |line|\n changed_files << line.strip\n end\n changed_files\n end", "def git_modified_lines(file)\n git_range_info_line_regex = /^@@ .+\\+(?<line_number>\\d+),/ \n git_modified_line_regex = /^\\+(?!\\+|\\+)/\n git_removed_line_regex = /^[-]/\n git_not_removed_line_regex = /^[^-]/\n file_info = git.diff_for_file(file)\n line_number = 0\n lines = []\n file_info.patch.split(\"\\n\").each do |line|\n starting_line_number = 0\n case line\n when git_range_info_line_regex\n starting_line_number = Regexp.last_match[:line_number].to_i\n when git_modified_line_regex\n lines << line_number\n end\n line_number += 1 if line_number > 0\n line_number = starting_line_number if line_number == 0 && starting_line_number > 0\n end\n lines\n end" ]
[ "0.7013519", "0.6924939", "0.68323964", "0.68219936", "0.67926556", "0.6636241", "0.6588556", "0.6538642", "0.64429504", "0.64199746", "0.6405246", "0.63697565", "0.63362575", "0.63362575", "0.6287588", "0.62289083", "0.6203389", "0.6201734", "0.619699", "0.6153621", "0.61291146", "0.6080268", "0.60395205", "0.6008695", "0.5998043", "0.5998043", "0.59776664", "0.5923819", "0.5914925", "0.58963794", "0.58961993", "0.58961993", "0.58705175", "0.58534956", "0.5851934", "0.58371156", "0.5816366", "0.5811949", "0.58113736", "0.5800933", "0.5800675", "0.579778", "0.57960284", "0.57960284", "0.5777539", "0.5770061", "0.576625", "0.57620984", "0.5750958", "0.5741024", "0.5733695", "0.57000494", "0.5698347", "0.5678359", "0.56685984", "0.56644887", "0.5664374", "0.5664374", "0.5664374", "0.5664374", "0.5658811", "0.5652988", "0.56379235", "0.5635755", "0.56283754", "0.5624403", "0.5622268", "0.5618797", "0.5588335", "0.55778605", "0.5571456", "0.5557837", "0.5556612", "0.55502045", "0.55487853", "0.55134165", "0.55066955", "0.55046445", "0.55009675", "0.5474908", "0.5472771", "0.5472771", "0.54590124", "0.54574037", "0.54548824", "0.54548824", "0.545213", "0.5438211", "0.5437851", "0.54237884", "0.54205805", "0.5413436", "0.5397184", "0.539602", "0.53953624", "0.53919756", "0.53850293", "0.53779936", "0.5373748", "0.53637815", "0.5349698" ]
0.0
-1
Generate a single CSV file (one for each project) with all grouped metrics for statistical analysis. It can be used to evaluate individual projects that compose the aggregated sample.
def generateCVSToStatisticAnalysis (projectName, localClone, pathInput,pathOutput) prefixProjectName = formatProjectName(projectName) listSlices = [] listConflictsAndFiles = [] listNumberOfCommits = [] listNumberOfAuthors = [] listDelayDeltaIntegration = [] listMinimumLifeTime = [] listNmberOfChangedFiles = [] listNumberOfChangedLines = [] listContributionConclusionDelay = [] listPackages = [] File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathInput+prefixProjectName+".csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","") isConflicting = "0" if camposMainMerge[1].gsub("\"","").eql?("true") isConflicting = "1" end existsCommonSlice = camposAuxMerge[2].gsub("\"","") totalCommonSlices = camposAuxMerge[3].gsub("\"","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices listSlices.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_Slices.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices" listSlices.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_Slices.csv", 'r') do |mainMerges| #while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") dados="" if camposMainMerge[1].gsub("\"","").gsub("\n","").eql?("0") mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = "0" conflictsNumber = "0" dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber listConflictsAndFiles.push(dados) elsif camposMainMerge[1].gsub("\"","").gsub("\n","").eql?("1") File.open(localClone+pathInput+prefixProjectName+"_MergeScenarioList.csv", 'r') do |auxMerges| # while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") #conflictingFilesNumber = camposAuxMerge[1].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposAuxMerge[2].to_s.split("@").length.to_s #.gsub("\"","").gsub("\n","") conflictsNumber = camposAuxMerge[8].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber listConflictsAndFiles.push(dados) end end #each_line # end #while end # File.open end# elsif end #each_line # end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ConflictingFilesAndConflicts.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber" listConflictsAndFiles.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ConflictingFilesAndConflicts.csv", 'r') do |mainMerges| #while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_CommitList.csv", 'r') do |auxMerges| # while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposAuxMerge[8].gsub("\"","").gsub("\n","")#8 numberOfCommitsGeoAverage = camposAuxMerge[9].gsub("\"","").gsub("\n","")#8#9 dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage listNumberOfCommits.push(dados) end end #each_line # end #while end # File.open end #each_line # end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfCommits.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage" listNumberOfCommits.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfCommits.csv", 'r') do |mainMerges| #while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_AuthorList.csv", 'r') do |auxMerges| # while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposAuxMerge[6].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage listNumberOfAuthors.push(dados) end end #each_line # end #while end # File.open end #each_line # end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfAuhtors.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage" listNumberOfAuthors.each do |dado| file.puts "#{dado}" end end # Deprecated - generate csv with delay and delta integration - metrics not used anymore File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfAuhtors.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_DelayDeltaIntegrationList.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") deltaIntegration = camposAuxMerge[6].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration listDelayDeltaIntegration.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_DelayAndDeltaIntegration.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration" listDelayDeltaIntegration.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_DelayAndDeltaIntegration.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_LifetimeAuthorDateList.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage listMinimumLifeTime.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_MinimumLifeTime.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage" listMinimumLifeTime.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_MinimumLifeTime.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedFiles.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage listNmberOfChangedFiles.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedFiles.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage" listNmberOfChangedFiles.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedFiles.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_NumberOfChangedLines.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposMainMerge[15].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposMainMerge[16].gsub("\"","").gsub("\n","") numberOfChangedLinesArithAverage = camposAuxMerge[4].gsub("\"","").gsub("\n","") numberOfChangedLinesGeoAverage = camposAuxMerge[5].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage listNumberOfChangedLines.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedLines.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage, numberOfChangedLinesArithAverage, numberOfChangedLinesGeoAverage" listNumberOfChangedLines.each do |dado| file.puts "#{dado}" end end File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_NumberOfChangedLines.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathOutput+prefixProjectName+"_ContributionConclusionDelayList.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposMainMerge[15].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposMainMerge[16].gsub("\"","").gsub("\n","") numberOfChangedLinesArithAverage = camposMainMerge[17].gsub("\"","").gsub("\n","") numberOfChangedLinesGeoAverage = camposMainMerge[18].gsub("\"","").gsub("\n","") contributionConclusionDelay = camposAuxMerge[4].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage+","+contributionConclusionDelay listContributionConclusionDelay.push(dados) end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ContributionConclusionDelay.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage, numberOfChangedLinesArithAverage, numberOfChangedLinesGeoAverage, contributionConclusionDelay" listContributionConclusionDelay.each do |dado| file.puts "#{dado}" end end #aqui inderir a última variável desejada, precisar alterar de acordo com a última File.open(localClone+pathOutput+"tmp/"+prefixProjectName+"_ContributionConclusionDelay.csv", 'r') do |mainMerges| while line = mainMerges.gets mainMerges.each_line do |line| camposMainMerge = line.split(",") File.open(localClone+pathInput+prefixProjectName+"_Packages.csv", 'r') do |auxMerges| while lineAux = auxMerges.gets auxMerges.each_line do |lineAux| camposAuxMerge = lineAux.split(",") if camposMainMerge[0].gsub("\"","").eql?(camposAuxMerge[0].gsub("\"","")) mergeCommitID = camposMainMerge[0].gsub("\"","").gsub("\n","") isConflicting = camposMainMerge[1].gsub("\"","").gsub("\n","") existsCommonSlice = camposMainMerge[2].gsub("\"","").gsub("\n","") totalCommonSlices = camposMainMerge[3].gsub("\"","").gsub("\n","") conflictingFilesNumber = camposMainMerge[4].gsub("\"","").gsub("\n","") conflictsNumber = camposMainMerge[5].gsub("\"","").gsub("\n","") numberOfCommitsArithAverage = camposMainMerge[6].gsub("\"","").gsub("\n","") numberOfCommitsGeoAverage = camposMainMerge[7].gsub("\"","").gsub("\n","") numberOfAuthorsArithAverage = camposMainMerge[8].gsub("\"","").gsub("\n","") numberOfAuthorsGeoAverage = camposMainMerge[9].gsub("\"","").gsub("\n","") delayIntegrationArithAverage = camposMainMerge[10].gsub("\"","").gsub("\n","") delayIntegrationGeoAverage = camposMainMerge[11].gsub("\"","").gsub("\n","") deltaIntegration = camposMainMerge[12].gsub("\"","").gsub("\n","") minimumLifeTimeArithAverage = camposMainMerge[13].gsub("\"","").gsub("\n","") minimumLifeTimeGeoAverage = camposMainMerge[14].gsub("\"","").gsub("\n","") numberOfChangedFilesArithAverage = camposMainMerge[15].gsub("\"","").gsub("\n","") numberOfChangedFilesGeoAverage = camposMainMerge[16].gsub("\"","").gsub("\n","") numberOfChangedLinesArithAverage = camposMainMerge[17].gsub("\"","").gsub("\n","") numberOfChangedLinesGeoAverage = camposMainMerge[18].gsub("\"","").gsub("\n","") contributionConclusionDelay = camposMainMerge[19].gsub("\"","").gsub("\n","") #metricas de package adicionadas existsCommonPackages = camposAuxMerge[2].gsub("\"","").gsub("\n","") totalCommonPackages = camposAuxMerge[3].gsub("\"","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage+","+contributionConclusionDelay+","+existsCommonPackages+","+totalCommonPackages listPackages.push(dados) #puts "dados = #{dados}" end end #each_line end #while end # File.open end #each_line end #while end # File.open File.open(localClone+pathOutput+prefixProjectName+"_AllVariables.csv", 'w') do |file| file.puts "mergeCommitID, isConflicting, existsCommonSlice, totalCommonSlices, conflictingFilesNumber, conflictsNumber, numberOfCommitsArithAverage, numberOfCommitsGeoAverage, numberOfAuthorsArithAverage, numberOfAuthorsGeoAverage, delayIntegrationArithAverage, delayIntegrationGeoAverage, deltaIntegration, minimumLifeTimeArithAverage, minimumLifeTimeGeoAverage, numberOfChangedFilesArithAverage, numberOfChangedFilesGeoAverage, numberOfChangedLinesArithAverage, numberOfChangedLinesGeoAverage, contributionConclusionDelay, existsCommonPackages, totalCommonPackages" listPackages.each do |dado| file.puts "#{dado}" #puts "#{dado}" end end puts "end running generateCVSToStatisticAnalysis from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genCsvSummary()\n csv = [] ;\n to_a.each{|analyzer|\n csv.push(analyzer.genCsvRowSummary()) ;\n }\n return csv ;\n end", "def generate_csv\n @project = Project.find(params[:id])\n \n content_type = if request.user_agent =~ /windows/i\n ' application/vnd.ms-excel '\n else\n ' text/csv '\n end\n \n project_net = @project.find_all_connections(friend = true, follower = false) \n \n CSV::Writer.generate(output = \"\") do |csv|\n csv << [\"DL n=\" + @project.persons.count.to_s ]\n csv << [\"format = edgelist1\"]\n csv << [\"labels embedded:\"]\n csv << [\"data:\"]\n project_net.each do |entry|\n csv << [entry[0], entry[1], \"1\"]\n end\n @project.persons.each do |person|\n csv << [person.username]\n end\n end\n send_data(output,\n :type => content_type,\n :filename => @project.name.to_s + \"_FF_SNA.csv\")\n end", "def generateReport\n filePath = \"#{@reportFolder}/report.csv\"\n file = File.open(filePath, 'w')\n file.puts ['Screen', 'Description', 'Automation Message', 'Status'].join(',')\n @report.each do |result|\n file.puts result.join(',')\n end\n file.close\n end", "def print_csv_results\n FileUtils.mkdir_p(\"data\")\n File.open(\"data/results.csv\", \"w\") do |f|\n @data.sort_by{|id, values| values[\"sum_dose\"]}.each do |id, values|\n f.puts \"%s\\t%d\\t%.4f\" % [id, values[\"ddays\"], dose_unit(values[\"sum_dose\"])]\n end\n end\n end", "def to_csv\n initialize_generator\n csv_report_generator.records = pull_join\n csv_report_generator.generate_report\n end", "def index\n @case_studies = CaseStudy.order(:project_name => :asc)\n respond_to do |format|\n format.html {\n @grouped_case_studies = CaseStudy.group(:country).count\n @case_studies = @case_studies.where(\"LOWER(project_name)=?\", params[:q].downcase) if params[:q].present?\n }\n format.csv { send_data @case_studies.to_csv }\n end\n end", "def report\n\t\t dir = \"./report/\"\n File.open(dir + \"method.mmd\", \"w\") do |f|\n f.puts \"# Methods #\"\n Dir[\"./experiments/*/*.rb\"].each do |desc|\n if File.basename(desc) == File.basename(File.dirname(desc)) + \".rb\"\n File.read(desc).split(\"\\n\").each do |line|\n if m = line.match(/^\\# (.+)/)\n f.puts m[1]\n else\n break\n end\n end\n f.puts\n f.puts\n end\n end\n end\n require 'csv'\n require \"yaml\"\n require File.dirname(__FILE__) + \"/stats\"\n CSV.open(dir + \"/data.csv\", \"w\") do |csv|\n data = {}\n Dir[\"./results/*/results.yaml\"].each do |res|\n d = YAML::load_file(res)\n da = {}\n d.each do |k, vals|\n da[k.to_s + \" mean\"], da[k.to_s + \" sd\"] = Stats::mean(vals), Stats::standard_deviation(vals)\n vals.each_with_index do |v, i|\n da[k.to_s + \" cv:\" + i.to_s] = v\n end\n end\n array_merge(data, da)\n end\n data.keys.map do |key| \n \t\t # calculate stats\n \t\t a = data[key]\n \t\t [key] + a\n \t\t end.transpose.each do |row|\n \t\t csv << row\n \t\t end\n end\n\t\t\n\t\tend", "def dumpCsvSummary()\n CSV.open(csvFilenameSummary(), \"w\", { :col_sep => csvColSepChar() }) { |csv|\n csv << AnalyzerExpA.genCsvTitleRow() ;\n genCsvSummary().each{|row|\n csv << row ;\n }\n }\n end", "def to_csv\n CSV.generate(\"\", encoding: 'UTF-8') do |csv|\n csv << %w(study_group name)\n get_groups.each_with_index do |group, index|\n group.each do |student|\n csv << [index + 1, student]\n end\n end\n end\n end", "def index\n use_secure_headers_override :headers_stats_index\n @project_stats = ProjectStat.all\n respond_to do |format|\n format.csv do\n headers['Content-Disposition'] =\n 'attachment; filename=\"project_stats.csv\"'\n render csv: @project_stats, filename: @project_stats.name\n end\n format.json\n # { render :show, status: :created, location: @project_stat }\n format.html\n end\n end", "def add_result_project_stats(base, _opts)\n return nil unless\n result_files_exist?(base, %w[.taxonomy.json .metadata.db])\n\n r = MiGA::Result.new(\"#{base}.json\")\n r.add_file(:taxonomy_index, 'miga-project.taxonomy.json')\n r.add_file(:metadata_index, 'miga-project.metadata.db')\n r\n end", "def summary_csv(user)\n return '' unless user.admin?\n\n if user.admin?\n groupings = self.groupings\n .includes(:group,\n :accepted_students,\n current_result: :marks)\n else\n groupings = self.groupings\n .includes(:group,\n :accepted_students,\n current_result: :marks)\n .joins(:memberships)\n .where('memberships.user_id': user.id)\n end\n\n headers = [['User name', 'Group', 'Final grade'], ['', 'Out of', self.max_mark]]\n self.ta_criteria.each do |crit|\n headers[0] << (crit.bonus? ? \"#{crit.name} (#{Criterion.human_attribute_name(:bonus)})\" : crit.name)\n headers[1] << crit.max_mark\n end\n headers[0] << 'Bonus/Deductions'\n headers[1] << ''\n\n result_ids = groupings.pluck('results.id').uniq.compact\n extra_marks_hash = Result.get_total_extra_marks(result_ids, max_mark: max_mark)\n CSV.generate do |csv|\n csv << headers[0]\n csv << headers[1]\n\n groupings.each do |g|\n result = g.current_result\n marks = result.nil? ? {} : result.mark_hash\n g.accepted_students.each do |s|\n row = [s.user_name, g.group.group_name]\n if result.nil?\n row += Array.new(2 + self.ta_criteria.count, nil)\n else\n row << result.total_mark\n row += self.ta_criteria.map { |crit| marks[crit.id] }\n row << extra_marks_hash[result&.id]\n end\n csv << row\n end\n end\n end\n end", "def output_csv(datastore)\n CSV.open(OUTPUT_CSV, \"wb\") do |csv|\n csv << \t[\"Period\", \"First Use In\", \"Engaged Users\"]\n\n datastore.keys.sort.each do |date_key|\n pretty_date = Date.parse(date_key.split(\"_\")[0]).strftime(\"%Y-%m-%d\")\n datastore[date_key].keys.sort.each do |cohort_key|\n pretty_cohort= Date.parse(cohort_key.split(\"_\")[0]).strftime(\"%Y-%m-%d\")\n csv << [ pretty_date, pretty_cohort,\tdatastore[date_key][cohort_key]['total_users']]\n end\n end\n end\nend", "def record_project_statistics(project_name, blobs, locales_to_keys, locales_to_words)\n record_metric(blobs, PROJECT_STATISTICS_FILES, project_name)\n\n locales_to_keys.each do |locale_name, keys|\n record_metric(keys, PROJECT_STATISTICS_STRINGS, project_name, locale_name)\n end\n\n locales_to_words.each do |locale_name, words|\n record_metric(words, PROJECT_STATISTICS_WORDS, project_name, locale_name)\n end\n end", "def export_data\r\n folder = \"\\data\"\r\n FileUtils.mkdir_p folder\r\n CSV.open(File.join(folder, @output_stats_name), 'wb') do |csv|\r\n csv << @global_bests\r\n csv << @average_global_bests\r\n @neighbourhoods_list[0].report_particles.each do |x|\r\n csv << x\r\n end\r\n end\r\n end", "def generateCVSToStatisticAnalysisAggregatedSample(projectName, localClone, pathInput, pathOutput)\n\t #Dir.chdir localClone\n\t\tprefixProjectName = formatProjectName(projectName)\n\t\tprojectsList = []\n\t\t#projectName = \"netguru\"\n\t\tFile.open(localClone+pathOutput+prefixProjectName+\"_AllVariables.csv\", \"r\") do |text|\n\t\t\t#indexLine = 0\n\t\t\ttext.gets #ler o cabeçalho\n\t\t\ttext.each_line do |line|\n\t\t\t\tlista = line.split(\",\")\n\n\t\t\t\tmergeCommitID = lista[0]\n\t\t\t\t#puts \"mergeCommitID = #{mergeCommitID}\"\n\t\t\t\tisConflicting = lista[1]\n\t\t\t\texistsCommonSlice = lista[2]\n\t\t\t\ttotalCommonSlices = lista[3]\n\t\t\t\t#puts \"totalCommonSlices = #{totalCommonSlices}\"\n\t\t\t\tconflictingFilesNumber = lista[4]\n\t\t\t\tconflictsNumber = lista[5]\n\t\t\t\tnumberOfCommitsArithAverage = lista[6]\n\t\t\t\tnumberOfCommitsGeoAverage = lista[7]\n\t\t\t\tnumberOfAuthorsArithAverage = lista[8]\n\t\t\t\tnumberOfAuthorsGeoAverage = lista[9]\n\t\t\t\tdelayIntegrationArithAverage = lista[10]\n\t\t\t\tdelayIntegrationGeoAverage = lista[11]\n\t\t\t\tdeltaIntegration = lista[12]\n\t\t\t\tminimumLifeTimeArithAverage = lista[13]\n\t\t\t\tminimumLifeTimeGeoAverage = lista[14]\n\t\t\t\tnumberOfChangedFilesArithAverage = lista[15]\n\t\t\t\tnumberOfChangedFilesGeoAverage = lista[16]\n\t\t\t\tnumberOfChangedLinesArithAverage = lista[17]\n\t\t\t\tnumberOfChangedLinesGeoAverage = lista[18]\n\t\t\t\tcontributionConclusionDelay = lista[19]\n\t\t\t\texistsCommonPackages = lista[20]\n\t\t\t\ttotalCommonPackages = lista[21]\n\t\t\t\t#puts \"existsCommonPackages = #{existsCommonPackages}\"\n\t\t\t\t#puts \"totalCommonPackages = #{totalCommonPackages}\"\n\n\t\t\t\tmergeCommitID = lista[0].gsub(\"\\r\",\"\").gsub(\"\\n\",\"\")\n\n\t\t\t\tdados = mergeCommitID+\",\"+isConflicting+\",\"+existsCommonSlice+\",\"+totalCommonSlices+\",\"+conflictingFilesNumber+\",\"+conflictsNumber+\",\"+numberOfCommitsArithAverage+\",\"+numberOfCommitsGeoAverage+\",\"+numberOfAuthorsArithAverage+\",\"+numberOfAuthorsGeoAverage+\",\"+delayIntegrationArithAverage+\",\"+delayIntegrationGeoAverage+\",\"+deltaIntegration+\",\"+minimumLifeTimeArithAverage+\",\"+minimumLifeTimeGeoAverage+\",\"+numberOfChangedFilesArithAverage+\",\"+numberOfChangedFilesGeoAverage+\",\"+numberOfChangedLinesArithAverage+\",\"+numberOfChangedLinesGeoAverage+\",\"+contributionConclusionDelay+\",\"+existsCommonPackages+\",\"+totalCommonPackages\n\t\t\t\tprojectsList.push(dados.gsub(\"\\n\", \"\"))\n\t\t\tend\n\t\tend\n\n\t\t File.open(localClone+pathOutput+\"allProjects_AllVariables.csv\", 'a') do |file|\n\t\t\t if (File.size(localClone+pathOutput+\"allProjects_AllVariables.csv\") == 0)\n\t\t\t\t file.puts \"mergeCommitID,isConflicting,existsCommonSlice,totalCommonSlices,conflictingFilesNumber,conflictsNumber,numberOfCommitsArithAverage,numberOfCommitsGeoAverage,numberOfAuthorsArithAverage,numberOfAuthorsGeoAverage,delayIntegrationArithAverage,delayIntegrationGeoAverage,deltaIntegration,minimumLifeTimeArithAverage,minimumLifeTimeGeoAverage,numberOfChangedFilesArithAverage,numberOfChangedFilesGeoAverage,numberOfChangedLinesArithAverage,numberOfChangedLinesGeoAverage,contributionConclusionDelay,existsCommonPackages,totalCommonPackages\"\n\t\t\t end\n\n\t\t\t projectsList.each do |dado|\n\t\t\t\tfile.puts \"#{dado}\"\n\t\t\tend\n\t\t end\n\n\t\tputs \"end running generateCVSToStatisticAnalysisAggregatedSample from #{prefixProjectName} project\"\n\tend", "def build_scale_csv_summary(parent_dir)\n puts \"building scale test csv summary report for parent dir: #{parent_dir}\"\n puts\n\n parent_name = File.basename(parent_dir)\n report_name = \"scale_test_summary\"\n output_path = \"#{parent_dir}/#{report_name}.html\"\n\n # create a summary csv file to contain the last successful iteration from each result\n @summary_csv_path_success = \"#{parent_dir}/#{report_name}.success.csv\"\n create_summary_csv(@summary_csv_path_success)\n\n # create a summary csv file to contain the failing iteration from each result\n @summary_csv_path_fail = \"#{parent_dir}/#{report_name}.fail.csv\"\n create_summary_csv(@summary_csv_path_fail)\n\n # start with the template\n report = File.read(@template_path)\n\n # process each result dir\n process_result_dirs(parent_dir)\n\n # calculate variance for success\n calculate_summary_csv(@summary_csv_path_success)\n\n # calculate variance for failure\n calculate_summary_csv(@summary_csv_path_fail)\n\n # csv2html\n csv2html(@summary_csv_path_success)\n csv2html(@summary_csv_path_fail)\n\n # result name\n report = report.gsub(\"$RESULT_NAME\", parent_name)\n\n # add summary success table\n summary_success_table = extract_table_from_csv2html_output(\"#{@summary_csv_path_success}.html\")\n report = report.gsub(\"$RESULT_SUMMARY_SUCCESS_TABLE\", summary_success_table)\n\n # add summary fail table\n summary_fail_table = extract_table_from_csv2html_output(\"#{@summary_csv_path_fail}.html\")\n report = report.gsub(\"$RESULT_SUMMARY_FAIL_TABLE\", summary_fail_table)\n\n # add extract tables\n report = report.gsub(\"$RESULT_EXTRACT_TABLES\", @tables)\n\n # write report\n puts \"writing report to #{output_path}\"\n puts\n\n File.write(output_path, report)\nend", "def format_output_with_CSV()\r\n\t\theadings = [] << \"Run\"\r\n\t\trows = []\r\n\t\t@actual_parameters.each {|t| headings << t[0]}\r\n\t\[email protected]_with_index do |run,i|\r\n\t\t\ttemp = [\"#{i+1}\"];\r\n\t\t\trun.each_with_index do |r,i|\r\n\t\t\t\ttemp << @actual_parameters[i][Integer(run[i][1])]\r\n\t\t\tend\r\n\t\t\trows << temp\r\n\t\tend\r\n\t\t@output_table = Terminal::Table.new :title => \"IPO Algorithm tests output\", :headings => headings, :rows => rows\r\n\tend", "def generate_report\n CSV.generate(write_headers: false, headers: headers) do |csv|\n # Don't want to rely on `write_headers: true` since we want still\n # header row in the CSV file even when there is no data.\n csv << headers\n records.each do |record|\n csv << method_names.map { |method_name| record.public_send method_name }\n end\n end\n end", "def generate_csv\n\n fields = @resource[:class].typus_fields_for(:csv).collect { |i| i.first }\n\n require 'csv'\n if CSV.const_defined?(:Reader)\n # Old CSV version so we enable faster CSV.\n begin\n require 'fastercsv'\n rescue Exception => error\n raise error.message\n end\n csv = FasterCSV\n else\n csv = CSV\n end\n\n filename = \"#{Rails.root}/tmp/export-#{@resource[:self]}-#{Time.now.utc.to_s(:number)}.csv\"\n\n options = { :conditions => @conditions, :batch_size => 1000 }\n\n csv.open(filename, 'w', :col_sep => ';') do |csv|\n csv << fields\n @resource[:class].find_in_batches(options) do |records|\n records.each do |record|\n csv << fields.map { |f| record.send(f) }\n end\n end\n end\n\n send_file filename\n\n end", "def index\n @experiments = policy_scope Experiment.where(user_id: current_user.id).order(created_at: :desc).page(params[:page])\n respond_to do |format|\n format.html\n format.csv {\n send_data( @experiments.to_csv,\n filename: \"CO2_by_experiment_#{Time.zone.now}.csv\", \n disposition: 'inline', type: \"multipart/related\")\n }\n end\n end", "def genCsvRowSummary()\n row = configIndex() ;\n\n row.push(getAveSpeed()) ;\n row.push(getShareRatio()) ;\n row.push(getCumulativeShare()) ;\n return row ;\n end", "def create_scale_results_csv_file(scale_results_parent_dir)\n CSV.open(\"#{scale_results_parent_dir}/PERF_SCALE_#{@scale_timestamp}.csv\", \"wb\") do |csv|\n headings = [\"agents\",\n \"ok\",\n \"ko\",\n \"combined mean\",\n \"catalog mean\",\n \"filemeta plugins mean\",\n \"filemeta pluginfacts mean\",\n \"locales mean\",\n \"node mean\",\n \"report mean\",\n \"average CPU %\",\n \"average memory\"]\n\n csv << headings\n end\n end", "def parse_metrics( project_dir )\n if !File.exists? project_dir\n abort \"The #{project_dir} directory doesn't exist!\"\n else\n project_dir_contents = Dir[\"#{project_dir}/**/*.rb\"]\n if project_dir_contents.size == 0\n abort \"The project #{project_dir} was empty! No metrics could be generated!\"\n end\n end\n\n # There should be a better way of handling this\n # perhaps a tuple of ( var_name, regex, accum )\n project_files = 0\n project_lines = 0\n project_comments = 0\n project_classes = 0\n project_methods = 0\n project_modules = 0\n project_mixins = 0\n\n project_dir_contents.each do |file|\n project_files += 1\n File.open( file, 'r' ) do |f|\n f.each_line do |line|\n project_lines += 1\n if line.match( /^\\s*#+/ )\n project_comments += 1\n end\n if line.match( /^\\s*class/ )\n project_classes += 1\n end\n if line.match( /^\\s*module/ )\n project_modules += 1\n end\n if line.match( /^\\s*def/ )\n project_methods += 1\n end\n if line.match( /^\\s*include/ )\n project_mixins += 1\n end\n end\n end\n end\n\n puts \"Metrics of #{project_dir}:\"\n puts \"Files: #{project_files}\"\n puts \"Lines: #{project_lines}\"\n puts \"Comments: #{project_comments}\"\n puts \"Classes: #{project_classes}\"\n puts \"Modules: #{project_modules}\"\n puts \"Mixins: #{project_mixins}\"\n puts \"Methods: #{project_methods}\"\n\nend", "def generate_CSV\n CSV.open(\"./veterans.csv\", \"w\", \n write_headers: true,\n headers: [\"login\", \"name\", \"location\", \"repo count\"]\n ) do |csv|\n @top_ten.each { |row| csv << row }\n end\n end", "def exported_report\n #The folder where the filename points to, is actually in the ~/rails/Forester because of capistrano as\n # the Apache point to ~/rails/Forester/current symlinkfolder and capistrano updates the them. \n @filename = \"quarterly_report_#{params[:year]}_#{params[:quarter]}.csv\"\n @file_path = \"#{Rails.root}/../../shared/system/exports/\"\n if params[:quarter] == \"1\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{(params[:year].to_i-1)}-12-31' AND delivery_date<'#{params[:year]}-04-01'\")\n else\n if params[:quarter] == \"2\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-03-31' AND delivery_date<'#{params[:year]}-07-01'\")\n else\n if params[:quarter] == \"3\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-06-30' AND delivery_date<'#{params[:year]}-10-01'\")\n else\n if params[:quarter] == \"4\" then\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-09-30' AND delivery_date<'#{(params[:year].to_i+1)}-01-01'\")\n end\n end\n end\n end\n \n #Writing to file starts with empty line.\n File.open(\"#{@file_path}#{@filename}\", 'w') do |writer|\n writer.puts(\"\\n\")\n end\n \n #From the tickets delivered in the given quarter, the job ids are gathered here\n @job_ids = @tickets.collect {|i| i.job_id }\n @jobs = Job.find(@job_ids)\n \n #To have less DB calls, all specie records are put into an instance variable\n @species = Specie.all\n \n #Goes through all the jobs, for each sums up all the mbf and tonnages and writes them into the file\n # per specie.\n @jobs.each do |k|\n @my_tickets = []\n @tickets.each do |l|\n if l.job_id == k.id\n @my_tickets.push(l)\n end\n end\n \n @amounts = []\n \n @species.length.times do\n @amounts.push([0, 0])\n end\n \n @total_pulp = 0\n \n @my_tickets.each do |i|\n i.load_details.each do |j|\n if i.wood_type == 3 || j.species_id == 0 #wood type 3 & species_id 0 == pulp\n @total_pulp = @total_pulp + j.tonnage\n next #If load is pulp, it has only one load detail so program jups to next loop\n end\n #Amounts of mbf/tonnage are summed up here per ticket according to their specie.\n @amounts[j.species_id-1][0] = @amounts[j.species_id-1][0] + j.mbfss #This and triple-n tonnage in next are helper methods. See their documentation.\n @amounts[j.species_id-1][1] = @amounts[j.species_id-1][1] + j.tonnnage\n end\n end\n \n #Finally, the values calculated above are written into the file.\n File.open(\"#{@file_path}#{@filename}\", 'a') do |writer|\n writer.puts \"Job, #{k.name}\"\n writer.puts \"Category, MBF, Tonnage\"\n @species.each do |i|\n writer.puts \"#{i.code}, #{round_to(@amounts[i.id-1][0].to_f, 2)}, #{round_to(@amounts[i.id-1][1].to_f, 2)}\"\n end\n writer.puts \"Pulp, ,#{round_to(@total_pulp.to_f, 2)}\"\n writer.puts(\"\\n\")\n end\n end\n \n #The file created is opened in 'r' (== read) mode and send to user\n @file = File.open(\"#{@file_path}#{@filename}\", 'r')\n \n send_data(@file.read, :type => \"csv\", :filename => @filename)\n end", "def organise_data\n # Single big csv file where we want to aggregate all data\n outfile = File.open('energy-consumption.csv', 'w')\n\n # Columns we want to have in the output file:\n # * category = {commercial, residential}\n # * type = {restaurant, hospital, retail, etc.}\n # * name = name of the building (generally just the city where it is located)\n # * date = date of the year\n # * time = time of the day (hour by hour)\n # * energy = measured energy consuption for that date and hour\n outfile.puts('category,type,name,date,time,energy')\n \n rw_commercial_buildings_data(outfile)\n rw_residential_buildings_data(outfile)\n \n outfile.close\nend", "def to_csv(function_list, tests)\n function_list.map { |function_name|\n v = tests[\"#{function_name} function\"]\n if v\n positive_tests = count_tests_in(v['groups']['success'])\n negative_tests = count_tests_in(v['groups']['failure'])\n pending_tests =\n count_pending_tests_in(v['groups']['failure']) +\n count_pending_tests_in(v['groups']['failure'])\n else\n positive_tests = 0\n negative_tests = 0\n pending_tests = 0\n end\n '%-25s, %-9d, %-9d, %-9d' % [function_name, positive_tests, negative_tests, pending_tests]\n }.compact\nend", "def student_all_report\n @user = User.find(params[:id])\n report = StringIO.new\n CSV::Writer.generate(report, ',') do |csv|\n #Get Words\n @words = @user.word_answers.find(:all, :order => \"question_id ASC\")\n csv << %w(question answer date)\n @words.each do |answer|\n csv << [answer.word.value, answer.value, answer.created_at]\n end\n #Get Situations\n @situation_answers = @user.completion_answers.find(:all, :order => \"question_id ASC\")\n @situation_answers.each do |answer|\n csv << [answer.completion.value, answer.value, answer.created_at]\n end\n #Get Scenarios\n @scenario_answers = @user.scenario_answers.find(:all, :order => \"question_id ASC\")\n @scenario_answers.each do |answer|\n csv << [answer.scenario.value, answer.value, answer.created_at]\n end\n \n #Get posts\n @posts = @user.posts.find(:all, :order => \"created_at DESC\")\n @posts.each do |post|\n csv << [post.topic.title, post.body, post.created_at]\n end\n end\n export_as_csv(report,@user.whole_name+\"-all\")\n end", "def write_results_to_array(parsed_results)\n # get the array of sprints for the project\n sprints = parsed_results['values']\n # open a CSV with the name created above\n sprints.each do |sprint|\n # output the each line that we're writing to the CSV\n puts \"Sprint: #{sprint['name']}\\n\"\n unless sprint['startDate'].nil?\n puts \"\\t started: #{DateTime.parse(sprint['startDate']).strftime(\"%m/%d/%Y\")}\" \n else\n puts \"\\tHas not started - will not be exported\"\n end\n unless sprint['endDate'].nil? \n puts \"\\t ended: #{DateTime.parse(sprint['endDate']).strftime(\"%m/%d/%Y\")}\" \n else\n puts \"\\tHas not ended - will not be exported\"\n end\n\n # set a default start and end date of 0-0-0 (easily identifiable so they can be removed later)\n startDate = \"0-0-0\"\n endDate = \"0-0-0\"\n\n # format start and end dates\n unless sprint['startDate'].nil?\n startDate = DateTime.parse(sprint['startDate']).strftime('%m-%d-%Y %l:%M:%S %p')\n end\n\n unless sprint['endDate'].nil?\n endDate = DateTime.parse(sprint['endDate']).strftime('%m-%d-%Y %l:%M:%S %p')\n end\n\n #push results to an array that we'll use when writing to the csv later...\n @cumulative_sprints_array.push([sprint['name'], startDate, endDate, sprint['state']])\n end\nend", "def generate_csv\n\n fields = @resource.typus_fields_for(:csv)\n\n require 'csv'\n if CSV.const_defined?(:Reader)\n # Old CSV version so we enable faster CSV.\n begin\n require 'fastercsv'\n rescue Exception => error\n raise error.message\n end\n csv = FasterCSV\n else\n csv = CSV\n end\n\n filename = Rails.root.join(\"tmp\", \"export-#{@resource.to_resource}-#{Time.now.utc.to_s(:number)}.csv\")\n\n options = { :conditions => @conditions, :batch_size => 1000 }\n\n csv.open(filename, 'w', :col_sep => ';') do |csv|\n csv << fields.keys\n @resource.find_in_batches(options) do |records|\n records.each do |record|\n csv << fields.map do |key, value|\n case value\n when :transversal\n a, b = key.split(\".\")\n record.send(a).send(b)\n when :belongs_to\n record.send(key).to_label\n else\n record.send(key)\n end\n end\n end\n end\n end\n\n send_file filename\n\n end", "def create_finals_file\n file = File.open('final.csv', 'w')\n $students.each do |student|\n name = student[:name]\n avg = get_avggrades(student)\n file.puts \"#{name} #{avg}\"\n end\n file.close\nend", "def index\n @q = ProjectTeamMember.ransack(params[:q])\n @project_team_members = @q.result\n\n @project_team_members = @project_team_members.order(id: :desc).page(params[:page]).per(10)\n respond_to do |format|\n format.html\n format.csv { send_data ProjectTeamMember.to_csv(@projects), filename: \"projects-#{Date.today}.csv\" }\n end\n end", "def output_to_csv\n if (@values[:result] != nil)\n @additions << calculate_worktime\n filename = get_entry(\"Specify output file: \")\n p = Menu.data_handler.find_person_by_id(@values[:id])\n CSVWriter.output(filename, p, @values[:result], @additions)\n else\n puts \"Nothing to write right now.\"\n end\n end", "def csvexport_all_tables\n @wires = Wire.all.sort_by {|obj| obj.kabeltyp}\n @switchgears_einbau = Switchgear.all.sort_by {|obj| obj.kennung}\n @switchgears = Switchgear.where(:typ => 1).sort_by {|obj| obj.kennung}\n @assemblies = Assembly.all.sort_by {|obj| obj.kennung}\n @electrical_installations = ElectricalInstallation.all.sort_by {|obj| obj.kennung}\n @drives = Drive.all.sort_by {|obj| obj.kennung}\n @devices = Device.all.sort_by {|obj| obj.definition}\n @iogroups = Iogroup.all.sort_by {|obj| obj.name}\n @switchgearcombinations = Switchgearcombination.all.sort_by {|obj| obj.name}\n @offertpositions = Offertposition.where(:subsubproject_id => params[:subsubproject_id]).sort_by {|obj| obj.name}\n @subsubproject = Subsubproject.find(params[:subsubproject_id])\n @subsubprojects = @subsubproject.subproject.subsubprojects.sort_by {|obj| obj.name}\n @subsystems = @subsubproject.subproject.project.subsystems.all.sort_by {|obj| obj.name}\n @units = Unit.where(:subsystem_id => @subsystems.pluck(:id)).sort_by {|obj| obj.name}\n\n CSV.open(\"export_all_tables#{Time.now.strftime(\"%Y-%m-%d-%H-%M\")}.csv\", \"wb\", {:headers => true, :encoding => \"iso-8859-1\", :col_sep => \";\"}) do |csv|\n csv << ['Geraetetypen', '']\n @devices.each do |entry| csv << [entry.id, entry.definition] end\n csv << ['SPS-Modultypen', '']\n @assemblies.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Frequenzumrichtertypen', '']\n @drives.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Kabeltypen', '']\n @wires.each do |entry| csv << [entry.id, entry.kabeltyp] end\n csv << ['Elektroinstallationstypen', '']\n @electrical_installations.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Schaltschranktypen', '']\n @switchgears.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Schaltschrankeinbautypen', '']\n @switchgears_einbau.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Schaltgeraetekombinationen', '']\n @switchgearcombinations.each do |entry| csv << [entry.id, entry.name] end\n csv << ['IO-Gruppen', '']\n @iogroups.each do |entry| csv << [entry.id, entry.name] end\n csv << ['Offertpositionen', '']\n @offertpositions.each do |entry| csv << [entry.id, entry.name] end\n csv << ['Teilanlagen', '']\n @subsystems.each do |entry| csv << [entry.id, entry.name] end\n csv << ['TeilanlagenUnits', '']\n @units.each do |entry| csv << [entry.id, entry.name] end\n csv << ['Projektversionen', '']\n @subsubprojects.each do |entry| csv << [entry.id, entry.name] end\n end\n\n redirect_to settings_path, :notice => \"Export wurde unter \" + Rails.root.to_s + \"/ abgelegt!\"\n end", "def save_groups_to_csv\n\t\tCSV.open(\"groups.csv\", \"w\") do | csv | \n\t\t\[email protected] do |row|\n\t\t\t\tcsv << row\n\t\t\tend\n\t\tend\n\tend", "def summarize_results!(all_results)\n \t summaries = {}\n \t all_results.each do |paramset, results|\n \t File.open(@dir + \"/results-#{param_string(paramset)}.yaml\", 'w' ) do |out|\n \t\t\tYAML.dump(results, out)\n \t\tend\n \t\tsummaries[paramset] = {}\n \t\t# create an array of arrays\n \t\tres = results.keys.map do |key| \n \t\t # calculate stats\n \t\t a = results[key]\n \t\t if a.all? {|el| el.is_a? Numeric }\n \t\t summaries[paramset][\"#{key} mean\"] = Stats::mean(a)\n \t\t summaries[paramset][\"#{key} SD\"] = Stats::standard_deviation(a)\n \t\t [key] + a + [Stats::mean(a), Stats::standard_deviation(a)]\n \t\t else\n \t\t [key] + a + [\"--\", \"--\"]\n \t end\n \t\t end\n\t\t \n \t\t ls = results.keys.map{|v| [7, v.to_s.length].max }\n \t\t\n \t\tls = [\"Std Deviation\".length] + ls\n \t\tres = header_column + res\n \t\tres = res.transpose\n \t\tout = build_table res, ls\n \t\tFile.open(@dir + \"/#{paramset}-summary.mmd\", 'w') do |f|\n \t\t f << \"## Results for #{@experiment} with parametres #{param_string(paramset, \", \")} ##\\n\\n\"\n \t\t f << out\n \t\t end\n\t\t end\n\t\t \n\t\t # Build CSV file with all of the results\n\t\t #puts summaries.inspect\n\t\t \n\t\t summaries = summaries.to_a\n #puts summaries.inspect\n\t\t keys1 = summaries.first.first.keys\n\t\t keys2 = summaries.first.last.keys\n\t\t #puts keys1.inspect, keys2.inspect, \"=====\"\n CSV.open(@dir + \"/results.csv\", \"w\") do |csv|\n \t csv << keys1 + keys2\n \t summaries.each do |summary|\n \t #puts summary.first.inspect\n \t #puts summary.first.values_at(*keys1).inspect + summary.last.values_at(*keys2).inspect\n \t csv << summary.first.values_at(*keys1) + summary.last.values_at(*keys2)\n \t \n \t end\n \t end\n\t\t \n\t end", "def execute(directory = \"results\", mode: :csv)\n pos = 0\n @log.scan(EXAMPLE_PATTERN).size.times { |_| pos = extract_tests(pos) }\n\n path_name = Pathname.pwd + directory + \"#{Date.today.strftime('%Y%m%d')}.#{mode}\"\n if mode == :csv\n CSV.open(path_name, \"w\") do |csv|\n csv << %w[seconds example file]\n @collection.aggregate.each { |test| csv << test.to_a }\n end\n else\n File.open(path_name, \"w\") do |file|\n file.puts Date.today.strftime(\"%Y%m%d\")\n file.puts @collection.aggregate.map.with_index(1) { |test, i| \"#{i}. #{test}\" }\n end\n end\n\n path_name\n end", "def to_csv()\n all = general_info_csv() + \"\\r\\n\" +\n teacher_for_csv() + \"\\r\\n\" +\n contributor_to_csv() + \"\\r\\n\" +\n published_in_csv() + \"\\r\\n\" +\n text_fields_csv()\n all\n end", "def generate_test_data()\n CSV.open(\"testdata.csv\", \"w\") do |csv|\n (1..1_000_000).each do |i|\n csv << [rand(100), rand(10_000), rand(100_000)]\n end\n end\nend", "def data\n projects.map do |project|\n [].tap do |column|\n column << project.reference\n column << project.object_project\n column << project.projectName\n column << project.projectDescription\n column << project.focal_point\n column << project.project_situation\n column << project.public_partenership\n column << project.private_partenership\n column << project.amount\n column << project.contratDuration\n end\n end\n end", "def main()\n request_url = \"#{$canvas_url}/api/v1/users/#{$canvas_user_id}/page_views?per_page=100&start_time=#{$start_time}&end_time=#{$end_time}\"\n method = \"get\"\n options = {}\n data = canvasApiRequest(method,request_url,options)\n compiledHash = []\n data.each do |hash|\n hashData = flattenHash(hash)\n compiledHash.push(hashData)\n end\n outputToCSV(compiledHash)\nend", "def write_csv\n\t\tCSV.open(\"csv_exports/edits_per_user_#{@dataset}.csv\", 'w') do |csv|\n\t\t\tcsv << ['user', 'edits']\n\t\t\[email protected] do |user, edits|\n\t\t\t\tcsv << [user,edits]\n\t\t\tend\n\t\tend\n\tend", "def process_csv_project(filename, output_path)\n analysis = OpenStudio::Analysis.from_csv(filename)\n analysis.save \"#{output_path}.json\"\n analysis.save_zip \"#{output_path}.zip\"\n\n OpenStudio::Analysis.aws_instance_options(filename)\nend", "def index\n # Rails.logger.info params\n # для таблиц где есть ProjectID мы хотим видеть данные в контексте\n # данного проекта, для остальных пока отображаем все данные\n if false && model.new.respond_to?(:Project)\n @grid = initialize_grid(model.where(Project: project.ProjectID), name: 'general')\n @data_list = model.where(Project: project.ProjectID).limit(10_000)\n else\n @grid = initialize_grid(model, name: 'general')\n @data_list = model.limit(10_000)\n end\n\n respond_to do |format|\n format.html { render index_view }\n format.csv\n format.xlsx\n end\n end", "def generateCSV()\n findCommits\n findLinesOfCode\n\n CSV.open(\"data.csv\", \"wb\") {|csv| @students.to_a.each {|elem| csv << elem} }\nend", "def report_activities\n @project = Project.find params[:project_id]\n ###\n retrieve_query\n # sort_init(@query.sort_criteria.empty? ? [['id', 'desc']] : @query.sort_criteria)\n # sort_update(@query.sortable_columns)\n \n if @query.valid?\n @limit = Setting.issues_export_limit.to_i\n\n @issue_count = @query.issue_count\n @issue_pages = Paginator.new self, @issue_count, @limit, params['page']\n @offset ||= @issue_pages.current.offset\n @issues = @query.issues(:include => [:assigned_to, :tracker, :priority, :category, :fixed_version],\n # :order => sort_clause,\n :offset => @offset,\n :limit => @limit)\n\n @iss = []\n @issues.each{|i|\n issue = Issue.find i.id\n @iss << issue\n }\n respond_to do |format|\n format.html { send_data(statuses_to_csv_activities(@iss, @project), :type => 'text/csv; header=present', :filename => 'export.csv') }\n end \n end\n ###\n end", "def to_html\n html = generate_header\n i = 0\n project = Continuous4r.project\n errors_or_warnings = 0\n html_details = \"\"\n if !(Config::CONFIG['host_os'] =~ /mswin/)\n require 'open3'\n end\n ['spec'].each do |runner|\n error_detail_array, result = run_runner(runner)\n passed = test_passed?(result, error_detail)\n if !(error_detail_array.match(/rake aborted/).nil?) and error_detail_array.split(/$/).length > 1\n error_detail = extract_error_detail(error_detail_array)\n end\n html << generate_line_start(runner, passed)\n raise \" #{runner} tests failed.\\n BUILD FAILED.\" if project.ignore_tests_failures == \"false\" and passed == false\n File.open(\"#{Continuous4r::WORK_DIR}/test_#{runner}.log\", \"w\") do |file|\n file.write(result)\n file.close\n end\n html << \"<td style='text-align: center;'><img src='images/icon_#{passed ? 'success' : 'error'}_sml.gif'/></td>\"\n file_content = File.read(\"#{Continuous4r::WORK_DIR}/test_#{runner}.log\")\n array_file_content = file_content.split(/$/)\n test_results = extract_test_results(array_file_content)\n examples = test_results[0]\n failures = test_results[1]\n failures ||= 0\n errors_or_warnings += failures.to_i\n if failures.to_i > 0\n html_details << generate_failure_lines(array_file_content)\n end\n if array_file_content.select{|l| l =~ /^Finished in/}.length == 0\n html << generate_default_result_and_time_columns(result, error_detail, passed)\n else\n html << generate_result_and_time_columns(examples, failures, array_file_content)\n end\n i += 1\n end\n html << \"</tbody></table>\"\n return html if errors_or_warnings == 0\n html << generate_error_details(html_details)\n end", "def get_stats_file(classification, transformation, preprocess)\n format = \"#{classification}_#{transformation}_#{preprocess}\"\n filename = File.join(@res, 'stats', format + '.json')\n\n filename\n end", "def generate_records_file(format)\n file = Tempfile.new(\"patients-#{Time.now.to_i}\")\n patients = Record.where(\"test_id\" => self.id)\n \n if format == 'csv'\n Cypress::PatientZipper.flat_file(file, patients)\n else\n Cypress::PatientZipper.zip(file, patients, format.to_sym)\n end\n \n file\n end", "def scg_report_csv(filename)\n puts 'Creating the Storage Connectivity Groups report'\n CSV.open(\"#{filename}\", 'ab') do |csv|\n csv << [\"\\n\"]\n csv << %w(Storage_Connectivity_Groups_List)\n csv << %w(SCG_Name SCG_Auto_Add_VIOs SCG_FC_Storage_Access SCG_Ports_per_Fabric SCG_Host_List SCG_VIOs_List)\n scg_report\n csv_array(@scg_csv_array, csv)\n end\n puts 'Done'\n end", "def generate_new_report\n log_info('MI Report generation started...')\n content = CSV.generate do |csv|\n csv << headers\n claims.find_each do |claim|\n ManagementInformationPresenter.new(claim, 'view').present! do |claim_journeys|\n claim_journeys.each { |journey| csv << journey } if claim_journeys.any?\n end\n end\n end\n log_info('MI Report generation finished')\n content\n rescue StandardError => e\n log_error(e, 'MI Report generation error')\n end", "def csv_report_by_task( csv, headings )\n # Assemble the heading row.\n\n file_row = [ @report.column_title, 'Code', 'Billable?', 'Active?' ]\n\n @report.column_ranges.each_index do | col_index |\n partial = @report.partial_column?( col_index ) ? ' (partial)' : ''\n headings.each do | heading |\n file_row << \"#{ @report.column_heading( col_index ) }#{ partial }#{ heading }\"\n end\n end\n\n headings.each do | heading |\n file_row << \"Row total#{ heading }\"\n end\n\n if ( @report.filtered_users.empty? )\n file_row << 'Duration'\n file_row << 'Remaining (actual)'\n file_row << 'Remaining (potential)'\n end\n\n csv << file_row.flatten\n\n # Section and task list, date range breakdown.\n\n sections_initialise_sections()\n @report.rows.each_index do | row_index |\n\n row = @report.rows[ row_index ]\n task = @report.filtered_tasks[ row_index ]\n file_row = []\n\n # New section? Write out the section title and totals if so.\n\n if ( sections_new_section?( task ) )\n file_row << sections_section_title( true )\n file_row << ( task.project.try( :code ) || '-' ) << '' << ''\n\n row.cells.each_index do | col_index |\n file_row << hours( @report.sections[ sections_section_index() ].cells[ col_index ] )\n end\n\n file_row << hours( @report.sections[ sections_section_index() ] )\n\n if ( @report.filtered_users.empty? )\n file_row << '' << '' << ''\n end\n\n csv << file_row.flatten\n file_row = []\n end\n\n # Task title, data and summary information\n\n file_row << \" -- #{ task.title }\"\n file_row << task.code\n file_row << @@application_helper.apphelp_boolean( task.billable )\n file_row << @@application_helper.apphelp_boolean( task.active )\n\n row.cells.each do | cell |\n file_row << hours( cell )\n end\n\n file_row << hours( row )\n\n if ( @report.filtered_users.empty? )\n if ( task.duration == 0.0 )\n file_row << '' << '' << ''\n else\n file_row << task.duration\n file_row << task.duration - row.committed\n file_row << task.duration - row.total\n end\n end\n\n csv << file_row.flatten\n end\n\n # Column totals.\n\n file_row = [ 'Column total', '', '', '' ]\n\n @report.column_totals.each do | total |\n file_row << hours( total )\n end\n\n file_row << hours( @report )\n\n if ( @report.filtered_users.empty? )\n file_row << @report.total_duration\n file_row << @report.total_actual_remaining\n file_row << @report.total_potential_remaining\n end\n\n csv << file_row.flatten\n end", "def export_csv\n\n group_array = []\n @page = 1\n @per_page = 50\n\n groups = @context.get(:groups, :page => @page, :per_page => @per_page, :access_token => ENV[\"API_TOKEN\"])\n group_array << groups\n group_array, group_hash = check_paging(groups, group_array, \"groups\", @context, true)\n\n group_array.each_with_index do |group, index|\n is_new = index == 0 ? true : false\n membership_array = []\n @page = 1\n\n group_model = Group.find(group['id'], :params => { :access_token => ENV[\"API_TOKEN\"] })\n memberships = group_model.get(:memberships, :page => @page, :per_page => @per_page, :access_token => ENV[\"API_TOKEN\"])\n membership_array << memberships\n membership_array, @membership_hash = check_paging(memberships, membership_array, \"memberships\", group_model, is_new)\n end\n\n export_data = [group_array, @membership_hash]\n perform_export(export_data) \n\n respond_to do |format|\n format.html { render :inline => \"<a href=<%= @download_url %>>Download CSV</a>\" }\n format.json { render :json => @download_url.to_json }\n end\n end", "def period_csv\n CSV.generate do |csv|\n report_details.each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n time_period_table.each { |a| csv.add_row(a) }\n end\n end", "def export_stat_for(unit, start_at, end_at)\n cond = [\"unit = ? and basedate > ? and basedate < ?\", unit, start_at, end_at] #Date.parse(start_at) , Date.parse(end_at)]\n rids = Rule.stat_rules.map(&:rid)\n #FOREACH DocType\n File.open(\"stat_#{unit}_#{start_at}_#{end_at}.txt\",\"w\") do |f|\n #debugger\n f.puts((['basedate'].concat rids).join(\"\\t\")+\"\\n\")\n f.puts Stat.all(:conditions=>cond).group_by(&:basedate). # group by date\n map{|basedate,stats|[unit,basedate.ymd, rids.to_val(stats.map_hash{|e|[e.rid,e.content.to_f]}, :def_val=>nil)].flatten}. # turn into feature vector\n sort_by{|e|e[0]}.map{|e|e.join(\"\\t\")}.join(\"\\n\")\n end\nend", "def csv_export_chrono\n csv_string = CSV.generate do |csv|\n\n csv << [ \"Plaque\", \"Equipe\", \"Nom VTT\", \"Prenom VTT\", \"ADN VTT\", \"Nom Route\", \"Prenom Route\", \"ADN Route\", \"Categorie\"]\n\n Team.order_by(:plate).each do |t|\n cat = t.category\n next unless cat\n\n cname = cat.map { |v| v.capitalize }.join('-')\n csv << [ t.plate, t.name, \n t.vtt.profile.name.upcase, t.vtt.profile.surname.capitalize, t.vtt.profile.birth.year, \n t.route.profile.name.upcase, t.route.profile.surname.capitalize, t.route.profile.birth.year, cname]\n end\n end\n\n respond!(csv_string, 200, 'Content-Type' => 'text/csv')\n end", "def month_by_month_csv\n CSV.generate do |csv|\n report_details.each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n csv.add_row ['VIEWS']\n month_by_month_table(Statistic::VIEW).each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n csv.add_row ['DOWNLOADS']\n month_by_month_table(Statistic::DOWNLOAD).each { |a| csv.add_row(a) }\n end\n end", "def out_file\n options.csv_matrix\n end", "def to_csv\n csvString = LineCounter.columnNames.join(',') + \"\\n\"\n self.each { |result| csvString += result.to_a.join(',') + \"\\n\"}\n csvString\n end", "def generate_output\n write_average_fitness('output/average.txt')\n write_best_fitness('output/best.txt')\n write_survivors('output/survivors.txt')\n write_traits('output/traits.txt')\n end", "def write_to_csv (time, platform, browser_name, browser_version, build, counter, num_cases, delay, duration, rate, test_name)\n googledrive_path=\"Google Drive/CODAP @ Concord/Software Development/QA\"\n localdrive_path=\"Documents/CODAP data/\"\n\n if !File.exist?(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\") || $new_file\n CSV.open(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\", \"wb\") do |csv|\n csv<<[\"Time\", \"Platform\", \"Browser\", \"Browser Version\", \"CODAP directory\", \"CODAP Build Num\", \"Test Name\", \"Counter\", \"Num of Cases\", \"Delay (s)\", \"Time Result (ms)\", \"Rate (cases/sec)\"]\n csv << [time, platform, browser_name, browser_version, build, $buildno, test_name, counter, num_cases, delay, duration, rate]\n end\n else\n CSV.open(\"#{Dir.home}/#{$dir_path}/#{$save_filename}\", \"a\") do |csv|\n csv << [time, platform, browser_name, browser_version, build, $buildno, test_name, counter, num_cases, delay, duration, rate]\n end\n end\nend", "def index\n\n # parse params hash \n @fact_aggregation = FactAggregation.new\n options = {\n :where => params[:filters],\n :group_by => params[:dimensions].split(\",\"),\n :frequency => params[:frequency],\n :summarize => params[:summarize] ? params[:summarize].split(\",\") : [],\n :tz_offset => params[:tz_offset]\n }\n # aggregate facts\n begin\n params[:metrics].split(\",\").each do |metric|\n ActiveRecord.const_get(metric.classify).aggregate(@fact_aggregation, options)\n end\n rescue Interrupt, SystemExit\n raise\n rescue\n render :text => nil, :status => 422\n return \n end\n\n respond_to do |format|\n format.html\n format.csv do \n @csv_rows = @fact_aggregation.to_csv({\n :facts => params[:metrics].split(\",\"),\n :dimensions => params[:dimensions].split(\",\"),\n :frequency => params[:frequency]\n })\n render_csv :data => @csv_rows\n end\n end\n end", "def to_csv(format = :long)\n output = ''\n \n columns = []\n # only output\n case format\n when :long\n columns.concat([@id, @updated, @title])\n end\n \n # output all dimensions\n columns.concat(@dimensions.map {|d| d.values.first})\n \n # output all metrics\n columns.concat(@metrics.map {|m| m.values.first})\n\n output = CSV.generate_line(columns) \n return output\n end", "def all_metrics\n valid_configs = MetricSample.all.where(:project_id => id)\n return [] if valid_configs.nil?\n metrics_name_ary = []\n valid_configs.each do |config|\n metrics_name_ary << config.metric_name\n end\n metrics_name_ary.uniq\n end", "def generate_tabular_report(filename, ostream)\n file = File.read(filename)\n data_hash = JSON.parse(file)\n rpt_data = transform(data_hash)\n rpt_data.keys.each do |name|\n ostream.puts\n ostream.puts name\n tbl = create_resources_table(rpt_data[name]['resources'])\n tbl.each do |r|\n ostream.puts r.join(\"\\t\")\n end\n end\nend", "def export_results\n paths = []\n export_dir = File.join(Hailstorm.root, Hailstorm.reports_dir, \"SEQUENCE-#{self.id}\")\n FileUtils.rm_rf(export_dir)\n FileUtils.mkpath(export_dir)\n self.client_stats.each do |cs|\n export_file_path = cs.write_jtl(export_dir)\n paths.push(export_file_path)\n end\n\n paths\n end", "def to_csv\n Redmine::Export::CSV.generate do |csv|\n # date range\n csv_min_date = [@ev.keys.min, @ac.keys.min, @pv.keys.min].min\n csv_max_date = [@ev.keys.max, @ac.keys.max, @pv.keys.max].max\n evm_date_range = (csv_min_date..csv_max_date).to_a\n # title\n csv << ['DATE', evm_date_range].flatten!\n # set evm values each date\n pv_csv = {}\n ev_csv = {}\n ac_csv = {}\n evm_date_range.each do |csv_date|\n pv_csv[csv_date] = @pv[csv_date].nil? ? nil : @pv[csv_date].round(2)\n ev_csv[csv_date] = @ev[csv_date].nil? ? nil : @ev[csv_date].round(2)\n ac_csv[csv_date] = @ac[csv_date].nil? ? nil : @ac[csv_date].round(2)\n end\n # evm values\n csv << ['PV', pv_csv.values.to_a].flatten!\n csv << ['EV', ev_csv.values.to_a].flatten!\n csv << ['AC', ac_csv.values.to_a].flatten!\n end\n end", "def topic_report\n topic = Topic.find(params[:id])\n @posts = topic.posts.find(:all, :order => \"created_at DESC\")\n report = StringIO.new\n CSV::Writer.generate(report, ',') do |csv|\n csv << %w(body size user date)\n @posts.each do |post|\n csv << [post.body, post.size, post.user.whole_name, post.created_at]\n end\n end\n export_as_csv(report,topic.title) \n end", "def print_as_csv\n file_data = []\n file_data << headers\n @case_data_by_date_map.each do |_, elements|\n file_data += elements.shuffle\n end\n\n file_data.each do |element|\n puts element.join(',')\n end\n end", "def projects_analysis\n @projects.each { |p| project_analysis(p) if File.directory?(p) }\n end", "def project_summary\n move_down 50\n summary = [[\"Project Summary\",\"\",\"\",\"\"],\n [\"Project Name\",\"Sales Person\",\"Project Status\",\"No. of Sites\"],\n [@project.project_name, \"#{@project.sales_person.sales_person_first_name} #{@project.sales_person.sales_person_last_name}\", @project.project_status.project_status_name ,@project.project_sites.count],\n [\"Project Setting\",\"Procurement Tool\",\"Deal Type\",\"Irrigation Responsibility\"],\n [@project.project_setting.project_setting_name,@project.procurement_tool.procurement_tool_name,@project.deal_type.deal_type_name,@project.irrigation_responsibility.irrigation_responsibility_name]\n ]\n table summary do\n rows(0..1).font_style = :bold\n row(3).font_style = :bold\n rows(0).background_color = \"a414e2\"\n rows(0).text_color = \"FFFFFF\"\n self.row_colors = [\"addbed\",\"25b2ea\"]\n column(0).width = 160\n column(1).width = 125\n column(2).width = 126\n column(3).width = 126\n columns(0..3).size = 10\n column(0).row(0).borders = :top, :left\n columns(1..2).row(0).borders = :top, :bottom\n column(3).row(0).borders = :top, :bottom, :right\n end\n end", "def index\n authorize! :view, Measurement\n\n @measurements = Measurement.all\n\n @sites = Site.all\n @instruments = Instrument.all\n \n respond_to do |format|\n format.html\n format.csv { send_data @measurements.to_csv }\n end\n end", "def to_csv(options = {})\n if [\"html\", \"pdf\", \"combined\"].include? options[:format]\n view = \"pmc_#{options[:format]}_views\"\n else\n view = \"pmc\"\n end\n\n service_url = \"#{ENV['COUCHDB_URL']}/_design/reports/_view/#{view}\"\n\n result = get_result(service_url, options.merge(timeout: 1800))\n if result.blank? || result[\"rows\"].blank?\n Alert.create(exception: \"\", class_name: \"Faraday::ResourceNotFound\",\n message: \"CouchDB report for PMC could not be retrieved.\",\n source_id: id,\n status: 404,\n level: Alert::FATAL)\n return nil\n end\n\n if view == \"pmc\"\n CSV.generate do |csv|\n csv << [\"pid_type\", \"pid\", \"html\", \"pdf\", \"total\"]\n result[\"rows\"].each { |row| csv << [\"doi\", row[\"key\"], row[\"value\"][\"html\"], row[\"value\"][\"pdf\"], row[\"value\"][\"total\"]] }\n end\n else\n dates = date_range(options).map { |date| \"#{date[:year]}-#{date[:month]}\" }\n\n CSV.generate do |csv|\n csv << [\"pid_type\", \"pid\"] + dates\n result[\"rows\"].each { |row| csv << [\"doi\", row[\"key\"]] + dates.map { |date| row[\"value\"][date] || 0 } }\n end\n end\n end", "def generate_csv\n csv_string = CSV.generate do |csv|\n csv << [\"Sl no.\",\"Scheme\",\"IP no.\", \"Patient name\", \"UHID no.\", \"Reg no.\", \"DOA\", \"DOS\", \"DOD\", \"Plan of treatment\", \"Approved Amount\",\"Claim Amount\", \"TDS\",\"Net Amount\",\"Hospital charges\",\"Medicine charges\",\"Implant charges\"]\n sl_no = 1\n @claims.each do |claim|\n csv <<[sl_no,\"#{claim.scheme rescue \"\"}\",\"#{claim.ip_no rescue \"\"}\",\"#{claim.patient_name rescue \"\"}\",\"#{claim.uhid_no rescue \"\"}\",\"#{claim.reg_no rescue \"\"}\",\"#{claim.date_of_admission}\",\"#{claim.date_of_surgery}\",\"#{claim.date_of_discharge}\",\"#{claim.plan_of_treatment rescue \"\"}\",(claim.approved_amount rescue 0.0),(claim.claim_amount rescue 0.0),(claim.tds_amount rescue 0.0),(claim.net_amount rescue 0.0),(claim.hospital_charge rescue 0.0),(claim.medicine_charge rescue 0.0),(claim.implant_charge rescue 0.0)]\n sl_no +=1\n end\n end\n csv_string\n end", "def generateCSV(issuesData, milestoneData)\n\n\t\t# csv_string = CSV.generate do |csv|\n\t\t# csv << data.first.keys\n\t\t# data.each do |hash|\n\t\t# \tcsv << hash.values\n\t\t# end\n\t\t# end\n\n\t\tAxlsx::Package.new do |p|\n\t\t p.workbook.add_worksheet(:name => \"Issues\") do |sheet|\n\t\t\tsheet.add_row issuesData.first.keys\n\t\t \n\t\t issuesData.each do |hash|\n\t\t\t\tsheet.add_row hash.values\n\t\t \tend\n\n\t\t end\n\t\t p.workbook.add_worksheet(:name => \"Milestones\") do |sheet|\n\t\t\tsheet.add_row milestoneData.first.keys\n\n\t\t milestoneData.each do |hash|\n\t\t\t\tsheet.add_row hash.values\n\t\t \tend\n\n\t\t end\n\n\t\t return p.to_stream\n\t\tend\n\n\n\n\n\tend", "def stg_provider_report_csv(filename)\n puts 'Creating the Storage Providers report'\n CSV.open(\"#{filename}\", 'ab') do |csv|\n csv << [\"\\n\"]\n csv << %w(Storage_Providers_List)\n csv << %w(Storage_Provider_Name Storage_Provider_Type Storage_Provider_Health Storage_Provider_Total_Cap Storage_Provider_Free_Cap)\n stg_provider_report\n csv_array(@stg_provider_csv_array, csv)\n end\n puts 'Done'\n end", "def index\n @practices = policy_scope(Practice).includes(:primary_contacts, :ehr_helpers, :ehr_extractors, :site, :partners).all\n respond_to do |format|\n format.html\n format.csv\n end\n end", "def write_analyzed(dir)\n FileUtils.mkdir_p(dir)\n\n attributes.each do |a, v|\n path = File.join(dir, a.to_s)\n s = \"Count|Value\\n\" + v.map { |e| \"#{e[:count]}|#{e[:value]}\" }.join(\"\\n\")\n File.open(\"#{path}.csv\", 'w') { |f| f.write(s) }\n end\n end", "def writeCSV(file_name)\n generated_array = transaction(file_name)\n array_from_csv = read_file(file_name)\n final_hash = merge_arrays(array_from_csv, generated_array)\n binding.pry\n\n CSV.open(\"results.csv\", \"w\") do |row|\n final_hash.each do |nested_hash|\n row << [nested_hash[\"SKU\"], nested_hash[\"quantity\"]]\n end #end each nested_hash loop\n end #end csv loop\nend", "def generate_json_files\n # if no job is served, generate all\n filter do |project, group, job|\n job.generate_json_file\n end\n end", "def to_csv\n [@name, @description, @prep_time, @done]\n end", "def generate_report\n self.consume_stdin\n self.data_sorter\n\n @drivers.each do |driver|\n driver.total_duration\n driver.distance_calculator\n driver.average_speed\n end\n\n self.compile_report\n end", "def create_summary_csv(summary_csv_path)\n puts \"creating summary csv: #{summary_csv_path}\"\n\n CSV.open(summary_csv_path, \"wb\") do |csv|\n csv << SUMMARY_CSV_HEADINGS\n end\nend", "def as_csv(*)\n populate_carriers!\n\n CSV.generate do |csv|\n csv << [\n 'key', 'primary_co2_emission',\n *primary_carriers.map { |c| \"primary_demand_of_#{c} (MJ)\" },\n *final_carriers.map { |c| \"final_demand_of_#{c} (MJ)\" }\n ]\n\n @graph.group_nodes(:application_group).each do |node|\n csv << node_row(node)\n end\n end\n end", "def csv_report\n tire_cols = params[:tire] || {}\n ar_cols = params[:activerecord] || {}\n assocs_to_include = params[:assoc][:include] || {}\n params[:assoc][:max] ||= {}\n klass = model_class.constantize\n @filename = \"#{model_class.humanize}.csv\"\n\n response.headers['Content-Type'] ||= 'text/plain'\n response.headers['Content-Disposition'] = \"attachment; filename=#{@filename}\"\n response.headers['Content-Transfer-Encoding'] = 'binary'\n response.headers['Last-Modified'] = Time.now.to_s\n\n # Right, try to define a header:\n header = []\n tire_cols.keys.each { |x| header.push(x.humanize) }\n ar_cols.keys.each { |x| header.push(x.humanize) }\n assocs_to_include.keys.each do |assoc|\n if params[:assoc][:max][assoc] == 'join' # Is a has_many with only one real column\n header.push params[:assoc][assoc.to_sym].keys.first\n elsif params[:assoc][:max][assoc] # has_many\n (1 .. (params[:assoc][:max][assoc].to_i)).each do |i|\n params[:assoc][assoc.to_sym].keys.each do |k|\n header.push(\"#{assoc.singularize.humanize} #{i} #{k.humanize}\")\n end\n end\n else # has_a\n params[:assoc][assoc.to_sym].keys.each do |k| # Each key requested from the associated record\n header.push \"#{assoc.humanize} #{k.humanize}\"\n end\n end\n end\n\n results = klass.search({ per: TireSearch::INFINITY }, 1, '')\n self.response_body = Enumerator.new do |y|\n results.each_with_index do |result, i|\n y << header.to_csv if i == 0\n\n line = []\n tire_cols.keys.each { |x| line.push(result[x]) }\n\n result = result.load if ar_cols.count > 0 || assocs_to_include.keys.count > 0\n\n ar_cols.keys.each { |x| line.push(result.send(x)) } if ar_cols.count > 0\n\n assocs_to_include.keys.each do |assoc|\n related = result.send(assoc)\n if params[:assoc][:max][assoc] == 'join' # Is a has_many with only one real column\n col = params[:assoc][assoc.to_sym].keys.first\n line.push related.map { |x| x.send(col) }.join(' // ')\n elsif params[:assoc][:max][assoc]\n (0 .. (params[:assoc][:max][assoc].to_i - 1)).each do |j|\n params[:assoc][assoc.to_sym].keys.each do |k|\n line.push(related[j] ? related[j].send(k) : nil)\n end\n end\n else\n params[:assoc][assoc.to_sym].keys.each do |k| # Each key requested from the associated record\n line.push related ? related.send(k) : nil\n end\n end\n end\n y << line.to_csv\n GC.start if i % 500 == 0\n end\n end\n end", "def index\n my_tenant_id = (current_user.role == 'admin' ? current_user.tenant_id : nil)\n @all_stats = Stats.new\n @seven_day_stats = Stats.new(tenant_id: my_tenant_id, since: (Time.new - 7.days))\n @resources = build_table_query\n # If no records were found and a search parameter was specified, requery with\n # a ful text search to find partial word matches\n @resources = build_table_query(true) if @resources.empty? && params[:q].present? && params[:q].length > 4\n @publications = InternalDatum.where(data_type: 'publicationName').order(:value).pluck(:value).uniq\n respond_to do |format|\n format.html\n format.csv\n end\n end", "def to_csv\n CSV.generate do |csv|\n csv << %w[word count]\n sort_words.each do |word_count|\n csv << word_count\n end\n end\n end", "def export_project(project)\n return [\n project.id,\n project.name,\n project.description,\n project.homepage,\n project.is_public ? 1 : 0,\n project.parent ? project.parent.identifier : nil,\n project.created_on ? project.created_on.strftime('%Y-%m-%d %H:%M:%S') : nil,\n project.updated_on ? project.updated_on.strftime('%Y-%m-%d %H:%M:%S') : nil,\n project.identifier,\n project.status,\n project.enabled_module_names * ',',\n project.trackers.collect(&:name) * ',',\n project.issue_custom_fields.collect(&:name) * ',',\n ]\n end", "def write_csv_report\n unless @csv.nil?\n @csvexport.write(@csv)\n end\n end", "def index\n @task = Task.new\n if params[:range].blank?\n @daterange = Date.today.beginning_of_month.strftime('%Y/%m/%d') + ' - ' + Date.today.end_of_month.strftime('%Y/%m/%d')\n else\n @daterange = params[:range]\n end\n @tasks = Task.between(@daterange).includes(:project)\n\n if params[:commit] == \"csv\"\n generated_csv = @tasks.to_csv\n send_data generated_csv.encode(Encoding::CP932, invalid: :replace, undef: :replace),\n filename: 'tasks.csv',\n type: 'text/csv; charset=shift_jis'\n\n return\n end\n\n @report = @tasks.inject(Hash.new(0)) {|r, task| r[task.project] += task.time_hour; r}\n render :index\n end", "def index\n @search = Claim.order('claims.created_at desc').search(params[:q])\n @claims = @search.result(:distinct => true).paginate(:per_page => 50, :page => params[:page])\n respond_to do |format|\n format.html{}\n format.csv {\n send_data generate_csv, :type => 'text/csv; charset=iso-8859-1; header=present', :disposition => \"attachment; filename=claims_list.csv\" \n }\n end\n end", "def add_result_iter_clades(base)\n r = MiGA::Result.new(\"#{base}.json\")\n r.add_file(:report, 'miga-project.pdf')\n r.add_file(:class_table, 'miga-project.class.tsv')\n r.add_file(:class_tree, 'miga-project.class.nwk')\n r.add_file(:classif, 'miga-project.classif')\n r.add_file(:medoids, 'miga-project.medoids')\n r\n end", "def index\n @samples = Sample.approved_or_rejected.page(params[:page]).per(100)\n respond_to do |format|\n format.html\n format.csv do\n render_csv\n end\n end\n end", "def flavor_report_csv(filename)\n puts 'Creating the Flavors report'\n CSV.open(\"#{filename}\", 'ab') do |csv|\n csv << [\"\\n\"]\n csv << %w(Compute_Template_List)\n csv << %w(Template_Name VCPU Memory Min_VCPU Max_VCPU Min_EC Desired_EC Max_EC Dedicated_CPU Min_Mem Max_Mem Proc_Compatibility_Mode CPU_Pool_Name Shared_CPU_Weight SRR_Capability)\n flavor_report\n csv_array(@flavor_print_array, csv)\n end\n puts 'Done'\n end", "def export_csv(csv_data)\n\t\tFile.write(\"kfit_partners.csv\", csv_data.map(&:to_csv).join)\n\tend", "def index\n @goldmeasures = Goldmeasure.all\n\n respond_to do |format|\n format.html \n format.json\n format.csv { send_data @goldmeasures.to_csv }\n\n end\n end", "def export_file_name\n \"#{@hq}#{name}.#{requests}-#{concurrency}.csv\"\n end", "def export\n @transactions = Transaction.find_all_by_user_id(current_user.id)\n csv = \"\"\n i = 0\n @transactions.each do |trans|\n if (i==0)\n csv += trans.to_csv(true)\n else\n csv += trans.to_csv(false)\n end\n i += 1\n end\n\n respond_to do |format|\n format.csv { send_data csv }\n end\n end", "def getCsvText\r\n sep = \"|\"\r\n t = \"\"\r\n \r\n t << \"Question Number\" + sep \r\n questions.size.times do |i| \r\n t << (i + 1).to_s + sep \r\n end\r\n t << \"Points\"\r\n t << \"\\n\"\r\n \r\n t << \"Correct Answer\" + sep\r\n for question in questions \r\n t << correctAnswerText(question).to_s + sep \r\n end \r\n t << \"\\n\"\r\n \r\n for user in users \r\n t << user.getName + sep\r\n for question in questions \r\n t << answerText(user, question) + sep\r\n end \r\n t << getPoints(user).to_s\r\n t << \"\\n\" \r\n end\r\n return t \r\nend" ]
[ "0.6441021", "0.62983656", "0.61877155", "0.6161644", "0.6152706", "0.61481494", "0.61361086", "0.5933046", "0.5900733", "0.5875254", "0.5866604", "0.58657247", "0.5827197", "0.5797892", "0.57410026", "0.5737299", "0.57358277", "0.5703527", "0.56919885", "0.5667934", "0.56667066", "0.56652147", "0.56640977", "0.56635034", "0.5649474", "0.56493783", "0.56489235", "0.5642232", "0.5633025", "0.5609928", "0.55852145", "0.5582367", "0.5582092", "0.5562283", "0.5560587", "0.55437404", "0.55420095", "0.5525005", "0.5520339", "0.55080605", "0.54771453", "0.54767245", "0.54610544", "0.5441123", "0.5436045", "0.54251426", "0.54076004", "0.53918236", "0.5388745", "0.53863794", "0.5374762", "0.5363336", "0.5354681", "0.53453106", "0.5337368", "0.5336242", "0.5331393", "0.53313833", "0.5324134", "0.53207606", "0.5319683", "0.53194535", "0.5318612", "0.5315996", "0.5310744", "0.5307349", "0.53058803", "0.5303017", "0.5290892", "0.52876186", "0.5286961", "0.5277189", "0.5271233", "0.52700883", "0.52669996", "0.5266244", "0.52644426", "0.5258255", "0.5254594", "0.52477384", "0.52461696", "0.5244612", "0.52425456", "0.52330005", "0.52304596", "0.5220704", "0.5219937", "0.521834", "0.52176595", "0.521486", "0.5209977", "0.5203945", "0.51947695", "0.5189781", "0.5182001", "0.51765203", "0.5170467", "0.5169964", "0.51682574", "0.5166519" ]
0.5439848
44
Method declaration Generate a single CSV file (for the aggregated sample.) with all grouped metrics for statistical analysis.
def generateCVSToStatisticAnalysisAggregatedSample(projectName, localClone, pathInput, pathOutput) #Dir.chdir localClone prefixProjectName = formatProjectName(projectName) projectsList = [] #projectName = "netguru" File.open(localClone+pathOutput+prefixProjectName+"_AllVariables.csv", "r") do |text| #indexLine = 0 text.gets #ler o cabeçalho text.each_line do |line| lista = line.split(",") mergeCommitID = lista[0] #puts "mergeCommitID = #{mergeCommitID}" isConflicting = lista[1] existsCommonSlice = lista[2] totalCommonSlices = lista[3] #puts "totalCommonSlices = #{totalCommonSlices}" conflictingFilesNumber = lista[4] conflictsNumber = lista[5] numberOfCommitsArithAverage = lista[6] numberOfCommitsGeoAverage = lista[7] numberOfAuthorsArithAverage = lista[8] numberOfAuthorsGeoAverage = lista[9] delayIntegrationArithAverage = lista[10] delayIntegrationGeoAverage = lista[11] deltaIntegration = lista[12] minimumLifeTimeArithAverage = lista[13] minimumLifeTimeGeoAverage = lista[14] numberOfChangedFilesArithAverage = lista[15] numberOfChangedFilesGeoAverage = lista[16] numberOfChangedLinesArithAverage = lista[17] numberOfChangedLinesGeoAverage = lista[18] contributionConclusionDelay = lista[19] existsCommonPackages = lista[20] totalCommonPackages = lista[21] #puts "existsCommonPackages = #{existsCommonPackages}" #puts "totalCommonPackages = #{totalCommonPackages}" mergeCommitID = lista[0].gsub("\r","").gsub("\n","") dados = mergeCommitID+","+isConflicting+","+existsCommonSlice+","+totalCommonSlices+","+conflictingFilesNumber+","+conflictsNumber+","+numberOfCommitsArithAverage+","+numberOfCommitsGeoAverage+","+numberOfAuthorsArithAverage+","+numberOfAuthorsGeoAverage+","+delayIntegrationArithAverage+","+delayIntegrationGeoAverage+","+deltaIntegration+","+minimumLifeTimeArithAverage+","+minimumLifeTimeGeoAverage+","+numberOfChangedFilesArithAverage+","+numberOfChangedFilesGeoAverage+","+numberOfChangedLinesArithAverage+","+numberOfChangedLinesGeoAverage+","+contributionConclusionDelay+","+existsCommonPackages+","+totalCommonPackages projectsList.push(dados.gsub("\n", "")) end end File.open(localClone+pathOutput+"allProjects_AllVariables.csv", 'a') do |file| if (File.size(localClone+pathOutput+"allProjects_AllVariables.csv") == 0) file.puts "mergeCommitID,isConflicting,existsCommonSlice,totalCommonSlices,conflictingFilesNumber,conflictsNumber,numberOfCommitsArithAverage,numberOfCommitsGeoAverage,numberOfAuthorsArithAverage,numberOfAuthorsGeoAverage,delayIntegrationArithAverage,delayIntegrationGeoAverage,deltaIntegration,minimumLifeTimeArithAverage,minimumLifeTimeGeoAverage,numberOfChangedFilesArithAverage,numberOfChangedFilesGeoAverage,numberOfChangedLinesArithAverage,numberOfChangedLinesGeoAverage,contributionConclusionDelay,existsCommonPackages,totalCommonPackages" end projectsList.each do |dado| file.puts "#{dado}" end end puts "end running generateCVSToStatisticAnalysisAggregatedSample from #{prefixProjectName} project" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def genCsvSummary()\n csv = [] ;\n to_a.each{|analyzer|\n csv.push(analyzer.genCsvRowSummary()) ;\n }\n return csv ;\n end", "def to_csv\n initialize_generator\n csv_report_generator.records = pull_join\n csv_report_generator.generate_report\n end", "def to_csv\n CSV.generate(\"\", encoding: 'UTF-8') do |csv|\n csv << %w(study_group name)\n get_groups.each_with_index do |group, index|\n group.each do |student|\n csv << [index + 1, student]\n end\n end\n end\n end", "def dumpCsvSummary()\n CSV.open(csvFilenameSummary(), \"w\", { :col_sep => csvColSepChar() }) { |csv|\n csv << AnalyzerExpA.genCsvTitleRow() ;\n genCsvSummary().each{|row|\n csv << row ;\n }\n }\n end", "def generateReport\n filePath = \"#{@reportFolder}/report.csv\"\n file = File.open(filePath, 'w')\n file.puts ['Screen', 'Description', 'Automation Message', 'Status'].join(',')\n @report.each do |result|\n file.puts result.join(',')\n end\n file.close\n end", "def summary_csv(user)\n return '' unless user.admin?\n\n if user.admin?\n groupings = self.groupings\n .includes(:group,\n :accepted_students,\n current_result: :marks)\n else\n groupings = self.groupings\n .includes(:group,\n :accepted_students,\n current_result: :marks)\n .joins(:memberships)\n .where('memberships.user_id': user.id)\n end\n\n headers = [['User name', 'Group', 'Final grade'], ['', 'Out of', self.max_mark]]\n self.ta_criteria.each do |crit|\n headers[0] << (crit.bonus? ? \"#{crit.name} (#{Criterion.human_attribute_name(:bonus)})\" : crit.name)\n headers[1] << crit.max_mark\n end\n headers[0] << 'Bonus/Deductions'\n headers[1] << ''\n\n result_ids = groupings.pluck('results.id').uniq.compact\n extra_marks_hash = Result.get_total_extra_marks(result_ids, max_mark: max_mark)\n CSV.generate do |csv|\n csv << headers[0]\n csv << headers[1]\n\n groupings.each do |g|\n result = g.current_result\n marks = result.nil? ? {} : result.mark_hash\n g.accepted_students.each do |s|\n row = [s.user_name, g.group.group_name]\n if result.nil?\n row += Array.new(2 + self.ta_criteria.count, nil)\n else\n row << result.total_mark\n row += self.ta_criteria.map { |crit| marks[crit.id] }\n row << extra_marks_hash[result&.id]\n end\n csv << row\n end\n end\n end\n end", "def generate_report\n CSV.generate(write_headers: false, headers: headers) do |csv|\n # Don't want to rely on `write_headers: true` since we want still\n # header row in the CSV file even when there is no data.\n csv << headers\n records.each do |record|\n csv << method_names.map { |method_name| record.public_send method_name }\n end\n end\n end", "def save_groups_to_csv\n\t\tCSV.open(\"groups.csv\", \"w\") do | csv | \n\t\t\[email protected] do |row|\n\t\t\t\tcsv << row\n\t\t\tend\n\t\tend\n\tend", "def generate_csv\n\n fields = @resource[:class].typus_fields_for(:csv).collect { |i| i.first }\n\n require 'csv'\n if CSV.const_defined?(:Reader)\n # Old CSV version so we enable faster CSV.\n begin\n require 'fastercsv'\n rescue Exception => error\n raise error.message\n end\n csv = FasterCSV\n else\n csv = CSV\n end\n\n filename = \"#{Rails.root}/tmp/export-#{@resource[:self]}-#{Time.now.utc.to_s(:number)}.csv\"\n\n options = { :conditions => @conditions, :batch_size => 1000 }\n\n csv.open(filename, 'w', :col_sep => ';') do |csv|\n csv << fields\n @resource[:class].find_in_batches(options) do |records|\n records.each do |record|\n csv << fields.map { |f| record.send(f) }\n end\n end\n end\n\n send_file filename\n\n end", "def output_csv(datastore)\n CSV.open(OUTPUT_CSV, \"wb\") do |csv|\n csv << \t[\"Period\", \"First Use In\", \"Engaged Users\"]\n\n datastore.keys.sort.each do |date_key|\n pretty_date = Date.parse(date_key.split(\"_\")[0]).strftime(\"%Y-%m-%d\")\n datastore[date_key].keys.sort.each do |cohort_key|\n pretty_cohort= Date.parse(cohort_key.split(\"_\")[0]).strftime(\"%Y-%m-%d\")\n csv << [ pretty_date, pretty_cohort,\tdatastore[date_key][cohort_key]['total_users']]\n end\n end\n end\nend", "def generate_csv\n\n fields = @resource.typus_fields_for(:csv)\n\n require 'csv'\n if CSV.const_defined?(:Reader)\n # Old CSV version so we enable faster CSV.\n begin\n require 'fastercsv'\n rescue Exception => error\n raise error.message\n end\n csv = FasterCSV\n else\n csv = CSV\n end\n\n filename = Rails.root.join(\"tmp\", \"export-#{@resource.to_resource}-#{Time.now.utc.to_s(:number)}.csv\")\n\n options = { :conditions => @conditions, :batch_size => 1000 }\n\n csv.open(filename, 'w', :col_sep => ';') do |csv|\n csv << fields.keys\n @resource.find_in_batches(options) do |records|\n records.each do |record|\n csv << fields.map do |key, value|\n case value\n when :transversal\n a, b = key.split(\".\")\n record.send(a).send(b)\n when :belongs_to\n record.send(key).to_label\n else\n record.send(key)\n end\n end\n end\n end\n end\n\n send_file filename\n\n end", "def student_all_report\n @user = User.find(params[:id])\n report = StringIO.new\n CSV::Writer.generate(report, ',') do |csv|\n #Get Words\n @words = @user.word_answers.find(:all, :order => \"question_id ASC\")\n csv << %w(question answer date)\n @words.each do |answer|\n csv << [answer.word.value, answer.value, answer.created_at]\n end\n #Get Situations\n @situation_answers = @user.completion_answers.find(:all, :order => \"question_id ASC\")\n @situation_answers.each do |answer|\n csv << [answer.completion.value, answer.value, answer.created_at]\n end\n #Get Scenarios\n @scenario_answers = @user.scenario_answers.find(:all, :order => \"question_id ASC\")\n @scenario_answers.each do |answer|\n csv << [answer.scenario.value, answer.value, answer.created_at]\n end\n \n #Get posts\n @posts = @user.posts.find(:all, :order => \"created_at DESC\")\n @posts.each do |post|\n csv << [post.topic.title, post.body, post.created_at]\n end\n end\n export_as_csv(report,@user.whole_name+\"-all\")\n end", "def generate_csv\n csv_string = CSV.generate do |csv|\n csv << [\"Sl no.\",\"Scheme\",\"IP no.\", \"Patient name\", \"UHID no.\", \"Reg no.\", \"DOA\", \"DOS\", \"DOD\", \"Plan of treatment\", \"Approved Amount\",\"Claim Amount\", \"TDS\",\"Net Amount\",\"Hospital charges\",\"Medicine charges\",\"Implant charges\"]\n sl_no = 1\n @claims.each do |claim|\n csv <<[sl_no,\"#{claim.scheme rescue \"\"}\",\"#{claim.ip_no rescue \"\"}\",\"#{claim.patient_name rescue \"\"}\",\"#{claim.uhid_no rescue \"\"}\",\"#{claim.reg_no rescue \"\"}\",\"#{claim.date_of_admission}\",\"#{claim.date_of_surgery}\",\"#{claim.date_of_discharge}\",\"#{claim.plan_of_treatment rescue \"\"}\",(claim.approved_amount rescue 0.0),(claim.claim_amount rescue 0.0),(claim.tds_amount rescue 0.0),(claim.net_amount rescue 0.0),(claim.hospital_charge rescue 0.0),(claim.medicine_charge rescue 0.0),(claim.implant_charge rescue 0.0)]\n sl_no +=1\n end\n end\n csv_string\n end", "def print_csv_results\n FileUtils.mkdir_p(\"data\")\n File.open(\"data/results.csv\", \"w\") do |f|\n @data.sort_by{|id, values| values[\"sum_dose\"]}.each do |id, values|\n f.puts \"%s\\t%d\\t%.4f\" % [id, values[\"ddays\"], dose_unit(values[\"sum_dose\"])]\n end\n end\n end", "def create_finals_file\n file = File.open('final.csv', 'w')\n $students.each do |student|\n name = student[:name]\n avg = get_avggrades(student)\n file.puts \"#{name} #{avg}\"\n end\n file.close\nend", "def export_csv\n export_string = \"#{@id},#{type_string},#{@name.gsub(/[\\,,\\s]/,\"\")},\"\n @details.each{|k,v| export_string << \"#{k}=#{v};\".gsub(/[\\,,\\s]/,\"\") }\n export_string\n end", "def export_csv\n export_string = \"#{@id},#{type_string},#{@name.gsub(/[\\,,\\s]/,\"\")},\"\n @details.each{|k,v| export_string << \"#{k}=#{v};\".gsub(/[\\,,\\s]/,\"\") }\n export_string\n end", "def get_csv\n CSV.generate do |csv|\n csv << ['Name','Student ID','User ID','Role','Email Address','Sections']\n get_feed[:students].each do |student|\n name = student[:last_name] + ', ' + student[:first_name]\n user_id = student[:login_id]\n student_id = student[:student_id]\n email_address = student[:email]\n role = ENROLL_STATUS_TO_CSV_ROLE[student[:enroll_status]]\n sections = sections_to_name_string(student[:sections])\n csv << [name, student_id, user_id, role, email_address, sections]\n end\n end\n end", "def create_scale_results_csv_file(scale_results_parent_dir)\n CSV.open(\"#{scale_results_parent_dir}/PERF_SCALE_#{@scale_timestamp}.csv\", \"wb\") do |csv|\n headings = [\"agents\",\n \"ok\",\n \"ko\",\n \"combined mean\",\n \"catalog mean\",\n \"filemeta plugins mean\",\n \"filemeta pluginfacts mean\",\n \"locales mean\",\n \"node mean\",\n \"report mean\",\n \"average CPU %\",\n \"average memory\"]\n\n csv << headings\n end\n end", "def to_csv()\n all = general_info_csv() + \"\\r\\n\" +\n teacher_for_csv() + \"\\r\\n\" +\n contributor_to_csv() + \"\\r\\n\" +\n published_in_csv() + \"\\r\\n\" +\n text_fields_csv()\n all\n end", "def to_csv(format = :long)\n output = ''\n \n columns = []\n # only output\n case format\n when :long\n columns.concat([@id, @updated, @title])\n end\n \n # output all dimensions\n columns.concat(@dimensions.map {|d| d.values.first})\n \n # output all metrics\n columns.concat(@metrics.map {|m| m.values.first})\n\n output = CSV.generate_line(columns) \n return output\n end", "def to_csv\n @csv ||= format_csv\n end", "def report\n\t\t dir = \"./report/\"\n File.open(dir + \"method.mmd\", \"w\") do |f|\n f.puts \"# Methods #\"\n Dir[\"./experiments/*/*.rb\"].each do |desc|\n if File.basename(desc) == File.basename(File.dirname(desc)) + \".rb\"\n File.read(desc).split(\"\\n\").each do |line|\n if m = line.match(/^\\# (.+)/)\n f.puts m[1]\n else\n break\n end\n end\n f.puts\n f.puts\n end\n end\n end\n require 'csv'\n require \"yaml\"\n require File.dirname(__FILE__) + \"/stats\"\n CSV.open(dir + \"/data.csv\", \"w\") do |csv|\n data = {}\n Dir[\"./results/*/results.yaml\"].each do |res|\n d = YAML::load_file(res)\n da = {}\n d.each do |k, vals|\n da[k.to_s + \" mean\"], da[k.to_s + \" sd\"] = Stats::mean(vals), Stats::standard_deviation(vals)\n vals.each_with_index do |v, i|\n da[k.to_s + \" cv:\" + i.to_s] = v\n end\n end\n array_merge(data, da)\n end\n data.keys.map do |key| \n \t\t # calculate stats\n \t\t a = data[key]\n \t\t [key] + a\n \t\t end.transpose.each do |row|\n \t\t csv << row\n \t\t end\n end\n\t\t\n\t\tend", "def generate_csv_file(file)\n puts \"generating CSV file #{file}\"\n CSV.open(file, \"w\") do |csv|\n csv << get_columns()\n @data.each { |series|\n (series.data.keys.map { |x| Integer(x) }).sort.each { |y|\n x = y.to_s\n # TODO: Find out why this doesn't work with log plots in R\n if (!series.data[x].nil? && Integer(x) > 0)\n csv << [series.title,Integer(x)/1000.0,series.data[x]]\n elsif (Integer(x) == 0) \n csv << [series.title,0.001,series.data[x]]\n end\n }\n }\n end\n end", "def create_summary_csv(summary_csv_path)\n puts \"creating summary csv: #{summary_csv_path}\"\n\n CSV.open(summary_csv_path, \"wb\") do |csv|\n csv << SUMMARY_CSV_HEADINGS\n end\nend", "def scg_report_csv(filename)\n puts 'Creating the Storage Connectivity Groups report'\n CSV.open(\"#{filename}\", 'ab') do |csv|\n csv << [\"\\n\"]\n csv << %w(Storage_Connectivity_Groups_List)\n csv << %w(SCG_Name SCG_Auto_Add_VIOs SCG_FC_Storage_Access SCG_Ports_per_Fabric SCG_Host_List SCG_VIOs_List)\n scg_report\n csv_array(@scg_csv_array, csv)\n end\n puts 'Done'\n end", "def export_csofeed\n # Create header row #\n header = ['Record Type', 'Device Key', 'IP Addresses', 'MAC Addresses', 'System Name', 'FQDN', 'Status', 'Function', 'Runs MOTS/PRISM Apps', 'MOTS/PRISM IDs', 'Runs Non-MOTS/PRISM Apps', 'Internet Facing', 'Device Criticality', 'Device Owner', 'Operating System', 'Operating System Version', 'Administrator\\'s ATTUID', 'Support Group', 'Serial Number', 'Asset Tag Number', 'Location', 'Location CLLI', 'Comments' \"\\n\"]\n csvdoc = [header.join(',')]\n Node.all.each do |node|\n result = make_csoline(node)\n csvdoc << result.join(',') if result\n end\n fname = \"public/csvexports/csofeed_#{Time.now.strftime(\"%d%m%Y\")}.csv.gz\"\n File.open(fname, 'w') do |f|\n gz = Zlib::GzipWriter.new(f)\n gz.write csvdoc\n gz.close\n end\n end", "def genCsvRowSummary()\n row = configIndex() ;\n\n row.push(getAveSpeed()) ;\n row.push(getShareRatio()) ;\n row.push(getCumulativeShare()) ;\n return row ;\n end", "def to_csv\n \"#{@key},#{@expected},#{@type}\"\n end", "def to_csv\n CSV.generate do |csv|\n csv << %w[word count]\n sort_words.each do |word_count|\n csv << word_count\n end\n end\n end", "def create_csv()\n hashes = Transaction.all_as_hashes\n CSV.generate do |csv|\n # Adds the keys as headings on the first line\n csv << hashes.first.keys\n # Iterates through the transactions and populates CSV\n hashes.each do |hash|\n csv << hash.values\n end\n end\n end", "def to_csv\n csvString = LineCounter.columnNames.join(',') + \"\\n\"\n self.each { |result| csvString += result.to_a.join(',') + \"\\n\"}\n csvString\n end", "def period_csv\n CSV.generate do |csv|\n report_details.each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n time_period_table.each { |a| csv.add_row(a) }\n end\n end", "def export_stat_for(unit, start_at, end_at)\n cond = [\"unit = ? and basedate > ? and basedate < ?\", unit, start_at, end_at] #Date.parse(start_at) , Date.parse(end_at)]\n rids = Rule.stat_rules.map(&:rid)\n #FOREACH DocType\n File.open(\"stat_#{unit}_#{start_at}_#{end_at}.txt\",\"w\") do |f|\n #debugger\n f.puts((['basedate'].concat rids).join(\"\\t\")+\"\\n\")\n f.puts Stat.all(:conditions=>cond).group_by(&:basedate). # group by date\n map{|basedate,stats|[unit,basedate.ymd, rids.to_val(stats.map_hash{|e|[e.rid,e.content.to_f]}, :def_val=>nil)].flatten}. # turn into feature vector\n sort_by{|e|e[0]}.map{|e|e.join(\"\\t\")}.join(\"\\n\")\n end\nend", "def generate_csv\n @project = Project.find(params[:id])\n \n content_type = if request.user_agent =~ /windows/i\n ' application/vnd.ms-excel '\n else\n ' text/csv '\n end\n \n project_net = @project.find_all_connections(friend = true, follower = false) \n \n CSV::Writer.generate(output = \"\") do |csv|\n csv << [\"DL n=\" + @project.persons.count.to_s ]\n csv << [\"format = edgelist1\"]\n csv << [\"labels embedded:\"]\n csv << [\"data:\"]\n project_net.each do |entry|\n csv << [entry[0], entry[1], \"1\"]\n end\n @project.persons.each do |person|\n csv << [person.username]\n end\n end\n send_data(output,\n :type => content_type,\n :filename => @project.name.to_s + \"_FF_SNA.csv\")\n end", "def generate(opts={})\n nd = normalized_data\n ::CSV.generate(opts) do |csv|\n # set header row\n csv << nd[:headers]\n nd[:values].each do |row|\n csv << row\n end\n end\n end", "def stg_provider_report_csv(filename)\n puts 'Creating the Storage Providers report'\n CSV.open(\"#{filename}\", 'ab') do |csv|\n csv << [\"\\n\"]\n csv << %w(Storage_Providers_List)\n csv << %w(Storage_Provider_Name Storage_Provider_Type Storage_Provider_Health Storage_Provider_Total_Cap Storage_Provider_Free_Cap)\n stg_provider_report\n csv_array(@stg_provider_csv_array, csv)\n end\n puts 'Done'\n end", "def build_csv()\n\t\tconcat_path = \"#{@location}/#{@name}.csv\"\n\n\t\tCSV.open(concat_path, 'wb') do |csv_line|\n\t\t\t\t\t\n\t\t\theaders = ['movie_date', 'title', 'lifetime_gross_sales']\n\t\t\tcsv_line << headers\n\n\t\t\[email protected] do |cage|\n\t\t\t\tcsv_line << [cage[:movie_date], cage[:title], cage[:life_time_gross]]\n\t\t\tend\n\t\tend\n\tend", "def export_data\r\n folder = \"\\data\"\r\n FileUtils.mkdir_p folder\r\n CSV.open(File.join(folder, @output_stats_name), 'wb') do |csv|\r\n csv << @global_bests\r\n csv << @average_global_bests\r\n @neighbourhoods_list[0].report_particles.each do |x|\r\n csv << x\r\n end\r\n end\r\n end", "def write_csv_report\n unless @csv.nil?\n @csvexport.write(@csv)\n end\n end", "def out_file\n options.csv_matrix\n end", "def export_csv\n # Find all Setup with the stored restrictions\n sorting :default => @@default_sort\n collection = @@model.find :all, :order => @sort, :conditions => session[:conditions]\n # Creation of the file\n file_name = \"#{@@param_name}_export_\" + current_user.id.to_s + \".csv\"\n \n csv_string = CSV.generate({:col_sep => ';', :encoding => \"ISO-8859-15\" }) do |csv|\n csv << @@name_print.map{|n| n.trn}\n collection.each do |element|\n csv << @@field_print.map{|f| element[f]}\n end\n end\n send_data Iconv.conv('iso-8859-1//IGNORE', 'utf-8', csv_string), :filename => file_name, :disposition => 'attachment', :type => 'text/csv; charset=iso-8859-1; header=present'\n end", "def genCsvSpeed()\n csv = [] ;\n to_a.each{|analyzer|\n csv.push(analyzer.genCsvRowSpeed()) ;\n }\n return csv ;\n end", "def csv_string\n CSV.generate do |csv|\n header.write_header csv\n records.each {|r| r.write_record csv}\n end\n end", "def generateCSV()\n findCommits\n findLinesOfCode\n\n CSV.open(\"data.csv\", \"wb\") {|csv| @students.to_a.each {|elem| csv << elem} }\nend", "def output\n CSV.open(\"test.csv\", \"wb\") do |csv|\n csv << [\"name\",\"type\",\"value\",\"date\"]\n @array_csv.each do |element|\n csv << element\n puts element.inspect\n end\n end\n end", "def print_as_csv\n file_data = []\n file_data << headers\n @case_data_by_date_map.each do |_, elements|\n file_data += elements.shuffle\n end\n\n file_data.each do |element|\n puts element.join(',')\n end\n end", "def write_analyzed(dir)\n FileUtils.mkdir_p(dir)\n\n attributes.each do |a, v|\n path = File.join(dir, a.to_s)\n s = \"Count|Value\\n\" + v.map { |e| \"#{e[:count]}|#{e[:value]}\" }.join(\"\\n\")\n File.open(\"#{path}.csv\", 'w') { |f| f.write(s) }\n end\n end", "def organise_data\n # Single big csv file where we want to aggregate all data\n outfile = File.open('energy-consumption.csv', 'w')\n\n # Columns we want to have in the output file:\n # * category = {commercial, residential}\n # * type = {restaurant, hospital, retail, etc.}\n # * name = name of the building (generally just the city where it is located)\n # * date = date of the year\n # * time = time of the day (hour by hour)\n # * energy = measured energy consuption for that date and hour\n outfile.puts('category,type,name,date,time,energy')\n \n rw_commercial_buildings_data(outfile)\n rw_residential_buildings_data(outfile)\n \n outfile.close\nend", "def generate_records_file(format)\n file = Tempfile.new(\"patients-#{Time.now.to_i}\")\n patients = Record.where(\"test_id\" => self.id)\n \n if format == 'csv'\n Cypress::PatientZipper.flat_file(file, patients)\n else\n Cypress::PatientZipper.zip(file, patients, format.to_sym)\n end\n \n file\n end", "def topic_report\n topic = Topic.find(params[:id])\n @posts = topic.posts.find(:all, :order => \"created_at DESC\")\n report = StringIO.new\n CSV::Writer.generate(report, ',') do |csv|\n csv << %w(body size user date)\n @posts.each do |post|\n csv << [post.body, post.size, post.user.whole_name, post.created_at]\n end\n end\n export_as_csv(report,topic.title) \n end", "def export_csv\n\n group_array = []\n @page = 1\n @per_page = 50\n\n groups = @context.get(:groups, :page => @page, :per_page => @per_page, :access_token => ENV[\"API_TOKEN\"])\n group_array << groups\n group_array, group_hash = check_paging(groups, group_array, \"groups\", @context, true)\n\n group_array.each_with_index do |group, index|\n is_new = index == 0 ? true : false\n membership_array = []\n @page = 1\n\n group_model = Group.find(group['id'], :params => { :access_token => ENV[\"API_TOKEN\"] })\n memberships = group_model.get(:memberships, :page => @page, :per_page => @per_page, :access_token => ENV[\"API_TOKEN\"])\n membership_array << memberships\n membership_array, @membership_hash = check_paging(memberships, membership_array, \"memberships\", group_model, is_new)\n end\n\n export_data = [group_array, @membership_hash]\n perform_export(export_data) \n\n respond_to do |format|\n format.html { render :inline => \"<a href=<%= @download_url %>>Download CSV</a>\" }\n format.json { render :json => @download_url.to_json }\n end\n end", "def to_csv(csv_file_name = 'ponderated_season_' + @season.id.to_s)\n # Check if data already collected and collect if needed\n scan_for_gender_category_and_event if @single_events.count == 0\n\n rows = []\n\n File.open(csv_file_name + '.csv', 'w') do |f|\n titles = ['gender', 'category', 'event', 'pool', 'total_results', 'ponderated best', 'best results']\n rows << titles.join(';')\n\n @single_events.each do |event|\n event_row = ''\n event_row += event.gender_type.code + ';'\n event_row += event.category_type.code + ';'\n event_row += event.event_type.code + ';'\n event_row += event.pool_type.code + ';'\n event_row += event.total_results.to_s + ';'\n event_row += event.get_ponderated_best.to_s + ';'\n event_row += event.best_results.map { |mir| mir.get_timing.to_s }.join(';')\n rows << event_row\n end\n f.puts rows.map { |row| row }\n end\n end", "def to_csv\n csv = @stats.to_csv(row_names_as_first_column: false, superheadings:)\n csv.map.with_index do |row, row_index|\n row.map.with_index do |item, item_index|\n # data rows start after 2 superheadings + 1 heading\n if row_index <= superheadings.size\n header_cell row_index, item\n # item at index+1 is the case count - don't mark 0/0 as Red RAG rating\n # These are the positions of the 3 items which need a RAG rating\n elsif INDEXES_FOR_PERCENTAGE_COLUMNS.include?(item_index) && row[item_index + 1] != 0\n OpenStruct.new value: item, rag_rating: rag_rating(item)\n else\n OpenStruct.new value: item\n end\n end\n end\n end", "def month_by_month_csv\n CSV.generate do |csv|\n report_details.each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n csv.add_row ['VIEWS']\n month_by_month_table(Statistic::VIEW).each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n csv.add_row ['DOWNLOADS']\n month_by_month_table(Statistic::DOWNLOAD).each { |a| csv.add_row(a) }\n end\n end", "def export\n fn = current_user.name + \"'s blood glucose readings.csv\"\n respond_to do |format|\n format.csv { send_data(BgMeasurement.to_csv(current_user), :filename => fn) }\n end\n end", "def generate_test_data()\n CSV.open(\"testdata.csv\", \"w\") do |csv|\n (1..1_000_000).each do |i|\n csv << [rand(100), rand(10_000), rand(100_000)]\n end\n end\nend", "def to_csv\n CSV.generate { |csv| to_a.each { |r| csv << r } }\n end", "def generate_new_report\n log_info('MI Report generation started...')\n content = CSV.generate do |csv|\n csv << headers\n claims.find_each do |claim|\n ManagementInformationPresenter.new(claim, 'view').present! do |claim_journeys|\n claim_journeys.each { |journey| csv << journey } if claim_journeys.any?\n end\n end\n end\n log_info('MI Report generation finished')\n content\n rescue StandardError => e\n log_error(e, 'MI Report generation error')\n end", "def as_csv(*)\n populate_carriers!\n\n CSV.generate do |csv|\n csv << [\n 'key', 'primary_co2_emission',\n *primary_carriers.map { |c| \"primary_demand_of_#{c} (MJ)\" },\n *final_carriers.map { |c| \"final_demand_of_#{c} (MJ)\" }\n ]\n\n @graph.group_nodes(:application_group).each do |node|\n csv << node_row(node)\n end\n end\n end", "def student_usages_per_day\n results = []\n AnalyticsUsage.where(\"user_id is NOT NULL\").each do |usage|\n results << [usage.user.try(:name),(usage.user.edutorid rescue \"\"),(usage.user.center.try(:name) if usage.user.center rescue \"\"),(usage.user.academic_class.try(:name) if usage.user.academic_class rescue \"\"),(usage.user.section.try(:name) rescue \"\"),(usage.today_usage/60 rescue 0),Time.at(usage.usage_date).to_datetime.strftime(\"%d-%b-%Y\")]\n end\n filename = \"Total_usage\"\n csv_data = FasterCSV.generate do |csv|\n csv << \"Name,Edutorid,Center,Class,Section,total-usage-in-minutes,date\".split(\",\")\n results.each do |c|\n csv << c\n end\n end\n #path = Rails.root.to_s+\"/tmp/cache\"\n #file = File.new(path+\"/\"+\"#{Time.now.to_i}\"+\"_usage.csv\", \"w+\")\n #File.open(file,'w') do |f|\n # f.write(csv_data)\n #end\n\n #Usermailer.send_csv(csv)\n #attachment =\n send_data csv_data, :type => 'text/csv; charset=iso-8859-1; header=present', :disposition => \"attachment; filename=#{filename}.csv\"\n end", "def to_csv(seperator=',')\n report = @report || generate_report\n report.map{ |row| row.join(seperator) }.join(\"\\n\")\n end", "def dumpCsvSpeed()\n CSV.open(csvFilenameSpeed(), \"w\", { :col_sep => csvColSepChar() }) { |csv|\n csv << AnalyzerExpA.genCsvTitleRow() ;\n genCsvSpeed().each{|row|\n csv << row ;\n }\n }\n end", "def generate_CSV\n CSV.open(\"./veterans.csv\", \"w\", \n write_headers: true,\n headers: [\"login\", \"name\", \"location\", \"repo count\"]\n ) do |csv|\n @top_ten.each { |row| csv << row }\n end\n end", "def generate_all_csv_answers\n generate_csv_answers(csv_answers_values)\n end", "def write_csv\n\t\tCSV.open(\"csv_exports/edits_per_user_#{@dataset}.csv\", 'w') do |csv|\n\t\t\tcsv << ['user', 'edits']\n\t\t\[email protected] do |user, edits|\n\t\t\t\tcsv << [user,edits]\n\t\t\tend\n\t\tend\n\tend", "def to_csv\n FileOutputService.to_csv(result, file_options)\n end", "def csv_report\n tire_cols = params[:tire] || {}\n ar_cols = params[:activerecord] || {}\n assocs_to_include = params[:assoc][:include] || {}\n params[:assoc][:max] ||= {}\n klass = model_class.constantize\n @filename = \"#{model_class.humanize}.csv\"\n\n response.headers['Content-Type'] ||= 'text/plain'\n response.headers['Content-Disposition'] = \"attachment; filename=#{@filename}\"\n response.headers['Content-Transfer-Encoding'] = 'binary'\n response.headers['Last-Modified'] = Time.now.to_s\n\n # Right, try to define a header:\n header = []\n tire_cols.keys.each { |x| header.push(x.humanize) }\n ar_cols.keys.each { |x| header.push(x.humanize) }\n assocs_to_include.keys.each do |assoc|\n if params[:assoc][:max][assoc] == 'join' # Is a has_many with only one real column\n header.push params[:assoc][assoc.to_sym].keys.first\n elsif params[:assoc][:max][assoc] # has_many\n (1 .. (params[:assoc][:max][assoc].to_i)).each do |i|\n params[:assoc][assoc.to_sym].keys.each do |k|\n header.push(\"#{assoc.singularize.humanize} #{i} #{k.humanize}\")\n end\n end\n else # has_a\n params[:assoc][assoc.to_sym].keys.each do |k| # Each key requested from the associated record\n header.push \"#{assoc.humanize} #{k.humanize}\"\n end\n end\n end\n\n results = klass.search({ per: TireSearch::INFINITY }, 1, '')\n self.response_body = Enumerator.new do |y|\n results.each_with_index do |result, i|\n y << header.to_csv if i == 0\n\n line = []\n tire_cols.keys.each { |x| line.push(result[x]) }\n\n result = result.load if ar_cols.count > 0 || assocs_to_include.keys.count > 0\n\n ar_cols.keys.each { |x| line.push(result.send(x)) } if ar_cols.count > 0\n\n assocs_to_include.keys.each do |assoc|\n related = result.send(assoc)\n if params[:assoc][:max][assoc] == 'join' # Is a has_many with only one real column\n col = params[:assoc][assoc.to_sym].keys.first\n line.push related.map { |x| x.send(col) }.join(' // ')\n elsif params[:assoc][:max][assoc]\n (0 .. (params[:assoc][:max][assoc].to_i - 1)).each do |j|\n params[:assoc][assoc.to_sym].keys.each do |k|\n line.push(related[j] ? related[j].send(k) : nil)\n end\n end\n else\n params[:assoc][assoc.to_sym].keys.each do |k| # Each key requested from the associated record\n line.push related ? related.send(k) : nil\n end\n end\n end\n y << line.to_csv\n GC.start if i % 500 == 0\n end\n end\n end", "def format_output_with_CSV()\r\n\t\theadings = [] << \"Run\"\r\n\t\trows = []\r\n\t\t@actual_parameters.each {|t| headings << t[0]}\r\n\t\[email protected]_with_index do |run,i|\r\n\t\t\ttemp = [\"#{i+1}\"];\r\n\t\t\trun.each_with_index do |r,i|\r\n\t\t\t\ttemp << @actual_parameters[i][Integer(run[i][1])]\r\n\t\t\tend\r\n\t\t\trows << temp\r\n\t\tend\r\n\t\t@output_table = Terminal::Table.new :title => \"IPO Algorithm tests output\", :headings => headings, :rows => rows\r\n\tend", "def index\n @goldmeasures = Goldmeasure.all\n\n respond_to do |format|\n format.html \n format.json\n format.csv { send_data @goldmeasures.to_csv }\n\n end\n end", "def summarize_results!(all_results)\n \t summaries = {}\n \t all_results.each do |paramset, results|\n \t File.open(@dir + \"/results-#{param_string(paramset)}.yaml\", 'w' ) do |out|\n \t\t\tYAML.dump(results, out)\n \t\tend\n \t\tsummaries[paramset] = {}\n \t\t# create an array of arrays\n \t\tres = results.keys.map do |key| \n \t\t # calculate stats\n \t\t a = results[key]\n \t\t if a.all? {|el| el.is_a? Numeric }\n \t\t summaries[paramset][\"#{key} mean\"] = Stats::mean(a)\n \t\t summaries[paramset][\"#{key} SD\"] = Stats::standard_deviation(a)\n \t\t [key] + a + [Stats::mean(a), Stats::standard_deviation(a)]\n \t\t else\n \t\t [key] + a + [\"--\", \"--\"]\n \t end\n \t\t end\n\t\t \n \t\t ls = results.keys.map{|v| [7, v.to_s.length].max }\n \t\t\n \t\tls = [\"Std Deviation\".length] + ls\n \t\tres = header_column + res\n \t\tres = res.transpose\n \t\tout = build_table res, ls\n \t\tFile.open(@dir + \"/#{paramset}-summary.mmd\", 'w') do |f|\n \t\t f << \"## Results for #{@experiment} with parametres #{param_string(paramset, \", \")} ##\\n\\n\"\n \t\t f << out\n \t\t end\n\t\t end\n\t\t \n\t\t # Build CSV file with all of the results\n\t\t #puts summaries.inspect\n\t\t \n\t\t summaries = summaries.to_a\n #puts summaries.inspect\n\t\t keys1 = summaries.first.first.keys\n\t\t keys2 = summaries.first.last.keys\n\t\t #puts keys1.inspect, keys2.inspect, \"=====\"\n CSV.open(@dir + \"/results.csv\", \"w\") do |csv|\n \t csv << keys1 + keys2\n \t summaries.each do |summary|\n \t #puts summary.first.inspect\n \t #puts summary.first.values_at(*keys1).inspect + summary.last.values_at(*keys2).inspect\n \t csv << summary.first.values_at(*keys1) + summary.last.values_at(*keys2)\n \t \n \t end\n \t end\n\t\t \n\t end", "def output_to_csv\n if (@values[:result] != nil)\n @additions << calculate_worktime\n filename = get_entry(\"Specify output file: \")\n p = Menu.data_handler.find_person_by_id(@values[:id])\n CSVWriter.output(filename, p, @values[:result], @additions)\n else\n puts \"Nothing to write right now.\"\n end\n end", "def writeCSV(file_name)\n generated_array = transaction(file_name)\n array_from_csv = read_file(file_name)\n final_hash = merge_arrays(array_from_csv, generated_array)\n binding.pry\n\n CSV.open(\"results.csv\", \"w\") do |row|\n final_hash.each do |nested_hash|\n row << [nested_hash[\"SKU\"], nested_hash[\"quantity\"]]\n end #end each nested_hash loop\n end #end csv loop\nend", "def create_csv\n CSV.open('./data/slcsp.csv', 'wb') do |csv|\n csv << ['zipcode', 'rate']\n end\n build_csv\n end", "def write_csv(type, final_arr)\n csv_data = CSV.generate do |csv|\n val = []\n final_arr[0][0].each do |title|\n val << title\n end\n csv << val\n final_arr[1].each do |elem|\n elem.each do |doc|\n data = []\n json_doc = JSON.generate(doc)\n json_doc = JSON.parse(json_doc)\n final_arr[0][0].each do |key|\n key_array = key.split('.')\n data << get_nested_val(key_array,json_doc)\n end\n csv << data\n end\n end\n end\n File.write(\"#{type}_details.csv\",csv_data)\n end", "def to_csv\n [@name, @description, @prep_time, @done]\n end", "def csv(meth)\n @output_type = 'csv'\n @output_filename = \"#{model.link.downcase}_#{normalized_type}.csv\"\n columns = model.columns_for(type, request)\n headers = columns.map{|column| column_label_for(type, request, model, column)}\n EnumCSV.csv(model.send(meth, normalized_type, request, :all_results=>true), :headers=>headers) do |obj|\n columns.map{|column| model.column_value(type, request, obj, column)}\n end\n end", "def to_csv\n self.data.to_csv\n end", "def export_summary(user_data)\n header = []\n row = []\n\n # chose to remove the 'total' key in the hash, figured end user will want to use own calculation on the CSV file when downloaded\n user_data[\"points\"].delete(\"total\")\n\n # put the hash keys into an array to form the header line\n user_data[\"points\"].each_key do |key|\n header << key\n end\n\n # put the values in an array to form the first line\n user_data[\"points\"].each_value do |value|\n row << value\n end\n\n # create the CSV file\n CSV.open(\"summary_#{user_data[\"name\"].downcase.split.join(\"_\")}.csv\", \"wb\") do |csv|\n\n # add the arrays into the file to create the header and first row\n csv << header\n csv << row\n end\n\n # unless something went wrong, show that the data exported correctly\n if File.exist?(\"summary_#{user_data[\"name\"].downcase.split.join(\"_\")}.csv\")\n puts \"\\nFile successfully save!\"\n else\n puts \"\\nThe files did not save, try again.\"\n end\nend", "def create_csv\n title = [\"Typed Word\",\"Suggestion\", \"Score\", \"Frequency\", \"ED?\", \"Count ED\", \"Year\"]\n CSV.open('output.csv', 'a') do |csv|\n csv << title\n end\n end", "def to_csv\n attributes = %w{id email name course_ids major_title created_at}\n \n CSV.generate(headers: true) do |csv|\n csv << attributes\n csv << attributes.map{ |attr| self.send(attr) }\n end\n end", "def to_csv(function_list, tests)\n function_list.map { |function_name|\n v = tests[\"#{function_name} function\"]\n if v\n positive_tests = count_tests_in(v['groups']['success'])\n negative_tests = count_tests_in(v['groups']['failure'])\n pending_tests =\n count_pending_tests_in(v['groups']['failure']) +\n count_pending_tests_in(v['groups']['failure'])\n else\n positive_tests = 0\n negative_tests = 0\n pending_tests = 0\n end\n '%-25s, %-9d, %-9d, %-9d' % [function_name, positive_tests, negative_tests, pending_tests]\n }.compact\nend", "def write_to_file(course)\n className = \"#{course[\"subject\"]} #{course[\"catalogNbr\"]}\"\n title = course[\"titleLong\"]\n credits = course[\"enrollGroups\"][0][\"unitsMaximum\"]\n CSV.open(\"results.csv\", \"a\") do |csv|\n csv << [className, title, credits]\n end\nend", "def csv_export_chrono\n csv_string = CSV.generate do |csv|\n\n csv << [ \"Plaque\", \"Equipe\", \"Nom VTT\", \"Prenom VTT\", \"ADN VTT\", \"Nom Route\", \"Prenom Route\", \"ADN Route\", \"Categorie\"]\n\n Team.order_by(:plate).each do |t|\n cat = t.category\n next unless cat\n\n cname = cat.map { |v| v.capitalize }.join('-')\n csv << [ t.plate, t.name, \n t.vtt.profile.name.upcase, t.vtt.profile.surname.capitalize, t.vtt.profile.birth.year, \n t.route.profile.name.upcase, t.route.profile.surname.capitalize, t.route.profile.birth.year, cname]\n end\n end\n\n respond!(csv_string, 200, 'Content-Type' => 'text/csv')\n end", "def write_csv filename\n CSV.open(filename, \"w\") do |csv|\n @listOfItem.each_with_index { |item, index| \n if (index == 0)\n csv << [\"Quantity\", \"Name\", \"Total\"]\n end\n # check the product is valid\n if (item.product != nil)\n csv << [item.quantity, item.product.name, item.total]\n else\n csv << [\"nil\", \"nil\", \"nil\"]\n end\n if (index == @listOfItem.size - 1)\n csv << [\"Sales taxs:\", sales_tax]\n csv << [\"Total:\", total]\n end\n }\n end\n end", "def lifetime_csv\n CSV.generate do |csv|\n report_details(period_covered: 'Lifetime').each { |a| csv.add_row(a) }\n csv.add_row [] # Blank row\n lifetime_table.each { |a| csv.add_row(a) }\n end\n end", "def output_csv\n if @report.is_a?(Reports::Bundle)\n @report.to_csv_usr_file\n else\n path = ask_path('.csv')\n path ? @report.to_csv_file(path) : 'Annulé'\n end\n end", "def generateCSV(issuesData, milestoneData)\n\n\t\t# csv_string = CSV.generate do |csv|\n\t\t# csv << data.first.keys\n\t\t# data.each do |hash|\n\t\t# \tcsv << hash.values\n\t\t# end\n\t\t# end\n\n\t\tAxlsx::Package.new do |p|\n\t\t p.workbook.add_worksheet(:name => \"Issues\") do |sheet|\n\t\t\tsheet.add_row issuesData.first.keys\n\t\t \n\t\t issuesData.each do |hash|\n\t\t\t\tsheet.add_row hash.values\n\t\t \tend\n\n\t\t end\n\t\t p.workbook.add_worksheet(:name => \"Milestones\") do |sheet|\n\t\t\tsheet.add_row milestoneData.first.keys\n\n\t\t milestoneData.each do |hash|\n\t\t\t\tsheet.add_row hash.values\n\t\t \tend\n\n\t\t end\n\n\t\t return p.to_stream\n\t\tend\n\n\n\n\n\tend", "def exported_report\n #The folder where the filename points to, is actually in the ~/rails/Forester because of capistrano as\n # the Apache point to ~/rails/Forester/current symlinkfolder and capistrano updates the them. \n @filename = \"quarterly_report_#{params[:year]}_#{params[:quarter]}.csv\"\n @file_path = \"#{Rails.root}/../../shared/system/exports/\"\n if params[:quarter] == \"1\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{(params[:year].to_i-1)}-12-31' AND delivery_date<'#{params[:year]}-04-01'\")\n else\n if params[:quarter] == \"2\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-03-31' AND delivery_date<'#{params[:year]}-07-01'\")\n else\n if params[:quarter] == \"3\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-06-30' AND delivery_date<'#{params[:year]}-10-01'\")\n else\n if params[:quarter] == \"4\" then\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-09-30' AND delivery_date<'#{(params[:year].to_i+1)}-01-01'\")\n end\n end\n end\n end\n \n #Writing to file starts with empty line.\n File.open(\"#{@file_path}#{@filename}\", 'w') do |writer|\n writer.puts(\"\\n\")\n end\n \n #From the tickets delivered in the given quarter, the job ids are gathered here\n @job_ids = @tickets.collect {|i| i.job_id }\n @jobs = Job.find(@job_ids)\n \n #To have less DB calls, all specie records are put into an instance variable\n @species = Specie.all\n \n #Goes through all the jobs, for each sums up all the mbf and tonnages and writes them into the file\n # per specie.\n @jobs.each do |k|\n @my_tickets = []\n @tickets.each do |l|\n if l.job_id == k.id\n @my_tickets.push(l)\n end\n end\n \n @amounts = []\n \n @species.length.times do\n @amounts.push([0, 0])\n end\n \n @total_pulp = 0\n \n @my_tickets.each do |i|\n i.load_details.each do |j|\n if i.wood_type == 3 || j.species_id == 0 #wood type 3 & species_id 0 == pulp\n @total_pulp = @total_pulp + j.tonnage\n next #If load is pulp, it has only one load detail so program jups to next loop\n end\n #Amounts of mbf/tonnage are summed up here per ticket according to their specie.\n @amounts[j.species_id-1][0] = @amounts[j.species_id-1][0] + j.mbfss #This and triple-n tonnage in next are helper methods. See their documentation.\n @amounts[j.species_id-1][1] = @amounts[j.species_id-1][1] + j.tonnnage\n end\n end\n \n #Finally, the values calculated above are written into the file.\n File.open(\"#{@file_path}#{@filename}\", 'a') do |writer|\n writer.puts \"Job, #{k.name}\"\n writer.puts \"Category, MBF, Tonnage\"\n @species.each do |i|\n writer.puts \"#{i.code}, #{round_to(@amounts[i.id-1][0].to_f, 2)}, #{round_to(@amounts[i.id-1][1].to_f, 2)}\"\n end\n writer.puts \"Pulp, ,#{round_to(@total_pulp.to_f, 2)}\"\n writer.puts(\"\\n\")\n end\n end\n \n #The file created is opened in 'r' (== read) mode and send to user\n @file = File.open(\"#{@file_path}#{@filename}\", 'r')\n \n send_data(@file.read, :type => \"csv\", :filename => @filename)\n end", "def to_bmet_csv\n case @cmd_switch\n when 'add_forgroups'\n to_bmet_csv_add_forgroups\n when 'replace_type'\n to_bmet_csv_replace_type\n else\n STDERR.puts \"Invalid command line switch: #{@cmd_switch}\"\n exit 1\n end\n end", "def build_scale_csv_summary(parent_dir)\n puts \"building scale test csv summary report for parent dir: #{parent_dir}\"\n puts\n\n parent_name = File.basename(parent_dir)\n report_name = \"scale_test_summary\"\n output_path = \"#{parent_dir}/#{report_name}.html\"\n\n # create a summary csv file to contain the last successful iteration from each result\n @summary_csv_path_success = \"#{parent_dir}/#{report_name}.success.csv\"\n create_summary_csv(@summary_csv_path_success)\n\n # create a summary csv file to contain the failing iteration from each result\n @summary_csv_path_fail = \"#{parent_dir}/#{report_name}.fail.csv\"\n create_summary_csv(@summary_csv_path_fail)\n\n # start with the template\n report = File.read(@template_path)\n\n # process each result dir\n process_result_dirs(parent_dir)\n\n # calculate variance for success\n calculate_summary_csv(@summary_csv_path_success)\n\n # calculate variance for failure\n calculate_summary_csv(@summary_csv_path_fail)\n\n # csv2html\n csv2html(@summary_csv_path_success)\n csv2html(@summary_csv_path_fail)\n\n # result name\n report = report.gsub(\"$RESULT_NAME\", parent_name)\n\n # add summary success table\n summary_success_table = extract_table_from_csv2html_output(\"#{@summary_csv_path_success}.html\")\n report = report.gsub(\"$RESULT_SUMMARY_SUCCESS_TABLE\", summary_success_table)\n\n # add summary fail table\n summary_fail_table = extract_table_from_csv2html_output(\"#{@summary_csv_path_fail}.html\")\n report = report.gsub(\"$RESULT_SUMMARY_FAIL_TABLE\", summary_fail_table)\n\n # add extract tables\n report = report.gsub(\"$RESULT_EXTRACT_TABLES\", @tables)\n\n # write report\n puts \"writing report to #{output_path}\"\n puts\n\n File.write(output_path, report)\nend", "def csvFilenameSummary()\n return pathBaseSummary() + \".csv\" ;\n end", "def generate\n @student_users = StudentUser.all\n respond_to do |format|\n format.html\n format.csv { send_data @student_users.to_csv }\n format.xls { send_data @student_users.to_csv(col_sep: \"\\t\") }\n end\n end", "def generate_csv_file(csv_string,assessment_name)\n variable_time = Time.now.strftime(\"%Y%m%d\")\n #The file name is generated based on time.\n filename = assessment_name+variable_time+\".csv\"\n #invoke send_data of fastercsv gem to generate a csv\n send_data(csv_string, :type => \"text/plain\", :filename => filename)\n end", "def save_as_csv\n CSV.open(\"./db/#{@name}.csv\", \"wb\") {|csv| @result_scrap.to_a.each {|elem| csv << elem} }\n end", "def export\n @transactions = Transaction.find_all_by_user_id(current_user.id)\n csv = \"\"\n i = 0\n @transactions.each do |trans|\n if (i==0)\n csv += trans.to_csv(true)\n else\n csv += trans.to_csv(false)\n end\n i += 1\n end\n\n respond_to do |format|\n format.csv { send_data csv }\n end\n end", "def write_to_csv(opts = {})\n filename = opts.fetch(:filename) { 'twords_report.csv' }\n write_file(filename, :to_csv, opts)\n end", "def to_csv\r\n name\r\n end", "def to_csv\n self.all.to_promise.then do |all|\n io = StringIO.new\n io << (attrs.join(',') + \"\\n\")\n all.each do |model|\n line = model.to_csv(attrs: attrs, tab_sub: CSV_TAB_SUB, cr_sub: CSV_CR_SUB, nl_sub: CSV_NL_SUB, comma_sub: CSV_COMMA_SUB) # send(attr).to_s.gsub(',', COMMA_SUB)\n io << (line + \"\\n\")\n end\n io.string.to_promise\n end\n end", "def export_to_csv\n puts 'Please enter a csv file name:'\n\n filename = get_filename\n filename = add_csv_suffix_if_needed filename\n \n write_to_csv_file filename\n \n end", "def download_csv\n case current_user.role.name\n when 'Edutor Admin'\n usages = Usage\n when 'Institute Admin'\n usages = current_user.usages\n when 'Center Representative'\n usages = current_user.usages\n when 'Teacher'\n class_contents = current_user.class_contents\n section_students = current_user.sections.map{|section| section.students.select('id')}.flatten\n student_group_students = current_user.sections.map{|section| section.student_groups.select('id')}.flatten\n total_students = (section_students + student_group_students).uniq\n usages_ids = class_contents.map(&:uri).map{|uri|\n Usage.where('uri like ?',\"%#{uri}%\").where(:user_id=>total_students).map(&:id)\n }\n usages = Usage.where(:id=>usages_ids)\n end\n filename =\"usages_#{Date.today.strftime('%d%b%y')}\"\n csv_data = FasterCSV.generate do |csv|\n csv << Usage.csv_header\n usages.each do |c|\n csv << c.to_csv\n end\n end\n send_data csv_data, :type => 'text/csv; charset=iso-8859-1; header=present', :disposition => \"attachment; filename=#{filename}.csv\"\n end" ]
[ "0.72291785", "0.6831418", "0.67760617", "0.67500573", "0.6663427", "0.6526661", "0.65180373", "0.65158856", "0.64576584", "0.6456997", "0.63644844", "0.6331803", "0.63055557", "0.6278788", "0.6270818", "0.6241609", "0.6241609", "0.62223476", "0.6218263", "0.62179446", "0.6183405", "0.61657834", "0.6157871", "0.6141757", "0.61379147", "0.61201334", "0.6104021", "0.6088303", "0.6082437", "0.6077819", "0.6075345", "0.6069255", "0.6052067", "0.60390353", "0.6037857", "0.60356855", "0.60249513", "0.60224867", "0.60187185", "0.60067075", "0.5986311", "0.59817797", "0.5967865", "0.5961617", "0.5952815", "0.5951013", "0.59497136", "0.5935507", "0.5928801", "0.59187967", "0.5909296", "0.5892217", "0.5890702", "0.5877915", "0.5874045", "0.58708596", "0.5868993", "0.5852185", "0.58504224", "0.58489233", "0.5836075", "0.58316", "0.58261436", "0.58242273", "0.5820578", "0.58192194", "0.58182937", "0.5810738", "0.58102167", "0.58069026", "0.58042896", "0.57971734", "0.5788445", "0.57878774", "0.5786403", "0.57794255", "0.57764155", "0.5772434", "0.5749894", "0.5748275", "0.5732217", "0.57280934", "0.5710273", "0.5707271", "0.56994355", "0.56963664", "0.5695783", "0.5680937", "0.5679985", "0.567726", "0.5668531", "0.5666073", "0.56646246", "0.56492156", "0.5647923", "0.5637029", "0.5635737", "0.5632171", "0.56096137", "0.5600325", "0.5599244" ]
0.0
-1
eds doc: to backup rds instance
def backup(options = {}) my_aws = { region: ENV['AWS_REGION'], access_method: 'api_key', access_key: ENV['AWS_API_KEY'], secret_key: ENV['AWS_SECRET_KEY'] } conn = ::Skejuler::Aws::Connector.new(my_aws) rds = conn.rds # Aws RDS Client library rds.describe_db_instances instance_id = options.fetch(:instance_id) puts instance_id # do something on it end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def system_backup\n\n\n end", "def backup \n begin\n check_if_db_exists\n is_allowed = @conn.exec(\"select datallowconn from pg_catalog.pg_database where datname='#{@options[:database]}'\")[0]['datallowconn']\n if is_allowed == 'f'\n # unquiece temporarily\n set_dataallowcon_to true\n end\n\n # Check to see if the directory for backups exists and if not, create it with parents\n unless File.exist?(@options[:bkdir])\n FileUtils.mkdir_p @options[:bkdir]\n end\n filename = \"postgresbk_#{@options[:database]}_#{Time.new.strftime(\"%m%d%y%H%M%S\")}.dump\"\n\n # The below system call assumes you have passwordless access as the user passed into the executable tool\n # either due to ~/.pgpass or pg_hba.conf has your user as a 'trust' auth method\n `pg_dump -U #{@options[:user]} #{@options[:database]} -F c -f #{@options[:bkdir]}/#{filename}`\n\n rescue Exception => e\n raise e\n ensure\n if is_allowed == 'f'\n # re quiesce \n set_dataallowcon_to false\n end\n end\n end", "def backup\n #EternosBackup::BackupJobPublisher.add_source(self)\n end", "def execute_backup_stripe(options={})\n @disk.sync\n\n# Ensure filesystem is frozen and uses retry\n raise \"FATAL: unable to freeze lvm filesystem!\" unless @disk.freeze\n\n create_opts = {\n :lineage => options[:lineage],\n :prefix_override => options[:lineage], #Make sure we use the volume_nickname \"lineage\" as the prefix for our snaps (even if the volume has a different, perhaps more descriptive name)\n :description => \"Snapshot created by RightScale DB tools on instance #{ENV['EC2_INSTANCE_ID']}.\",\n :max_snaps => options[:max_snapshots],\n :keep_dailies => options[:keep_dailies],\n :keep_weeklies => options[:keep_weeklies],\n :keep_monthlies => options[:keep_monthlies],\n :keep_yearlies => options[:keep_yearlies],\n :devices => options[:devices].join(\",\")\n }\n create_opts[:suffix] = options[:suffix] if options[:suffix]\n\n # TODO: retry on the http requests? sounds like a good idea to me\n result = self.create_ebs_backup(create_opts)\n raise \"FATAL: unable to create snapshots!\" if result.nil?\n aws_ids = result['aws_ids']\n raise \"FATAL: result not recognized #{result}\" unless aws_ids.is_a?(Array)\n\n# Ensure filesystem is unfrozen and uses retry\n raise \"FATAL: could not unfreeze filesystem!\" unless @disk.unfreeze\n\n aws_ids.each do |snap|\n # TODO: does this http call need to be retried also? \n self.update_snapshot(snap, \"committed\")\n end\n\n # e) - Perform snapshot cleanup\n lst = self.cleanup_snapshots_stripe(options[:cleanup_prefix],{:keep_last => options[:max_snapshots], :dailies => options[:keep_dailies], :weeklies => options[:keep_weeklies], :monthlies => options[:keep_monthlies], :yearlies => options[:keep_yearlies]})\n puts \"Cleanup resulted in deleting #{lst.length} snapshots : #{lst.inspect}\"\n \n end", "def create_ebs_backup(options = {})\n params = options.merge( { :commit => \"explicit\", :api_version => 1.0 } )\n STDERR.puts \"Performing RightScale API call to create a new snapshot\"\n json=nil\n SystemTimer.timeout_after(@api_snap_timeout) do\n body = RestClient.post @api_url+\"/create_ebs_backup.js\", params\n json = body.nil? ? nil: JSON.load(body)\n STDERR.puts \"CREATED_SNAPS: #{json}\"\n end\n json \n rescue Exception => e\n display_exception(e, \"create_ebs_backup(#{options.inspect})\")\n end", "def restore_db\n\n begin\n self.rds.restore_db_instance_from_db_snapshot(new_snap.id,\n backup_server_id,\n {\"DBSubnetGroupName\" => @opts['db_subnet_group_name'],\n \"DBInstanceClass\" => @opts['db_instance_type'] } )\n rescue Exception => e\n raise MyRDSException.new(\"Error in #{self.class}:restore_db: #{e.class}: #{e}\")\n end\n\n end", "def backup\n\t\tunless (@options && @options[:path] && @options[:dataset])\n\t\t\traise OptionParser::InvalidArgument, \"Missing arguments for 'backup'.\"\n\t\tend\n\t\t# Only attempt backup if the service is running\n\t\tstate = false\n\t\tself.launch(\"/usr/sbin/serveradmin status postgres\") do |output|\n\t\t\tstate = ((/RUNNING/ =~ output) != nil)\n\t\tend\n\t\torig_state = state\n\t\t$log.debug(\"@options = #{@options.inspect}\")\n\t\tarchive_dir = @options[:path]\n\t\tunless (archive_dir[0] == ?/)\n\t\t\traise OptionParser::InvalidArgument, \"Paths must be absolute.\"\n\t\tend\n\t\twhat = @options[:dataset]\n\t\tunless self.class::DATASETS.include?(what)\n\t\t\traise OptionParser::InvalidArgument, \"Unknown data set '#{@options[:dataset]}' specified.\"\n\t\tend\n\t\t# The passed :archive_dir and :what are ignored because the dump is put\n\t\t# on the live data volume\n\t\tarchive_dir = self.backupDir\n\t\tdump_file = \"#{archive_dir}/#{BACKUP_FILE}\"\n\t\tdump_file_uncompressed = \"#{archive_dir}/#{BACKUP_FILE_UNCOMPRESSED}\"\n\t\t# Create the backup directory as necessary.\n\t\tunless File.directory?(archive_dir)\n\t\t\tif File.exists?(archive_dir)\n\t\t\t\t$log.info \"Moving aside #{archive_dir}...\\n\"\n\t\t\t\tFileUtils.mv(archive_dir, archive_dir + \".applesaved\")\n\t\t\tend\n\t\t\t$log.info \"Creating backup directory: #{archive_dir}...\\n\"\n\t\t\tFileUtils.mkdir_p(archive_dir, :mode => 0700)\n\t\t\t# _postgres:_postgres has uid:gid of 216:216\n\t\t\tFile.chown(216, 216, archive_dir)\n\t\tend\n\t\t# Backup only once a day\n\t\tmod_time = File.exists?(dump_file) ? File.mtime(dump_file) : Time.at(0)\n\t\tif (Time.now - mod_time) >= (24 * 60 * 60)\n\t\t\t# Attempt to start the service if needed\n\t\t\tif (! state)\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin start postgres\") do |output|\n\t\t\t\t\tstate = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\tend\n\t\t\tif (! state)\n\t\t\t\t$log.info \"PostgreSQL is not running, skipping database backup\"\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\t$log.info \"Creating dump file \\'#{dump_file}\\'...\"\n\t\t\tsystem(\"/usr/bin/sudo -u _postgres /usr/bin/pg_dumpall > #{dump_file_uncompressed.shellescape}\")\n\t\t\tif ($?.exitstatus != 0)\n\t\t\t\t$log.error \"...Backup failed on pg_dumpall, Status=#{$?.exitstatus}\"\n\t\t\telse\n\t\t\t\tsystem(\"/usr/bin/gzip #{dump_file_uncompressed.shellescape}\")\t\t\t\t\n\t\t\t\tif ($?.exitstatus == 0)\n\t\t\t\t\tFile.chmod(0640, dump_file)\n\t\t\t\t\tFile.chown(216, 216, dump_file)\n\t\t\t\t\t$log.info \"...Backup succeeded.\"\n\t\t\t\telse\n\t\t\t\t\t$log.error \"...Backup failed on gzip! Status=#{$?.exitstatus}\"\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# Restore original service state\n\t\t\tif (! orig_state)\n\t\t\t\t# What if a dependent service was launched while we were backing up? We\n\t\t\t\t# don't want to shut down postgres in that case.\n\t\t\t\twiki_state = false\n\t\t\t\tcalendar_state = false\n\t\t\t\taddressbook_state = false\n\t\t\t\tdevicemgr_state = false\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status wiki\") do |output|\n\t\t\t\t\twiki_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status calendar\") do |output|\n\t\t\t\t\tcalendar_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status addressbook\") do |output|\n\t\t\t\t\taddressbook_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tself.launch(\"/usr/sbin/serveradmin status devicemgr\") do |output|\n\t\t\t\t\tdevicemgr_state = ((/RUNNING/ =~ output) != nil)\n\t\t\t\tend\n\t\t\t\tif (! (wiki_state || calendar_state || addressbook_state || devicemgr_state))\n\t\t\t\t\tself.launch(\"/usr/sbin/serveradmin stop postgres\")\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\t$log.info \"Dump file is less than 24 hours old; skipping.\"\n\t\tend\n\tend", "def backup\n ModelHelper::backup self\n end", "def create_backup_with_data\n @test_backup = @instance.backup @backup_id\n\n return @test_backup if @test_backup\n\n database = create_singers_albums_database\n\n capture do\n write_using_dml project_id: @project_id,\n instance_id: @instance.instance_id,\n database_id: database.database_id\n end\n\n client = @spanner.client @instance.instance_id, database.database_id\n version_time = client.execute(\"SELECT CURRENT_TIMESTAMP() as timestamp\").rows.first[:timestamp]\n\n capture do\n create_backup project_id: @project_id,\n instance_id: @instance.instance_id,\n database_id: database.database_id,\n backup_id: @backup_id,\n version_time: version_time\n\n @test_backup = @instance.backup @backup_id\n end\n\n @test_backup\n end", "def create_and_copy_backup(backup_options = nil,backup_name = nil)\n\n end", "def backup_database\n #todo handle db prefix\n #todo proper error handling\n\n dbuser = @attributes[:dbuser]\n dbhost = @attributes[:dbhost]\n dbpass = @attributes[:dbpass]\n dbname = @attributes[:dbname]\n\n # see https://docs.moodle.org/20/en/Site_backup\n\n cmd = %Q{mysqldump -u #{dbuser} -h'#{dbhost}' -p'#{dbpass}' -C -Q -e --create-options '#{dbname}' | gzip -9 > '#{mk_backup_filename('database')}'}\n system cmd\n\n nil\n end", "def backuphosts(session,hosts)\n\trandom = sprintf(\"%.5d\",rand(100000))\n\tprint_status(\"Making Backup of the hosts file.\")\n\tsession.sys.process.execute(\"cmd /c copy #{hosts} #{hosts}#{random}.back\",nil, {'Hidden' => true})\n\tprint_status(\"Backup loacated in #{hosts}#{random}.back\")\nend", "def before_backup\n end", "def dump(backup_file_name)\n @mysqlcmds ||= ::Rds::S3::Backup::MySqlCmds.new(backup_server.endpoint['Address'],\n @opts['mysql_username'],\n @opts['mysql_password'],\n @opts['mysql_database'])\n\n\n\n\n @mysqlcmds.dump(backup_file_path(backup_file_name)) # returns the dump file path\n end", "def backup(id)\n server = @connection.servers.get(id)\n ssh(server,'~/backup.sh')\n server.scp_download('backup/current.tar.gz','backup.tar.gz')\n end", "def backup\n self.keep_backup && !File.exists?( backup_path ) && FileUtils.cp( self.resource.path, backup_path )\n end", "def create_snapshot(rds_resource, db_instance_name)\n id = \"snapshot-#{rand(10**6)}\"\n db_instance = rds_resource.db_instance(db_instance_name)\n db_instance.create_snapshot({\n db_snapshot_identifier: id\n })\nrescue Aws::Errors::ServiceError => e\n puts \"Couldn't create DB instance snapshot #{id}:\\n #{e.message}\"\nend", "def backupwallet(destination)\n coind.backupwallet destination\n end", "def cmd_backup argv\n setup argv\n command = @hash['command']\n name = @hash['name']\n response = @api.backup(command, name)\n msg response\n return response\n end", "def backupwallet(destination)\n request(:backupwallet, destination)\n end", "def backup2Drive(src,conf)\n dest = conf[:backupDrive]\n dest = dest + \"/\" unless dest [-1] =~ /[\\/\\\\]/\n dest = dest + src\n puts src\n puts dest\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest)\n puts aktTime()+\" archive copied\"\n cleanUp(conf) if conf[:generations]\n \nend", "def backup(job)\n path = @filesystem.get_tmp_path\n s3 = @storage.parse_location(job['location'])\n db = @db.get_opts(job['db'])\n \n Mongolicious.logger.info(\"Starting job for #{db[:host]}:#{db[:port]}/#{db[:db]}\")\n\n @db.dump(db, path)\n @filesystem.compress(path) \n \n key = \"#{s3[:prefix]}_#{Time.now.strftime('%m%d%Y_%H%M%S')}.tar.bz2\"\n @storage.upload(s3[:bucket], key, path)\n \n @filesystem.cleanup(path)\n @storage.cleanup(s3[:bucket], s3[:prefix], job['versions'])\n \n Mongolicious.logger.info(\"Finishing job for #{db[:host]}:#{db[:port]}/#{db[:db]}\") \n end", "def create_backup instance_id:, cluster_id:, backup_id:, source_table_id:, expire_time:\n backup = Google::Cloud::Bigtable::Admin::V2::Backup.new \\\n source_table: table_path(instance_id, source_table_id), expire_time: expire_time\n tables.create_backup parent: cluster_path(instance_id, cluster_id), backup_id: backup_id, backup: backup\n end", "def backup_wallet\n client.make_request('/backup-wallet', 'post', params: {})\n end", "def create_backup(d_b_instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateBackup'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backup_method\n\t\t\targs[:query]['BackupMethod'] = optional[:backup_method]\n\t\tend\n\t\tif optional.key? :backup_type\n\t\t\targs[:query]['BackupType'] = optional[:backup_type]\n\t\tend\n\t\tif optional.key? :d_b_name\n\t\t\targs[:query]['DBName'] = optional[:d_b_name]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend", "def createBackup\n fetch(\"#{@backupUrl}\", 3000)\n $LOG.info(\"#{@name} : Backupfile created\") \n sleep 120\n end", "def backup\n run_command 'pgbackups:capture', %W(--expire #{database})\n end", "def backupwallet(destination)\n @api.request 'backupwallet', destination\n end", "def backup backup_id\n ensure_service!\n grpc = service.get_backup instance_id, backup_id\n Backup.from_grpc grpc, service\n rescue Google::Cloud::NotFoundError\n nil\n end", "def restore\n p \"Doing a restore ...\"\n params = {:instance_href => \"/api/clouds/907/instances/#{@instance2_id}\"}\n id = @test_client.backups.index(:lineage => \"ns_backup_test_lineage\").first.show.href.split(\"/\")[-1] # => to get the id\n task = @test_client.backups(:id => id).show.restore(params)\n return task\nend", "def perform_backup\n \n add_memories_to_dropbox! if has_dropbox?\n\n # Clone the repo incase something is writing to it while we are backing up\n run \"cd #{@home} && git clone --bare #{@repo} #{@repo}.mirror\"\n output=run \"backup perform --trigger=daily_backup --log-path #{@dirs[:logs ]}\"\n run \"cd #{@home} && rm -fr #{@repo}.mirror\"\n \n get_timestamp(output)\n end", "def backup \n raise NotImplementedError.new\n end", "def backup\n BACKUP_MODELS.each do |obj|\n puts \"Preparing to back up #{obj}\"\n self.send(obj.to_sym)\n end \n end", "def backup_image\n case provider\n when :libvirt\n system \"sudo virt-clone -o #{IMAGE_NAME} -n #{IMAGE_NAME}_sav --file /var/lib/libvirt/images/#{IMAGE_NAME}_sav.qcow2\"\n when :virtualbox\n # Shutdown the system\n system \"VBoxManage controlvm #{IMAGE_NAME} acpipowerbutton\"\n sleep SLEEP_TIME_AFTER_SHUTDOWN\n system \"VBoxManage controlvm #{IMAGE_NAME} poweroff\"\n\n # Copy the virtual machine (this is the only way of having an identical system)\n vm_config = `VBoxManage showvminfo #{IMAGE_NAME} | grep \"Config file\" | cut -f2 -d:`.strip\n vm_dir = File.dirname(vm_config)\n system \"VBoxManage unregistervm #{IMAGE_NAME}\"\n FileUtils.mv vm_dir, \"#{vm_dir}.sav\"\n system \"sync\"\n end\n end", "def generate_drupal_backup\n @process_runner.execute!(\"cd #{@working_directory} && docker-compose run --rm drupal_data_generator\")\n end", "def do_backed_up\n self.update_attributes(:needs_initial_scan => false)\n update_last_backup_times\n end", "def copy_backup project_id:, instance_id:, cluster_id:, backup_id:, source_backup:, expire_time:\n tables.copy_backup parent: \"projects/#{project_id}/instances/#{instance_id}/clusters/#{cluster_id}\",\n backup_id: backup_id,\n source_backup: source_backup,\n expire_time: expire_time\n end", "def execute_restore_stripe(options={})\n new_vol_name = \"#{options[:lineage]}-#{ENV['EC2_INSTANCE_ID']}\"\n json_result = self.find_latest_ebs_backup(options[:lineage], options[:from_master], options[:timestamp])\n\n if json_result.nil? \n STDERR.puts \"No existing snapshot found for the specified nickname lineage. Aborting...\"\n exit(-1)\n end\n STDERR.puts \"Restoring.. #{json_result.inspect}\"\n options[:new_size_gb] = (options[:new_volume_size_in_gb] / json_result.size.to_f).ceil if options[:new_volume_size_in_gb]\n\n @disk.sync\n @disk.umount\n @disk.disable_volume\n\n self.execute_terminate_volumes if options[:force]\n\n json_result.each do |snapshot|\n \n# create volume from snap\n create_result = ( options[:new_size_gb] ? create_volume_from_snap_size_gb(snapshot[\"aws_id\"],new_vol_name,options[:new_size_gb] ) : create_volume_from_snap(snapshot[\"aws_id\"], new_vol_name ) )\n raise \"FATAL: error occured in create_volume_from_snap(#{snapshot['aws_id']}, #{new_vol_name})\" if create_result.nil?\n\n# attach volume to instance\n retry_seconds = 0\n while retry_seconds < 200\n begin \n attach_result = attach_volume(create_result['aws_id'], snapshot['device'])\n raise \"FATAL: error occured in attach_volume(#{create_result['aws_id']}, #{snapshot['device']}\" if attach_result.nil?\n break if attach_result\n rescue => e\n puts \"CAUGHT EXCEPTION in execute_restore_stripe. Device attachment. #{e}, Retrying #{retry_seconds} of 200 seconds\"\n retry_seconds += 30\n sleep 30 \n end\n end\n raise \"FATAL: error occured in attach_volume(#{create_result['aws_id']}, #{snapshot['device']}\" if attach_result.nil?\n end\n\n# wait for devices to attach, after completing ALL the api calls\n json_result.each { |s| wait_for_attachment(s['device']) }\n @disk.enable_volume\n raise \"FATAL: mount failed!\" unless @disk.mount\n @disk.write_fstab\n# TODO - grow the filesystem if a new size was given\n end", "def request_backup(db)\r\n\t\tdb.execute(\"SELECT * FROM playgroups WHERE kids>=5\")\r\n\t\tputs \"We'll need backup!!!\"\r\n\tend", "def frontend_backup(gear)\n app = gear.application\n args = Hash.new\n args['--with-container-uuid']=gear.uuid\n args['--with-container-name']=gear.name\n args['--with-namespace']=app.domain_namespace\n result = execute_direct(@@C_CONTROLLER, 'frontend-backup', args)\n result = parse_result(result)\n result.resultIO.string\n end", "def backup(file = nil)\n Chef::Util::Backup.new(new_resource, file).backup!\n end", "def backup(file = nil)\n Chef::Util::Backup.new(new_resource, file).backup!\n end", "def create(server)\n run_barman_command(\"backup #{server}\")\n end", "def backup(from: nil, to: nil)\n\n if @debug then\n puts 'ready to perform backup' \n puts \"from: %s to: %s\" % [from, to]\n end\n \n instructions = \"rsync -akL -e ssh %s %s\" % [from, to]\n\n puts 'instructions: ' + instructions if @debug \n \n # note: compression is not enabled since this is aimed at \n # single board computers which have limited CPU capability\n\n r = @ssh ? @ssh.exec!(instructions) : `#{instructions}`\n puts 'r: ' + r.inspect if @debug\n \n # since it's running in the background, an empty string will be returned\n \n end", "def restore_backup(backup_run_id, async: true)\n requires :identity\n\n data = service.restore_instance_backup(identity, backup_run_id)\n operation = Fog::Google::SQL::Operations.new(service: service).get(data.name)\n operation.tap { |o| o.wait_for { ready? } unless async }\n end", "def make_backup\n @backup = editor.create_snapshot\n end", "def backup(location)\n switch = SSH::Base.get_instance(location, logger)\n logger.info \"#{switch.class.to_s}: {target: #{switch.hostname}, operation: sync_from_switch_to_serv}\"\n switch.sync_from_switch_to_serv\n logger.info \"#{switch.class.to_s}: {target: #{switch.hostname}, operation: sync_from_switch_to_serv} finished\"\n end", "def delete\n ensure_service!\n service.delete_backup instance_id, backup_id\n true\n end", "def dump_database(app_name, instance_name)\n app_config = RailsPwnerer::Config[app_name, instance_name]\n db_name, db_user, db_pass = app_config[:db_name], app_config[:db_user], app_config[:db_pass]\n\n pwnerer_user = app_config[:pwnerer_user]\n pwnerer_uid = uid_for_username(pwnerer_user)\n pwnerer_gid = gid_for_username(pwnerer_user)\n \n timestamp = Time.now.strftime '%Y%m%d%H%M%S'\n dump_file = \"db/#{app_name}.#{instance_name}_#{timestamp}.sql\"\n Dir.chdir app_config[:backup_path] do\n system(\"mysqldump --add-drop-database --add-drop-table\" +\n \" --skip-extended-insert --single-transaction\" +\n \" -u#{db_user} -p#{db_pass} #{db_name} > #{dump_file}\")\n # lockdown the file\n File.chmod(0400, dump_file)\n File.chown(pwnerer_uid, pwnerer_gid, dump_file)\n end\n end", "def start\n\n @settings['accounts'].each do |account,keys|\n\n puts \"Account: #{account}\"\n @aws_access_key_id = keys['access_key_id']\n @aws_secret_access_key = keys['secret_access_key']\n\n # Find all servers with tags matching the supplied Hash\n find_instances(@tags).each do |server|\n\n # Begin snapshotting each volume attached to the server\n #\n server.block_device_mapping.each do |block_device|\n\n log \"\\e[0;32m Searching for matching snapshots \\e[0m(#{server.id}:#{block_device})..\"\n snapshots = volume_snapshots(block_device['volumeId'])\n\n # Create each type of backup we'll be using\n #\n %w(hourly daily weekly monthly).each do |snapshot_type|\n\n # Build snapshot history for the working volume and return all snapshots\n # matching our particular snapshot type\n history = snapshots.select do |snapshot|\n snapshot.tags['snapshot_type'] == snapshot_type &&\n snapshot.tags['volume_id'] == block_device['volumeId'] &&\n snapshot.tags['protected'] == 'false'\n end\n\n history.sort_by! { |snapshot| snapshot.created_at }\n\n unless too_soon?(history,snapshot_type) || instance_variable_get(\"@#{snapshot_type}_snapshots\") == 0\n\n # Check against threshold limits for backup history and delete as needed\n #\n while history.size >= instance_variable_get(\"@#{snapshot_type}_snapshots\")\n delete_snapshot(history.first.id)\n history.delete(history.first)\n end\n\n log \"Creating #{snapshot_type} for #{block_device['volumeId']}..\"\n create_snapshot({\n 'volume_id' => block_device['volumeId'],\n 'snapshot_type' => snapshot_type,\n 'description' => \"Snapshot::#{snapshot_type.capitalize}> Server: #{server.id}\",\n 'tags' => {\n 'snapshot_time' => \"#{Time.now}\",\n 'snapshot_type' => snapshot_type,\n 'instance_id' => server.id,\n 'volume_id' => block_device['volumeId'],\n 'deviceName' => block_device['deviceName'],\n 'protected' => 'false'\n }\n })\n end\n end\n end\n end\n end\n\n end", "def create_backup(site_id, datum = nil)\n current_path = \"/api/v1/sites/#{site_id}/backup\"\n @conn.post(current_path, datum.to_json)\n end", "def backup_instance_method(name)\n meta_eval {\n alias_method \"#{METHOD_BACKUP_KEY}#{name}\", name\n }\n end", "def restore \n # pg_restore -c -U postgres -d dataslam -1 /tmp/out.dump\n begin\n check_if_db_exists\n is_allowed = @conn.exec(\"select datallowconn from pg_catalog.pg_database where datname='#{@options[:database]}'\")[0]['datallowconn']\n if is_allowed == 'f'\n # unquiece temporarily\n set_dataallowcon_to true\n end\n\n fn = get_latest_backup_fn\n\n if fn == \"\"\n raise NoBackupsAvailableException.new \"There are no backups available at the specified location or in the default location (/tmp/postgresbk)\"\n end\n\n # The below system call assumes you have passwordless access as the user passed into the executable tool\n # either due to ~/.pgpass or pg_hba.conf has your user as a 'trust' auth method\n `pg_restore -c -U #{@options[:user]} -d #{@options[:database]} -1 #{@options[:bkdir]}/#{fn}`\n\n rescue Exception => e\n raise e\n ensure\n if is_allowed == 'f'\n # re quiesce \n set_dataallowcon_to false\n end\n end\n end", "def backup(dest_dir)\n logger.info \"Dumping MySQL#{db.db_and_table_names}\"\n @db.backup dest_dir\n end", "def config_master_from_scratch_from_dumpfile(server)\n create_stripe_from_dumpfile(server)\n run_query(\"CREATE DATABASE i_heart_monkey\", server)\n set_master_dns(server)\n # This sleep is to wait for DNS to settle - must sleep\n sleep 120\n run_script(\"backup\", server)\n end", "def perform!\n @started_at = Time.now.utc\n\n # log!(:started)\n\n @servers.each do |server|\n server.backup!\n end\n\n rescue Exception => err\n @exception = err\n p @exception\n\n ensure\n @finished_at = Time.now.utc\n # log!(:finished)\n end", "def save_backup_on_dup\n if self.duplicated_from && self.duplicated_from.restorable? && self.keep_backup\n FileUtils.mkdir_p( File.dirname( self.backup_path ))\n FileUtils.cp( self.duplicated_from.backup_path, self.backup_path )\n end\n end", "def backup(job)\n write_thread_var :job, job\n write_thread_var :source, job.backup_source\n\n worker = BackupWorker::WorkerFactory.create_worker(workitem.source_name, job)\n\n unless worker.authenticate\n auth_failed worker.errors.to_s\n return false\n end\n\n # We must disable ThinkingSphinx in every thread!\n turn_off_thinking_sphinx\n \n worker.run workitem.options\n\n save_error worker.errors.to_s if worker.errors.any?\n # Return backup success status\n worker.errors.empty?\n end", "def restore\n db = resolve_db(:allow_default => true)\n to_name = db[:name]\n to_url = db[:url]\n\n backup_id = args.shift\n\n if backup_id =~ /^http(s?):\\/\\//\n from_url = backup_id\n from_name = \"EXTERNAL_BACKUP\"\n from_uri = URI.parse backup_id\n backup_id = from_uri.path.empty? ? from_uri : File.basename(from_uri.path)\n else\n if backup_id\n backup = pgbackup_client.get_backup(backup_id)\n abort(\"Backup #{backup_id} already deleted.\") if backup[\"destroyed_at\"]\n else\n backup = pgbackup_client.get_latest_backup\n to_uri = URI.parse backup[\"to_url\"]\n backup_id = File.basename(to_uri.path, '.*')\n backup_id = \"#{backup_id} (most recent)\"\n end\n\n from_url = backup[\"to_url\"]\n from_name = \"BACKUP\"\n end\n\n message = \"#{db[:pretty_name]} <---restore--- \"\n padding = \" \" * message.length\n display \"\\n#{message}#{backup_id}\"\n if backup\n display padding + \"#{backup['from_name']}\"\n display padding + \"#{backup['created_at']}\"\n display padding + \"#{backup['size']}\"\n end\n\n if confirm_command\n restore = transfer!(from_url, from_name, to_url, to_name)\n restore = poll_transfer!(restore)\n\n if restore[\"error_at\"]\n message = \" ! An error occurred and your restore did not finish.\"\n message += \"\\n ! The backup url is invalid. Use `pgbackups:url` to generate a new temporary URL.\" if restore['log'] =~ /Invalid dump format: .*: XML document text/\n abort(message)\n end\n end\n end", "def set_backup\n @backup = Backup.find(params[:id])\n end", "def create_backup(storage_uuid, title:)\n data = {\n \"storage\" => {\n \"title\" => title\n }\n }\n\n json = JSON.generate data\n\n response = post \"storage/#{storage_uuid}/backup\", json\n\n response\n end", "def backup account\n backup_file File.join(@ssh_home, @ssh_id), File.join(@ssh_home, account + \".identity\")\n backup_file File.join(@ssh_home, @ssh_id + \".pub\"), File.join(@ssh_home, account + \".identity.pub\")\n @shell.say \"SSH identity backed up to account: #{account}.\"\n end", "def restore_d_b_instance(backup_id, d_b_instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'RestoreDBInstance'\n\t\targs[:query]['BackupId'] = backup_id\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :client_token\n\t\t\targs[:query]['ClientToken'] = optional[:client_token]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tself.run(args)\n\tend", "def purge\n ModelHelper::destroy_backup self\n end", "def set_backup\n if params[:id] && !params[:id].blank?\n @backup = Backup.new(nil, current_user.id)\n @backup.id_from_epoch(params[:id])\n else\n @backup = Backup.new(nil, current_user.id)\n end\n end", "def perform\n tmp_mongo_dir = \"mongodump-#{Time.now.strftime(\"%Y%m%d%H%M%S\")}\"\n tmp_dump_dir = File.join(tmp_path, tmp_mongo_dir)\n\n case self.backup_method.to_sym\n when :mongodump\n #this is the default options \n # PROS:\n # * non-locking\n # * much smaller archive sizes\n # * can specifically target different databases or collections to dump\n # * de-fragements the datastore\n # * don't need to run under sudo\n # * simple logic\n # CONS:\n # * a bit longer to restore as you have to do an import\n # * does not include indexes or other meta data\n log system_messages[:mongo_dump]\n exit 1 unless run \"#{mongodump} #{mongodump_options} #{collections_to_include} -o #{tmp_dump_dir} #{additional_options} > /dev/null 2>&1\"\n when :disk_copy\n #this is a bit more complicated AND potentially a lot riskier: \n # PROS:\n # * byte level copy, so it includes all the indexes, meta data, etc\n # * fast recovery; you just copy the files into place and startup mongo\n # CONS:\n # * locks the database, so ONLY use against a slave instance\n # * copies everything; cannot specify a collection or a database\n # * will probably need to run under sudo as the mongodb db_path file is probably under a different owner. \n # If you do run under sudo, you will probably need to run rake RAILS_ENV=... if you aren't already\n # * the logic is a bit brittle... \n log system_messages[:mongo_copy]\n\n cmd = \"#{mongo} #{mongo_disk_copy_options} --quiet --eval 'printjson(db.isMaster());' admin\"\n output = JSON.parse(run(cmd, :exit_on_failure => true))\n if output['ismaster']\n puts \"You cannot run in disk_copy mode against a master instance. This mode will lock the database. Please use :mongodump instead.\"\n exit 1\n end\n \n begin\n cmd = \"#{mongo} #{mongo_disk_copy_options} --quiet --eval 'db.runCommand({fsync : 1, lock : 1}); printjson(db.runCommand({getCmdLineOpts:1}));' admin\"\n output = JSON.parse(run(cmd, :exit_on_failure => true))\n\n #lets go find the dbpath. it is either going to be in the argv just returned OR we are going to have to parse through the mongo config file\n cmd = \"mongo --quiet --eval 'printjson(db.runCommand({getCmdLineOpts:1}));' admin\"\n output = JSON.parse(run(cmd, :exit_on_failure => true))\n #see if --dbpath was passed in\n db_path = output['argv'][output['argv'].index('--dbpath') + 1] if output['argv'].index('--dbpath') \n #see if --config is passed in, and if so, lets parse it\n db_path ||= $1 if output['argv'].index('--config') && File.read(output['argv'][output['argv'].index('--config') + 1]) =~ /dbpath\\s*=\\s*([^\\s]*)/ \n db_path ||= \"/data/db/\" #mongo's default path\n run \"cp -rp #{db_path} #{tmp_dump_dir}\" \n ensure\n #attempting to unlock\n cmd = \"#{mongo} #{mongo_disk_copy_options} --quiet --eval 'printjson(db.currentOp());' admin\"\n output = JSON.parse(run(cmd, :exit_on_failure => true))\n (output['fsyncLock'] || 1).to_i.times do\n run \"#{mongo} #{mongo_disk_copy_options} --quiet --eval 'db.$cmd.sys.unlock.findOne();' admin\"\n end\n end\n else\n puts \"you did not enter a valid backup_method option. Your choices are: #{BACKUP_METHOD_OPTIONS.join(', ')}\"\n exit 1\n end \n \n log system_messages[:compressing]\n run \"tar -cz -C #{tmp_path} -f #{File.join(tmp_path, compressed_file)} #{tmp_mongo_dir}\"\n end", "def wRestoreDump()\n puts \"Back up commencing...\"\n Dir.chdir('/Users/jeydurai')\n system('start_mongorestore.bat')\n end", "def backup account\n return unless valid_argument?(account, \"backup\")\n @heroku_credentials.backup account\n @ssh_identity.backup account\n end", "def transfer\n\t\tattributes = super\n\t\tself.last_backup_date = Date.today\n\t\tset_next_backup_date\n\t\tself.save\n\t\tlog_transfer(attributes)\n\tend", "def generate_backup\n if Export.launch_export!\n current_user.update(\n last_backup_at: Time.zone.now,\n last_backup_entry_id: current_user.last_entry_id\n )\n redirect_to backup_succeeded_path\n else\n redirect_to backup_failed_path\n end\n end", "def bms_backup(opts = {})\n data, _status_code, _headers = bms_backup_with_http_info(opts)\n data\n end", "def backup_and_download\n @config.each do |config|\n connect_to_host(config[:host],config[:port],config[:user],config[:password])\n backup_config(config[:name],config[:format])\n download_backup(config[:host],config[:port],config[:user],config[:password],config[:name],config[:path],config[:format])\n end\n return true\n end", "def make_backup\n print_title('Data backup')\n\n @backup_type ||= prompt.select('What type of backup do you want?',\n 'Full (redmine root and database)' => :full,\n 'Only database' => :database,\n 'Nothing' => :nothing)\n\n logger.info(\"Backup type: #{@backup_type}\")\n\n # Dangerous option\n if @backup_type == :nothing\n if prompt.yes?('Are you sure you dont want backup?', default: false)\n logger.info('Backup option nothing was confirmed')\n return\n else\n @backup_type = nil\n return make_backup\n end\n end\n\n @backup_root ||= prompt.ask('Where to save backup:', required: true, default: DEFAULT_BACKUP_ROOT)\n @backup_root = File.expand_path(@backup_root)\n\n @backup_dir = File.join(@backup_root, Time.now.strftime('backup_%d%m%Y_%H%M%S'))\n create_dir(@backup_dir)\n\n files_to_backup = []\n Dir.chdir(root) do\n case @backup_type\n when :full\n files_to_backup = Dir.glob(File.join('**', '{*,.*}'))\n end\n end\n\n if files_to_backup.any?\n files_to_backup.delete_if do |path|\n path.start_with?(*BACKUP_EXCLUDE_FILES)\n end\n\n @backup_package = File.join(@backup_dir, 'redmine.zip')\n\n Dir.chdir(root) do\n puts\n puts 'Files backuping'\n Zip::File.open(@backup_package, Zip::File::CREATE) do |zipfile|\n progressbar = TTY::ProgressBar.new(PROGRESSBAR_FORMAT, total: files_to_backup.size, frequency: 2, clear: true)\n\n files_to_backup.each do |entry|\n zipfile.add(entry, entry)\n progressbar.advance(1)\n end\n\n progressbar.finish\n end\n end\n\n puts \"Files backed up on #{@backup_package}\"\n logger.info('Files backed up')\n end\n\n @database = Database.init(self)\n @database.make_backup(@backup_dir)\n\n puts \"Database backed up on #{@database.backup}\"\n logger.info('Database backed up')\n end", "def xRestoreDump()\n puts \"Back up commencing...\"\n Dir.chdir('/Users/jeydurai')\n system('start_mongorestore.bat')\n end", "def perform!\n super\n\n pipeline = Pipeline.new\n\n pipeline << pg_probackup_cmd\n\n pipeline.run\n if pipeline.success?\n log!(:finished)\n else\n raise Error, \"Backup failed!\\n\" + pipeline.error_messages\n end\n end", "def modify_db_instance(options)\n options[:apply_immediately] = options[:apply_immediately].nil? ? true : options[:apply_immediately]\n options[:copy_tags_to_snapshot] = options[:copy_tags_to_snapshot].nil? ? true : options[:copy_tags_to_snapshot]\n\n @rds.modify_db_instance(options)\n end", "def backup_databases\n cloud_databases - ['redis']\n end", "def perform!\r\n super\r\n backup\r\n log!(:finished)\r\n end", "def create_temp_d_b_instance(d_b_instance_id, optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'CreateTempDBInstance'\n\t\targs[:query]['DBInstanceId'] = d_b_instance_id\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :_scheme\n\t\t\traise ArgumentError, '_scheme must be http|https' unless 'http|https'.split('|').include? optional[:_scheme]\n\t\t\targs[:scheme] = optional[:_scheme]\n\t\tend\n\t\tif optional.key? :backup_id\n\t\t\targs[:query]['BackupId'] = optional[:backup_id]\n\t\tend\n\t\tif optional.key? :owner_account\n\t\t\targs[:query]['OwnerAccount'] = optional[:owner_account]\n\t\tend\n\t\tif optional.key? :owner_id\n\t\t\targs[:query]['OwnerId'] = optional[:owner_id]\n\t\tend\n\t\tif optional.key? :resource_owner_account\n\t\t\targs[:query]['ResourceOwnerAccount'] = optional[:resource_owner_account]\n\t\tend\n\t\tif optional.key? :resource_owner_id\n\t\t\targs[:query]['ResourceOwnerId'] = optional[:resource_owner_id]\n\t\tend\n\t\tif optional.key? :restore_time\n\t\t\targs[:query]['RestoreTime'] = optional[:restore_time]\n\t\tend\n\t\tself.run(args)\n\tend", "def config_master_from_scratch(server)\n behavior(:create_stripe, server)\n object_behavior(server, :spot_check_command, \"service mysqld start\")\n#TODO the service name depends on the OS\n# server.spot_check_command(\"service mysql start\")\n behavior(:run_query, \"create database mynewtest\", server)\n behavior(:set_master_dns, server)\n # This sleep is to wait for DNS to settle - must sleep\n sleep 120\n behavior(:run_script, \"backup\", server)\n end", "def make_reg_backups(tmp)\n commandz = { 'SYSTEM' => \"%COMSPEC% /C reg.exe save HKLM\\\\SYSTEM #{tmp}\\\\sys\", 'SECURITY' => \"%COMSPEC% /C reg.exe save HKLM\\\\SECURITY #{tmp}\\\\sec\", 'SAM' => \"%COMSPEC% /C reg.exe save HKLM\\\\SAM #{tmp}\\\\sam\", 'SOFTWARE' => \"%COMSPEC% /C reg.exe save HKLM\\\\SOFTWARE #{tmp}\\\\sw\" }\n commandz.each do |hive, cmd|\n puts \"[\".light_blue + \"*\".white + \"]\".light_blue + \" Copying #{hive} hive.....\".white\n begin\n smb_psexec(cmd, false)\n sleep(1) # Slight pause between backup runs\n rescue StandardError => hiveerror\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Problems making copy of #{hive} hive\".light_red + \": #{hiveerror}\".white\n rescue ::Exception => e\n puts \"[\".light_red + \"*\".white + \"]\".light_red + \" Problems making copy of #{hive} hive\".light_red + \": #{hiveerror}\".white\n end\n end\nend", "def backup_config(name,format='binary')\n @log.info(\"Backup MikroTik configuration\")\n if format == 'binary'\n send_command(\"/system backup save name=#{name}\")\n elsif format == 'script'\n send_command(\"/export file=#{name}\")\n end\n @ssh_connect.close\n end", "def initBackup \n today = Time.now.wday\n #Do the backup either as planned or in testmode\n if ( \n (@weekdays.include?(today) && TESTMODE === false) || \n (TESTMODE === true && TESTSITE.nil?) || \n (TESTMODE === true && TESTSITE == @name)\n )\n $LOG.info(\"#{@name} : Backup initiated\") \n self.createBackup unless @backupUrl.nil?\n self.ftpDownload\n self.cleanUp\n $LOG.info(\"#{@name} : Backup completed\") \n end\n end", "def backed\n\tend", "def save(*args, &block)\n super\n # begin\n # require 'restclient'\n # server[\"/instances/#{instance_id}\"].put(to_json)\n # rescue Exception => e\n # Metavirt::Log.error \"cloudkit fail:\\n\\t#{e.inspect}\"\n # end\n self\n end", "def backup_target\n data[:backup_target]\n end", "def capture\n db = resolve_db(:allow_default => true)\n\n from_url = db[:url]\n from_name = db[:name]\n to_url = nil # server will assign\n to_name = \"BACKUP\"\n opts = {:expire => extract_option(\"--expire\")}\n\n backup = transfer!(from_url, from_name, to_url, to_name, opts)\n\n to_uri = URI.parse backup[\"to_url\"]\n backup_id = to_uri.path.empty? ? \"error\" : File.basename(to_uri.path, '.*')\n display \"\\n#{db[:pretty_name]} ----backup---> #{backup_id}\"\n\n backup = poll_transfer!(backup)\n\n if backup[\"error_at\"]\n message = \" ! An error occurred and your backup did not finish.\"\n message += \"\\n ! The database is not yet online. Please try again.\" if backup['log'] =~ /Name or service not known/\n message += \"\\n ! The database credentials are incorrect.\" if backup['log'] =~ /psql: FATAL:/\n abort(message)\n end\n end", "def create_images(isCopy)\n ec2 = AWS::EC2.new.client\n instances = ec2.describe_instances(:filters => [:name => 'tag-key', :values => ['backup']])\n images = []\n if instances\n if instances.data[:reservation_set].count > 0\n instances.data[:reservation_set].each do |rs|\n rs[:instances_set].each do |i|\n #get name of instance\n name = get_tagvalue(i, \"Name\") + \" backup at \" + Time.now.to_s.gsub(\":\", \"-\")\n image = ec2.create_image(:instance_id => i[:instance_id], \n :name => name,\n :description => \"Created - \" + Time.now.to_s + \" - created by SDK\", :no_reboot => true)\n images << image if image\n if (isCopy)\n copy_image(i[:image_id], AWSCONFIG[:default_region], AWSCONFIG[:backup_region], \n name, \"Backup for \" + Time.now.to_s + \" - created by SDK\")\n end\n end\n end\n end\n end\n\n return images\n end", "def backup\n FileUtils.cp options[:file], backup_file if File.file? options[:file]\n end", "def tmpbkup(action=:create)\n bkup=@bkup\n begin\n if action == :create\n # Thx SO; https://stackoverflow.com/questions/88311/how-to-generate-a-random-string-in-ruby\n marker = (0...8).map { ('a'..'z').to_a[rand(26)] }.join\n\n Pem::Logger.logit(\"Creating backup of #{@location} to #{@location}#{marker}\")\n FileUtils.mv(@location,\"#{@location}#{marker}\")\n return \"#{@location}#{marker}\"\n elsif action == :restore\n Pem::Logger.logit(\"Backup cannot be nil!\", :fatal) if bkup.nil?\n raise('Backup cannot be nil!') if bkup.nil?\n\n Pem::Logger.logit(\"Restoring backup of #{@location} from #{bkup}\")\n FileUtils.rm_rf(@location)\n FileUtils.mv(bkup,@location)\n return nil\n elsif action == :purge\n Pem::Logger.logit(\"Backup cannot be nil!\", :fatal) if bkup.nil?\n raise('Backup cannot be nil!') if bkup.nil?\n\n Pem::Logger.logit(\"Purging backup of #{@location} from #{bkup}\")\n FileUtils.rm_rf(bkup)\n return nil\n end\n rescue StandardError => err\n Pem::Logger.logit(err, :fatal)\n raise(err)\n end\n end", "def make_mysql_backup\n if @all_databases\n options = {\n :name => \"--all-databases\",\n :dump_options => \"\",\n :append_name => \"\"\n }\n file_name = mysqldump(options)\n compress_file(file_name)\n end\n if @databases && [email protected]?\n @databases.each do |db|\n options = {\n :name => db[:name].to_s,\n :dump_options => db[:dump_options].to_s,\n :append_name => db[:append_name].to_s\n }\n file_name = mysqldump(options)\n compress_file(file_name)\n end\n end\nend", "def prep_command\n \"mysqldump #{dump_options} -u #{db_user} --password=#{db_password} #{database} > #{remote_backup_path}\"\n end", "def restore_archive\n end", "def create_snapshots(isCopy)\n ec2 = AWS::EC2.new.client\n\n #get all volumes tagged as \"backup\"\n volumes = ec2.describe_volumes(:filters => [:name => 'tag-key', :values => ['backup']])\n snapshots = []\n\n #loop thru and create snapshots for all these volumes\n if volumes \n volumes.data[:volume_set].each do |v|\n name = get_tagvalue(v, \"Name\")\n snap = ec2.create_snapshot(:volume_id => v[:volume_id], :description => \"Backup for \" + Time.now.to_s + \" - created by SDK\")\n if snap\n snapshots << snap.data\n #add name tag\n ec2.create_tags(:resources => [snap.data[:snapshot_id]], :tags => [{:key => \"Name\", :value => name + \" backup\"}])\n\n #now copy snapshots to another region\n if isCopy\n copy_snapshot(snap.data[:snapshot_id], AWSCONFIG[:default_region], AWSCONFIG[:backup_region], \n name + \" backup\", \"Backup for \" + Time.now.to_s + \" - created by SDK\")\n end\n end\n end\n end\n\n return snapshots\n end", "def create(name)\n p \"Doing a create ...\"\n params = {:backup => {:lineage => \"ns_backup_test_lineage\", :name => name, :volume_attachment_hrefs => [@volume_attachment_href_1, @volume_attachment_href_2]}}\n return @test_client.backups.create(params)\nend", "def backup_data(src_file)\n backup_path = src_file + '.simplib_migration.bak.' + Time.now.strftime('%Y_%m_%d_%s')\n puts %Q(Making backup at #{backup_path})\n FileUtils.cp_r(src_file, backup_path)\nend", "def backup\n @current_teacher = current_teacher\n @school = School.find(current_teacher.school_id)\n @school_name = School.find(current_teacher.school_id).full_name\n end", "def config_master_from_scratch(server)\n create_stripe(server)\n run_query(\"CREATE DATABASE i_heart_monkey\", server)\n set_master_dns(server)\n # This sleep is to wait for DNS to settle - must sleep\n sleep 120\n run_script(\"backup\", server)\n end", "def backup(frequency,dir,t,condition)\n frequency.each do |vm|\n break if (Time.now.hour >= 5) && (Time.now.hour <= 20)\n mkdir = system(\"mkdir #{BACKUP_DIR}#{dir}#{vm} > /dev/null 2>&1\")\n %x[/bin/rm #{BACKUP_DIR}#{dir}#{vm}/*.log] if (File.exist?(\"#{BACKUP_DIR}#{dir}#{vm}/#{frequency.last}-#{t.month}-#{t.year}.log\"))#{condition}\n next if File.exist?(\"#{BACKUP_DIR}#{dir}#{vm}/#{vm}-#{t.month}-#{t.year}.log\")\n @logger = Logger.new(\"#{BACKUP_DIR}#{dir}#{vm}/#{vm}-#{t.month}-#{t.year}.log\", LOG_AGE)\n @logger.info(\"Started running\")\n case true\n when DOE_POOL.include?(vm)\n server = ''\n pass = \"\"\n when DOMAIN_POOL.include?(vm)\n server = ''\n pass = \"\"\n when SAMBP_XEN.include?(vm)\n server = ''\n pass = \"\"\n when SUNFIRE_XEN.include?(vm)\n server = ''\n pass = \"\"\n end\n result = []\n run_time = Benchmark.realtime do\n begin\n @logger.info(\"Suspend start\")\n result << system(\"xe vm-suspend vm=#{vm} -s #{server} -u root -pw #{pass} >> #{BACKUP_DIR}#{dir}#{vm}/#{vm}-#{t.month}-#{t.year}.log 2>&1\") \n @logger.info(\"Backup start\")\n result << system(\"xe vm-export vm=#{vm} filename=#{BACKUP_DIR}#{dir}#{vm}/#{vm}-$(date +%d-%m-%Y).backup -s #{server} -u root -pw #{pass} >> #{BACKUP_DIR}#{dir}#{vm}/#{vm}-#{t.month}-#{t.year}.log 2>&1\")\n @logger.info(\"Resume start\")\n result << system(\"xe vm-resume vm=#{vm} -s #{server} -u root -pw #{pass} >> #{BACKUP_DIR}#{dir}#{vm}/#{vm}-#{t.month}-#{t.year}.log 2>&1\")\n end\n end\n @logger.info(\"Removing old backup\")\n %x[rm #{BACKUP_DIR}#{dir}#{vm}/`ls -t1r #{BACKUP_DIR}#{dir}#{vm} | head -n 1`] if (result[1] == true) && (mkdir != true)\n @logger.info(\"Finished running - Backup run time: #{run_time.to_s[0, 5]}\")\n send_email_with_log(vm,t,dir) if result.include?(false) \n end\nend", "def backup_game(game_name)\n games = GameList.from_config\n game = games.find_game(game_name)\n\n couldnt_find_game!(game_name) unless game\n run_backup!(game)\n end" ]
[ "0.66211927", "0.66163284", "0.6572172", "0.65284425", "0.64936274", "0.62824166", "0.6253166", "0.6248349", "0.6241493", "0.6227637", "0.6188735", "0.5982258", "0.5980549", "0.59729415", "0.59644675", "0.5957096", "0.59501845", "0.59445065", "0.59313476", "0.59268725", "0.5887646", "0.58859086", "0.58733517", "0.5868378", "0.5859746", "0.5851207", "0.5849871", "0.5838508", "0.58206046", "0.58204246", "0.5816922", "0.5801682", "0.5751273", "0.57472074", "0.5742439", "0.57424015", "0.569601", "0.56836784", "0.5679397", "0.56754684", "0.56617343", "0.56617343", "0.5653712", "0.5651101", "0.56484586", "0.56376195", "0.5632593", "0.5629123", "0.5606827", "0.5594339", "0.5593145", "0.55837744", "0.5578286", "0.5573197", "0.554801", "0.5537024", "0.55156744", "0.55044407", "0.54995567", "0.54795617", "0.5476083", "0.54657054", "0.5443352", "0.5426355", "0.5425578", "0.5415645", "0.5410914", "0.5410645", "0.54008645", "0.5375378", "0.5369835", "0.53613985", "0.53604984", "0.53585035", "0.53529483", "0.53453976", "0.5336406", "0.5333909", "0.53313476", "0.53212154", "0.53188974", "0.5311354", "0.5304936", "0.5302555", "0.52903706", "0.5290143", "0.5284216", "0.5270134", "0.52673805", "0.526581", "0.5262208", "0.5254674", "0.5253763", "0.52533746", "0.5246158", "0.5230611", "0.52241135", "0.5222905", "0.5217522", "0.5213751" ]
0.7133587
0
Complete the solve function below.
def solve(meal_cost, tip_percent, tax_percent) tip_cost = meal_cost * (tip_percent / 100.0) tax_cost = meal_cost * (tax_percent / 100.0) return (meal_cost + tip_cost + tax_cost).round end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def solve\n end", "def solve!\n solve\n self\n end", "def solve!\n end", "def solve\n while !solved?\n step\n end\n\n self\n end", "def solve\n delegatee.solve\n end", "def solve\n loop { break if !shift }\n return @solutions\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 solve\n\t\tres = solveRec()\n\t\treturn res if res == [-1]\n\t\twhile ((nextIter = solveRec()) != [])\n\t\t\tres += nextIter\n\t\tend\n\n\t\treturn res;\n\tend", "def solution\n solve unless solved?\n @solution\n end", "def solved(ans)\n\n end", "def solve\n BruteForceSolver.new(self).solve\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 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\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 solve(x0)\n raise RuntimeError, \"This method is not implemented!\"\n end", "def solve!\n validate!\n\n @logger.info(\"Running Phase I\")\n PhaseIRunner.new(alpha_preferences, beta_preferences, logger: @logger).run\n\n build_solution\n end", "def solved?\n end", "def solve\n\t\t# Attempt to find a mismatch in start/end\n\t\t# letters in the maps. This signifies first\n\t\t# and last words of the solution\n\t\tdiff_list = []\n\t\t@start_map.each {|k,v|\n\t\t\tr = @end_map[k]\n\t\t\tdiff = r-v\n\t\t\tputs \"#{k} => #{v} | #{r} diff #{diff}\"\n\t\t\t\n\t\t\t# If values in map don't match, remember this\n\t\t\tif diff != 0\n\t\t\t\tdiff_list << diff\n\t\t\tend\n\t\t}\n\n\t\t# Ensure the matchings satisfy the properties of\n\t\t# and solvable puzzle. If there are \n\t\tputs diff_list\n\t\tif diff_list.size == 0\n\t\t\t# This means there are cycles (multiple\n\t\t\t# choices for the first word).\n\t\telsif diff_list.size == 2\n\t\t\t# Ensure there is exactly one starting\n\t\t\t# word and exactly one ending word\n\t\t\treturn [] if !diff_list.include?( 1 )\n\t\t\treturn [] if !diff_list.include?( -1 )\n\t\telse\n\t\t\t# This signifies an unsolvable puzzle\n\t\t\tputs \"Not Solvable\"\n\t\t\treturn []\n\t\tend\n\n\t\t# The characteristics of this word list look\n\t\t# good so far. Let's now try to enumerate the\n\t\t# solution array\n\t\treturn enumerate_solution\n end", "def solution\n\n return self if solved?\n\n while [hidden_singles, naked_singles].any?\n end\n\n return self if solved?\n\n\n # Brute force\n i = each_empty_cell.sort_by { |cell, n| legal_values(n).size }.first.try :last\n\n legal_values(i).map do |value|\n fill(i, value).solution\n end.compact.select { |n| n.solved? }.first\n end", "def solve(arg1, arg2)\n solver = subject.solver_for([arg1, arg2], ctx)\n solver.resume\n end", "def solve(arg1, arg2)\n solver = subject.solver_for([arg1, arg2], ctx)\n solver.resume\n end", "def calculate_solution\n Solve.it!(\n GraphBuilder.graph_from_cache(@cache, @options),\n resolver.constraints\n )\n end", "def solve\n traverse maze.cell_at(0,0)\n maze\n end", "def solve\n solution_candidate(intersections.next_people_with_similar_tastes)\n end", "def solve (bx, by, ex, ey)\n @marker = Array.new(r){Array.new(c){false}}\n @result = [false, nil]\n @beg = Node.new(nil, bx, by)\n dfs_solve(bx, by, ex, ey, @beg).to_s\n @result[0]\n end", "def solve\n @solving = Thread.new do\n (@lo..@hi).each do |i|\n if i % 50000 == 0\n sleep(0.001)\n end\n if @stop\n Thread.stop\n end\n @iteration = i\n if @prime % i == 0\n # print \"Already here\\n\"\n Thread.current[:proof] = i\n Debugger.debug_print(1, \"signaling solver with #{i}\")\n self.signal(i)\n break\n end\n end\n Debugger.debug_print(1, \"signaling solver with false\")\n self.signal(false)\n end\n end", "def solve!\n x, y = current = next_val\n return self unless current\n successors(x, y).each do |i|\n successor = clone\n successor[x, y] = i\n solution = successor.solve!\n return solution if solution\n end\n false\n end", "def solve(arg1, arg2)\n solver = subject.solver_for([arg1, arg2], ctx)\n solver.resume(ctx)\n end", "def solve\n\t\trowData = @data[0].split(\" \")\n\t\tcolData = @data[1].split(\" \")\n\n\t\t@rows = self.getCandidates(rowData, colData.size)\n\t\t@cols = self.getCandidates(colData, rowData.size)\n\n\t\tbegin\n\t\t\tnumChanged = self.reduceMutual(@cols, @rows)\n\t\t\tif (numChanged == -1)\n\t\t\t\treturn\n\t\t\tend\n\t\tend while (numChanged > 0)\n\n\t\[email protected] do |row|\n\t\t\tfor i in 0...(@cols.size)\n\t\t\t\tprint row[0][i]? \"# \" : \". \"\n\t\t\tend\n\t\t\tprint \"\\n\"\n\t\tend\n\t\treturn self\n\tend", "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 call(ctx)\n evaluate(solve(ctx))\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 converge_complete\n end", "def set_solution\r\n @solutions = true\r\n end", "def solve(type = HumanSolver)\n type.solve(@input)\n end", "def solve\n queue = [self]\n seen = {}\n loop do\n return nil unless p = queue.shift\n return p if p.solved?\n unless seen[p.to_s]\n p.available_moves.each do |move|\n p2 = p.clone.move(*move)\n queue << p2\n queue = queue.sort_by {|a| a.moves.size + a.solved_distance} \n seen[p.to_s] = true\n end\n end\n end\n end", "def solve!\n mapping = [4, 7, 9]\n @matrix[0..2].each { |row| mapping.each { |idx| raise 'invalid equations system' unless (1 - row.fetch(idx)).zero_eps? }}\n\n first = @matrix.fetch(0)\n second = @matrix.fetch(1)\n third = @matrix.fetch(2)\n\n @matrix[1..2].each { |row| row.subtract!(first) }\n second.normalize_term!(2)\n third.normalize_term!(2).subtract!(second) unless third.fetch(2).zero_eps?\n third.normalize_term!(3)\n second.normalize_term!(3).subtract!(third).normalize_term!(2) unless second.fetch(3).zero_eps?\n\n mapping = [4, 1, 0]\n {1 => 7, 2 => 9}.each do |ri, ci|\n row = @matrix.fetch(ri)\n mapping.zip(sum_square(row.fetch(1), row.fetch(0))).each do |idx, val|\n first[idx] += val\n end\n first[ci] -= 1.0\n end\n\n first.normalize_term!(2).subtract!(second) unless first.fetch(2).zero_eps?\n first.normalize_term!(3).subtract!(third) unless first.fetch(3).zero_eps?\n first.normalize_term!(4)\n\n coefs = mapping.map { |idx| first.fetch(idx) }\n mapping = Set.new(mapping)\n first.each_with_index { |val, idx| raise 'calculating error' unless mapping.include?(idx) || val.zero_eps? }\n delta = coefs[1] ** 2 - 4 * coefs[0] * coefs[2]\n raise 'negative or zero discriminant' if delta <= 0 || delta.zero_eps?\n delta = Math.sqrt(delta)\n\n root_x = ->(delta_sqrt) { (delta_sqrt - coefs[1]) / (2 * coefs[0]) }\n root_yz = ->(x, row) { -(row.fetch(0) + x * row.fetch(1)) }\n @roots = [delta, -delta].map do |x|\n x = root_x.call(x)\n [x, root_yz.call(x, second), root_yz.call(x, third)]\n end\n end", "def recursive_solution\n\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 solve\n return [] if @current_state.achieved?(@objective)\n return nil if @remaining_rounds <= 0\n\n possible_transformations = @transformations.select { |transformation| @current_state.can_apply?(transformation) }\n\n sorted_transformations = possible_transformations.sort_by do |transformation|\n future_state = @current_state.dup.apply(transformation)\n future_state.distance_of(@objective)\n end\n return nil if sorted_transformations.empty?\n\n sorted_transformations.lazy.map do |transformation|\n elapsed_rounds = @opts[:max_rounds] - @remaining_rounds - 1\n future_state = apply(transformation, elapsed_rounds)\n return nil unless future_state # apply can returns nil in case of error\n\n world = World.new(@transformations, @objective, @remaining_rounds - 1, future_state, @opts)\n res = world.solve\n [transformation] + res if res\n end.select(&:itself).first\n end", "def solvable?\n find_solution > 0\n end", "def solve!\n\n until solved?\n\n\n @cell_array.each do |cell_object|\n cell_object.refresh_possible_values(@cell_array)\n if cell_object.value == 0 && cell_object.possible_values.length == 1\n cell_object.value = cell_object.possible_values[0]\n end\n end\n\n end\n\n board\n\n end", "def solve(begX, begY, endX, endY); MazeSolver.new(plane,graph).solve(begX, begY, endX, endY) end", "def solve(show_res=true, debug=false)\n\n while not done?\n step(debug)\n end\n\n if show_res or debug then\n puts show_state\n puts \"computed in #{@duration} sec\"\n end\n\n solution\n end", "def solution\n answer = self.clone.solve\n answer.nil? ? nil : answer.grid.map {|row| row.map {|cell| cell.first}}\n end", "def solve\n \n # Clean up.\n reset_visiting_state\n \n # Enqueue start position.\n @queue = []\n enqueue_cell([], @start_x, @start_y)\n \n # Loop as long as there are cells to visit and no solution has\n # been found yet.\n path = nil\n until path || @queue.empty?\n path = solve_visit_cell\n end\n \n if path\n # Mark the cells that make up the shortest path.\n for x, y in path\n @path[x][y] = true\n end\n else\n puts \"No solution found?!\"\n end\n end", "def solve\n @time = Time.new\n while true\n if @stack.pop == 0\n else\n while (not @stack.empty?) && (@stack.peek == 1)\n @stack.pop\n end\n if not @stack.empty?\n @stack.pop\n else\n b = Time.new\n @time = b - @time\n return\n end\n \n end\n \n @current_configuration[@stack.size] = 1\n @stack.push(1)\n while @stack.size < @dimension\n @current_configuration[@stack.size] = 0\n @stack.push(0)\n end\n \n conf = Configuration.new(@current_configuration, @problem)\n curr_fitness = conf.fitness\n if curr_fitness > @best_fitness\n @best_fitness = curr_fitness\n for i in 0..@current_configuration.size - 1\n @best_configuration[i] = @current_configuration[i]\n end\n \n end\n \n end\n \n \n end", "def solve(begy,begx,endy,endx)\n\t\treturn @av.solve(begy,begx,endy,endx,@map)\n\tend", "def solve\n eval(@parse_tree)\n end", "def solve\n if invalid?\n nil\n elsif solved?\n self\n else\n x, y = @strategy.next_cell(@grid)\n\n # Try each of the possible values for cell [x, y] and if one leads to a solution, return that solution\n self[x, y].each do |val|\n next_game = self.clone\n next_game[x, y] = val\n next_solution = next_game.solve\n return next_solution unless next_solution.nil?\n end\n\n # No solution found\n nil\n end\n end", "def solver\n if checkrule(0)\n puts \"Success!!!\"\n else\n puts \"No solution found\"\n end\n end", "def solve(vector)\n @b = vector\n decompose if @lu_m.nil?\n eval_z\n eval_answer\n end", "def solve!\n while empty_squares.any?\n square = empty_squares.detect { |square| legal_values_for_square(square).size == 1 }\n square.value = legal_values_for_square(square).first\n end\n end", "def solve!(type = HumanSolver)\n @input = type.solve(@input)\n end", "def solve(args)\n @seen_stack, @need_to_check, solved = [], [], false\n current_cell, finish = map[args[:begX]][args[:begY]], map[args[:endX]][args[:endY]]\n @seen_stack.push(current_cell)\n @need_to_check.push(current_cell)\n\n until @need_to_check.empty? || solved\n current_cell = @need_to_check.shift\n @seen_stack.push(current_cell)\n check_possible_paths(current_cell, finish)\n solved = true if current_cell == finish\n end\n solved\n end", "def solve(board)\n position = board.first_empty_position\n return board unless position\n board.options(position).each do |option|\n solution = solve(Board.new(\n board.digits[0...position] + option + board.digits[position + 1..-1]\n ))\n return solution if solution\n end\n nil\nend", "def solve0(show_res=true, debug=false)\n\n while not done?\n step0(debug)\n end\n\n if show_res or debug then\n puts show_state\n puts \"computed in #{@duration} sec\"\n end\n\n solution\n end", "def solution\n return self.answers.select {|x| x.correct}[0] if solved?\n nil\n end", "def run\n solve\n { price: @best_price, config: @best_config }\n end", "def solve_all\n amb = self.new\n yield(amb)\n amb.failure\n rescue Amb::ExhaustedError\n end", "def solve\n init_signature\n compute_hashes\n compute_signature\n recommendations\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 solve_all(failure_message = \"No more solutions.\")\n amb = self.new\n yield(amb)\n amb.failure\n rescue Amb::ExhaustedError => ex\n puts\n puts \"#{amb.branches_count} branches explored.\" if $DEBUG\n amb.report(failure_message)\n end", "def solved?\n @solution != nil\n end", "def solve!\n c = i = changed = 0\n while i = ((i+1)..(changed+81)).find{|x|!cells[x % 81]}\n NEIGHBOURHOODS[c = i % 81].each do |neighbours|\n pn = neighbours.inject(possibilities[c]){|r, j| (j != c) ? (r &\n~possibilities[j]) : r}\n if v = SINGLEBIT[pn]\n set_cell(changed = i = c, v) \n break \n end\n end\n end\n\n return self if cells.all?\n return nil if possibilities.any?{|p| p.zero?}\n\n p, i = possibilities.zip((0..80).to_a).select{|a, b|numbits(a) > 1}.\n min{|a, b|numbits(a[0]) <=> numbits(b[0])}\n\n eachbit(p){|j| b=clone.set_cell(i, j).solve! and return b}\n return nil\n end", "def update\r\n\r\n # check for an abort flag\r\n if defined? ABORT\r\n close\r\n end\r\n\r\n # has final state already been determined?\r\n if [email protected]_final_state()\r\n\r\n # determine final state\r\n if [email protected]_final_state(@queens)\r\n\r\n # Action: limit number of queen moves\r\n @limiter += 1\r\n if @limiter >= @limit\r\n puts \"Solution Not Found or Queen Moves Exceded Limit of \"[email protected]_s+\".\"\r\n @board.force_final_state()\r\n end\r\n\r\n # select a new queen, rearrange it towards solving 8queens problem\r\n @curr_index = @board.search_next_and_move(@curr_index,@queens)\r\n\r\n @board.clear_hits()\r\n @board.update_hits(@queens)\r\n\r\n\r\n else\r\n puts \"\\nSolution Found!\\n\"\r\n self.print_queens()\r\n puts \"\\n\"\r\n end\r\n end\r\n end", "def solveMeFirst(a, b) {\n a+b;\nend", "def guess\n \t# loop 1\n\t while true do\n\t\t @sudoku.each_with_index do |row, rowindex|\n\t\t row.each_with_index do |cell, cellindex|\n\t\t \t# *******************************************************\n\t\t \t# this part same as solve! method\n\t\t col = @sudoku.transpose[cellindex]\n\t\t # return to previous loop (loop 2) if sudoku board is completely solved\n\t\t return if [email protected]?(0)\n\t\t next if cell != 0\n\t\t solutions=(1..9).to_a\n\t\t 1.upto(9) {|x| solutions.delete(x) if row.include?(x)}\n\t\t 1.upto(9) {|x| solutions.delete(x) if col.include?(x)}\n\t\t box_x=(rowindex./3)*3\n\t\t box=[]\n\t\t 3.times do\n\t\t \tbox_y=(cellindex./3)*3\n\t\t \t3.times do\n\t\t \t\tbox << @sudoku[box_x][box_y]\n\t\t \t\tbox_y += 1\n\t\t \tend\n\t\t box_x += 1\n\t\t \tend\n\t\t \t\t1.upto(9) {|x| solutions.delete(x) if box.include?(x)}\n\t\t \t\t# *******************************************************\n\t\t \t\t# return to previous loop/previous unsolved grid(loop 2) if no solutions found for current grid\n\t\t \treturn if solutions == []\n\t\t \tsolutions_index = 0\n\t\t \t# loop through each number in solutions array (loop 2)\n\t\t \twhile true do\n\t\t \t\t# replace current grid with a number with in solutions\n\t\t\t @sudoku[rowindex][cellindex] = solutions[solutions_index]\n\t\t\t # call itself\n\t\t\t guess\n\t\t\t # code start from this line if no solution found from previous recursion (from return if solutions == [])\n\t\t\t # break the loop if sudoku board is completely solved\n\t\t\t break if [email protected]?(0) \n\t\t\t # change index to the next number in solutions\n\t\t\t solutions_index += 1\n\t\t\t \tif rowindex == 0 && cellindex ==0 && solutions_index == solutions.length\n\t\t\t\t \t@sudoku[rowindex][cellindex] = 0\n\t\t\t\t \t# stop recursion and goes to next loop(loop 1) if no solutions found at all\n\t\t\t\t \tbreak\n\t\t\t \telsif solutions_index == solutions.length\n\t\t\t \t@sudoku[rowindex][cellindex] = 0\n\t\t\t \t# return to previous loop/previous unsolved grid(loop 2) if no solutions found for current grid\n\t\t\t \treturn\n\t\t\t \tend\n\t\t \tend\n\t \tend\n\t \tend\n \tend\n end", "def soln\n @soln ||= preprocess_hash(solve)\n end", "def reduce_solved\n before = 9*9*9\n after = entropy\n while before > after\n before = after\n reduce_line\n reduce_col\n reduce_grid\n after = entropy\n end\n self\n end", "def solve(s_x, s_y, e_x, e_y)\r\n\t\tstart = Place.new( s_x, s_y, nil)\r\n\t\tend_p = Place.new(e_x, e_y, nil)\r\n\t\tif check_place(start)&&check_place(end_p)\r\n\t\t\treturn MazeSolver.new(@n, @m, @maze, start, end_p).solve\r\n\t\telse puts \"invalid start or end\" end\r\n\tend", "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 solve\n fail 'invalid game given' unless @grid.valid?\n puts \"missing values #{@grid.missing}, filled #{@grid.filled}\"\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 solve!\n simple_sudoku_logic\n puts \"HERE'S YOUR BOARD, SOLVED. ?\"\n display_board\n end", "def find_solution\n if solve(@start_point[0], @start_point[1])\n @maze.each { |row| puts row.join(\"\") }\n else\n puts \"no solution found\"\n end\n end", "def complete\n # # step 0: 对Solutions的结果做voting,并将最终结果存入Problem的result中\n # PhotoRecognitionJob.perform_later(self.id.to_s)\n # step 1: 修改Problem的状态为solved,未完成的Solutions的状态为failed\n self.set(status: :solved)\n self.solutions.each { |solution|\n if solution.status.waiting?\n solution.set(status: :failed)\n end\n }\n # # step 2: 修改Seeker与Solvers的credit\n # self.creator.crowdsourcing_profile.decrease_credit(self.credit_expend)\n # self.creator.crowdsourcing_profile.decrease_prepared_credit(self.credit_prepared)\n # self.creator.crowdsourcing_profile.touch(:updated_at)\n # self.creator.crowdsourcing_profile.save\n # self.solutions.each { |solution|\n # if solution.status.solved?\n # solution.creator.crowdsourcing_profile.increase_credit(solution.problem.credit)\n # solution.creator.crowdsourcing_profile.touch(:updated_at)\n # solution.creator.crowdsourcing_profile.save\n # end\n # }\n # step 3: 修改Seeker_Profile中的 finished + 1 以及积分变化\n # 修改Solver_Profile:如果完成,finished + 1,积分变化;如果失败,failed + 1,积分不变\n self.creator.seeker_profile.increase_finished\n # self.creator.seeker_profile.increase_credit(self.credit_expend)\n self.creator.seeker_profile.touch(:updated_at)\n self.creator.seeker_profile.save\n self.solutions.each { |solution|\n if solution.status.solved?\n solution.creator.solver_profile.increase_finished\n # solution.creator.solver_profile.increase_credit(solution.problem.credit)\n solution.creator.solver_profile.touch(:updated_at)\n solution.creator.solver_profile.save\n else\n solution.creator.solver_profile.increase_failed\n solution.creator.solver_profile.touch(:updated_at)\n solution.creator.solver_profile.save\n end\n }\n end", "def solve(parameters)\n nil_vars = @vars.select{|var| parameters[var].nil?}\n raise \"Too many unknowns\" if nil_vars.size>1\n raise \"Nothing to solve\" if nil_vars.empty?\n var = nil_vars.first\n # determine sensible initial value? => parameters[var] = initial_value\n {var=>@solver.root(var, parameters)}\n end", "def return_solution_found\n @open.select(&:goal).first\n end", "def solve(puzzle)\n raise NotImplementedError, \"Subclass must implement this method.\"\n 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 \[email protected]_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 naive_solution(step_by_step = false)\n while grid.has_zeros?\n naked_single\n print_grid if step_by_step\n end\n raise StandardError, 'Something went wrong!' unless grid.valid?\n unless step_by_step\n grid.calculate_possible_values! # This is to avoid printing the last step\n print_grid\n end\n puts \"------ Solved! ------\\n\\n\"\n rescue\n raise StandardError, 'Something went wrong!' unless grid.valid?\n boxed_single\n print_grid if step_by_step\n naive_solution\n end", "def solved?\n unknown_count == 0\n end", "def solve\n @destinations = create_locations_from_file(file)\n @destinations.build_distance_table\n @bus.set_start(@destinations.get_start)\n while @bus.has_next_destination do\n @bus.drive_to_next_closet_destination\n end\n @bus.route\n end", "def resolving_work\n self.resolve_procedures\n self.executable_steps.each { |step| step.force_resolve! if step.problem? }\n self.prepare_steps_for_execution\n self.push_msg\n end", "def solve(index)\n @config[index] = 0\n solve(index + 1) unless stop(index)\n @config[index] = 1\n solve(index + 1) unless stop(index)\n end", "def solve\n max = nil\n\n # Start with the longest possible and work down. \n 9.downto( 1 ) do |i|\n max = Array.new( i ) {|j| 1 + j}.permutation.to_a.map! {|j| j.join.to_i}.select {|j| j.prime? }.max\n break if max\n end\n \n max\n end", "def solve\r\n for restart in (1..@max_restarts)\r\n random_assignment()\r\n for flip in (1..@max_flips)\r\n if(@num_clauses == 0)\r\n return @assignments\r\n else\r\n next_var = find_next_flip()\r\n flip(next_var,true)\r\n end#end if\r\n end#end max_flips\r\n if(@num_clauses == 0)\r\n return @assignments\r\n end\r\n end\r\n return nil #No solution found :(\r\n end", "def solve!\n #calculates the initial adjacency matrix\n self.calculate_adjacency_matrix!\n\n #create the root node, with city ID 0 (for Beijing)\n self.root_node = Node.new(0)\n self.root_node.set_cost_matrix(self.adj_matrix) #set the cost matrix to the adjacency matrix\n\n #calculate the base cost manually (usually would happen during init but ROOT lacks a parent)\n self.root_node.calculate_base_cost!\n node = self.root_node\n\n #keep creating child nodes and selecting the minimum from the next level,\n #repeating until all cities have been visited.\n while(node.visited_this_tour.size < @@cities.size)\n node.create_children!\n\n best_node = node.children.min\n node = best_node\n end\n\n #print the results!\n node.visited_this_tour.each do |city_id|\n puts @@cities[city_id][:name]\n end\n\n end", "def submit\n solution = @entry.text\n return self.retry() if solution.empty?\n self.solved(solution)\n end", "def solve(board_string)\n # Get location of empty cell\n position = board_string.index(\"-\")\n return board_string if position == nil\n # Figure out which potential numbers can go into empty cell\n possible_numbers = checker(position, board_string)\n # For each potential number...\n possible_numbers.each do |number|\n # Fill in current cell with potential number\n board_string[position] = number.to_s\n # Call solve method on that modified board\n puts pretty_board(board_string)\n sleep(0.01)\n output = solve(board_string)\n # If board is solved, return solved board\n return output if solved?(output)\n end\n board_string[position] = \"-\"\n return board_string\nend", "def solve\n # 1\n generation = Generation.new(@starting_paths)\n\n # 2\n while !generation.target_reached?\n generation = generation.next\n end\n\n # 3\n message = \"Maze description : going from #{@source} to #{@target}\\n\"\n message << generation.to_s\n Renderer.result(message)\n end", "def solve\n cell_index, cell = @game_board.first\n until cell.nil?\n cell_value = cell.increment\n unless cell_value == false\n if @game_board.value_allowed?(cell_index, cell_value)\n cell.increment!\n cell_index, cell = @game_board.next(cell_index)\n else\n cell.increment!\n end\n else\n cell.empty!\n cell_index, cell = @game_board.prev(cell_index)\n end\n end\n\n @game_board\n end", "def solved\n all_queens_placed && attacks_possible != true\n end", "def solve\n answer_vector = Vector.float(@stiff_matrix.size)\n current_residuum = @force.clone\n current_z_vector = @force.clone.mul! @precondition_vector\n p_vector = @force.clone.mul! @precondition_vector\n\n while current_residuum.max_by{|n| n.abs}.abs > 0.001\n last_residuum = current_residuum.clone\n last_z_vector = current_z_vector.clone\n product_of_stiff_matrix_and_p_vector = @stiff_matrix.product(p_vector)\n alpha_val = last_residuum * last_z_vector / (p_vector * product_of_stiff_matrix_and_p_vector)\n answer_vector += alpha_val * p_vector\n current_residuum = last_residuum - alpha_val * product_of_stiff_matrix_and_p_vector\n #loop can be broken here if residuum is small enough\n current_z_vector = current_residuum.clone.mul! @precondition_vector\n p_vector = current_z_vector + p_vector * (current_z_vector * current_residuum / (last_z_vector * last_residuum))\n end\n\n return answer_vector\n end", "def solved\n @solved = @rows.flatten.include?(\"0\") ? false : true\n end", "def solve_a_sudoku(sudoku_datas)\n sudoku_cells = prepare_sudoku_cells(sudoku_datas)\n # display_sudoku(sudoku_cells, \"Sudoku to solve\")\n # build the potential list of values for each cell\n build_potential_value_list(sudoku_cells)\n update_cells(sudoku_cells) # update the value of each cell\n counter = 0\n # continue to the try to solve\n # if the counter goes beyond a million\n # it's probably a bad sudoku\n until solved(sudoku_cells) || counter > 1000 #\n shed_potential_value_list(sudoku_cells)\n update_cells(sudoku_cells)\n # double_whammer(sudoku_cells)\n counter += 1\n end\n if (counter > 1000)\n return nil\n end\n sudoku_cells\nend", "def find_solution_dynamic\n if @game_data.solved?\n update_best_maybe(nil)\n return\n end\n\n prev_move_num = @visited[@game_data.cur_row]\n if !prev_move_num.nil? && (prev_move_num <= @move_number)\n return\n end\n\n @visited[@game_data.cur_row] = @move_number\n\n moves = @game_data.possible_plays\n moves.each do |move|\n next unless @game_data.make_move(move)\n\n raw_pat, raw_repl = @game_data.get_raw_rule_and_repl_for_move(move)\n cur_pos = @game_data.cur_row.dup\n if raw_pat.include?('.')\n # replace the replaced chars with the raw (wildcard) pattern\n # this makes it able to hook into the set of pre-computed positions.\n cur_pos[move[GS_PLAY_IDX]...raw_repl.size] = raw_pat\n end\n\n # did our two solver techniques connect? (Brute force ran into a\n # pre-populated static answer if 'pos' exists)\n pos = @positions[cur_pos]\n unless pos.nil?\n # Success! Limited brute force search with wildcards was able to\n # find a solution in the precomputed set of positions!\n # DON'T BREAK because the first found solution may not be the best.\n update_best_maybe(pos)\n end\n\n @move_number += 1\n find_solution_dynamic\n @move_number -= 1\n @game_data.undo_move\n end\n nil\n end", "def solve(arr = @input_arr)\n number_array = NumberArray.new\n pos = number_array.first_free_position arr\n # sudoku is solved, there are no free spaces in output_arr\n return arr unless pos\n ('1'..'9').each do |num|\n arr[pos] = num\n next unless number_array.valid_sudoku? pos, arr\n temp_sol = solve arr.dup\n return temp_sol if temp_sol\n end\n false\n end", "def prepare_to_check_solve(fake_value = 0.01)\n 2.times do\n find_max_values(end_layer_sum).each do |max_value|\n log format('faking values: %d-%x', end_layer_sum, max_value)\n vbyte_reader = VByteReader.new(\n layer_part_pathname(end_layer_sum, max_value)\n )\n @solver.generate_values_for_check(\n vbyte_reader,\n fake_value,\n new_solution(end_layer_sum, max_value).values.to_s\n )\n end\n @end_layer_sum -= 2\n end\n end", "def right_hand_solve\n until @buckets[1] == @target\n fill_right\n until @buckets[1].zero?\n right_to_left\n break if @buckets.include?(@target)\n empty_left\n break if @buckets.include?(@target)\n right_to_left\n break if @buckets.include?(@target)\n end\n end\n end" ]
[ "0.7912264", "0.78778714", "0.7738673", "0.73811764", "0.71148485", "0.6969912", "0.68216586", "0.6817378", "0.68094444", "0.67890126", "0.67816764", "0.6774406", "0.6718856", "0.67047435", "0.6643811", "0.66219836", "0.6416877", "0.6373854", "0.6358416", "0.6346396", "0.6346396", "0.63249934", "0.6313436", "0.62515", "0.62504816", "0.62408715", "0.6221953", "0.6218575", "0.62044555", "0.6202124", "0.61447144", "0.61331534", "0.61180586", "0.6100477", "0.6084097", "0.6067182", "0.60654056", "0.60637546", "0.60585463", "0.60452163", "0.6034156", "0.6021073", "0.60121095", "0.60057294", "0.59910804", "0.5990903", "0.5981721", "0.5981366", "0.5952746", "0.595238", "0.5943401", "0.59224355", "0.5914117", "0.5909362", "0.59072083", "0.5906396", "0.58526003", "0.58191717", "0.5817567", "0.58170736", "0.57848585", "0.5773786", "0.57669216", "0.57660943", "0.57626176", "0.5731196", "0.5728478", "0.5718322", "0.57162285", "0.5708205", "0.57067305", "0.5702141", "0.5687395", "0.56605256", "0.5660214", "0.5660207", "0.5642644", "0.56169134", "0.5606721", "0.5601715", "0.55774397", "0.55727893", "0.5569311", "0.55538535", "0.5547708", "0.55407614", "0.5526758", "0.55077785", "0.54982686", "0.54923916", "0.5488347", "0.546906", "0.54680586", "0.5461573", "0.5461253", "0.545728", "0.54532033", "0.543426", "0.5431767", "0.5430484", "0.5430039" ]
0.0
-1
Reset log for a new trip
def resetLog @currSpeed = 0 @totalDistance = 0 @travelLog = "" @numChanges = 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reset_log_data\n without_logging { update_all(log_data: nil) }\n end", "def log_reset\n @log_device.truncate(0) if defined? @log_device\n self\n end", "def reset_log_data\n self.class.without_logging { update_column(:log_data, nil) }\n end", "def clear_log\n request('clearLog')\n end", "def reset_logging\n\t\tTreequel.reset_logger\n\tend", "def reset\n self.level = :normal\n flush\n close_log(@last_file)\n @last_file = nil\n close_log(@job_file)\n @job_file = nil\n @custom_logs.each do |name, log|\n close_log(log)\n end\n @custom_logs = {}\n end", "def reset_logging\n\t\tRoninShell.reset_logger\n\tend", "def clear_log\n @output = []\n end", "def clear_log!(name)\n put :clear_log!, {:name => name}\n end", "def reset_logging!(opts)\n Ncio::Support.reset_logging!(opts)\n end", "def clear_log\n @messages = []\n end", "def reopen_logs; end", "def reset\n @params = nil\n @logger = nil\n end", "def sparkResetLogging()\n #logNormal($sparkPrefix + \" sparkResetLogging removing all log targets\\n\");\n\n logServer = get($serverPath+'log')\n if (logServer != nil)\n logServer.removeAllStreams()\n end\nend", "def reset_own_logger\n self.logger = nil\n end", "def reset_logging\n\t\tMongrel2.reset_logger\n\tend", "def reset!\n logs.remove\n features.remove\n users.remove\n end", "def reset\n initialize\n @log = nil\n @default_model = nil\n end", "def relog\n logon(relog = true)\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def reset_config!\n @log = nil\n @logger = nil\n @log_level = nil\n end", "def autoflush_log; end", "def autoflush_log; end", "def reset_sql_diff_text_log\n @sql_diff_text_log = ''\n end", "def after_failure\n LoggerService.new.clear_file(log_file)\n end", "def reset_logger!\n Thread.current[:merb_logger] = nil\n end", "def reset\n @errors = []\n @journal_rows = []\n @journaled_facility_ids = Set.new\n @product_recharges = {}\n end", "def log=(log); 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 _clear()\n @error_handler = Task.new(self, :error, Actors::ErrorHandler)\n @log = Task.new(self, :log, Actors::Log)\n end", "def reset\n @registry = {}\n @logging = false\n @line_item_limit = 1000\n end", "def reset_horizon\n @horizon = Time.now\n @active_time = 0.0\n @requests = 0\n end", "def reset!\n begin\n update!(:attempts => 0, :error => nil, :lock => nil, :run_at => Time.now.utc)\n rescue => e\n DataMapper.logger.warn(e)\n end\n end", "def reset\n log_out_and_disconnect\n @imap = nil\n @logged_in = false\n @idling = false\n end", "def initialize()\n @log = {}\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 self.soap_version = SOAP::DefaultVersion\n self.strip_namespaces = true\n self.env_namespace = nil\n self.soap_header = {}\n end", "def reset\n VALID_CONFIG_OPTIONS.each { |opt| self.send(\"#{opt}=\", nil) }\n self.logger = nil\n end", "def reset\n # TODO\n end", "def reopen_logs\n Resqued::Logging.close_log # it gets opened the next time it's needed.\n end", "def timelog_stop_tracking\n if @timelog_active\n @log.debug(\"Stopping tracking of timelog.\")\n secs_passed = Time.now.to_i - @timelog_active_time.to_i\n \n @timelog_active.update(\n :time => @timelog_active[:time].to_i + secs_passed,\n :sync_need => 1\n )\n @timelog_logged_time[:timestamp_end] = Time.now\n end\n \n @timelog_active = nil\n @timelog_active_time = nil\n @ti.update_icon if @ti\n @events.call(:timelog_active_changed)\n end", "def reset_singleton_logger!\n @@singleton_logger = nil\n end", "def reset()\n \n end", "def reset\n end", "def reset\n end", "def clear_log\r\n\r\n file = Rails.public_path.join('bg_worker.log')\r\n FileUtils.rm file\r\n flash[:warning] = \"Cleared log file\"\r\n redirect_to :action => :list\r\n end", "def reset\n total_calls.clear\n total_success_calls.clear\n total_failed_calls.clear\n end", "def trace_log!\n Merb.logger.auto_flush = true\n end", "def reset() end", "def reset\n set_last_update_at\n end", "def clear\n Log.delete_all\n render_index\n end", "def reset_session\n # Cancels all scans if any\n @dir_scanner.cancel_all_scans\n # Delete all dirlines\n @main_widget.remove_all_dirlines\n end", "def reset\n cleanup(true)\n end", "def reset\n @attempt = 0\n end", "def set_log\n @log = Log.find(params[:id])\n @log = nil unless current_user.tasks.include?(@log.task)\n end", "def reset!\n end", "def reset!\n end", "def reset\n end", "def reset\n end", "def reset\n end", "def reset\n end", "def reset_last_failed_attempt_time\n @last_failed_attempt_time = nil\n end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset; end", "def reset!\n self.attempts = 0\n self.lock = nil\n self.error = nil\n self.run_at = Time.now.utc\n self.save\n rescue => e\n self.class.logger.warn(e) if self.class.logger\n end", "def clear_messages\n Facter::Log.clear_messages\n end", "def reset()\n end", "def delete_log\n unless UserSession.find == nil\n Log.create(user_id: UserSession.find.user.id, message: \n \"#{UserSession.find.user.name} har slettet rollen: #{self.name}\",\n logtype_id: 3)\n end\n end", "def reset_oneconnect_statistics\n super\n end", "def reset\n\n end", "def clear_session\n\n if !(params[:controller] == \"timelog_import\" && (params[:action]==\"export_csv\" || params[:action]==\"result\" ))\n session[:failed_issues] = []\n end\n\n end", "def reset!\n reconnect!\n end", "def reset\n\n end", "def update_log_logshuttle(opts = {})\n data, _status_code, _headers = update_log_logshuttle_with_http_info(opts)\n data\n end", "def reset!\n self.mode = ::Klarna::DEFAULT_MODE\n self.country = ::Klarna::DEFAULT_COUNTRY\n self.store_id = nil\n self.store_secret = nil\n self.store_pclasses = nil\n #self.store_config_file = ::Klarna::DEFAULT_STORE_CONFIG_FILE\n self.logger = ::Logger.new(::STDOUT)\n self.logging = false\n self.http_logging = false\n end", "def set_log\n @log = Log.find(log_id)\n end", "def reset\n end", "def reset\n end", "def clear_completed!\n update\n [@@logs[:todo], @@logs[:metrics]].each do |file|\n\tputs \"FILE: #{file.inspect}\"\n FileUtils.rm(file)\n FileUtils.touch(file)\n end\n @@todo.each do |line|\n add_todo(line)\n end\n end", "def reset_state\n @children = nil\n @logdev = nil\n @loglvl = nil\n end", "def reset!\n config[:since_id] = 1\n config[:since_id_reply] = 1\n end", "def reset!\n @route_map = {}\n end", "def reset\n @config = {}\n write_config\n end", "def flush\n @log.flush if @log.respond_to?(:flush)\n end", "def reset_stamper\n self.stamper = nil\n end" ]
[ "0.7399419", "0.7079062", "0.6743656", "0.6721781", "0.64943117", "0.6250224", "0.62394255", "0.62362605", "0.6232578", "0.621043", "0.6170892", "0.61264724", "0.61006695", "0.6086368", "0.60309345", "0.60214394", "0.59615815", "0.59437287", "0.5937464", "0.5870847", "0.5870847", "0.58359796", "0.58359796", "0.579707", "0.5792119", "0.57422614", "0.5718742", "0.57037103", "0.5680948", "0.5676419", "0.56497234", "0.56222045", "0.5617077", "0.561391", "0.5607267", "0.5593258", "0.55832726", "0.5533962", "0.55245364", "0.5520544", "0.54981756", "0.5495324", "0.54907405", "0.54907405", "0.5482575", "0.54637426", "0.54620755", "0.5454342", "0.54468316", "0.5445583", "0.54309005", "0.54273325", "0.54260176", "0.5418197", "0.54141086", "0.54141086", "0.5403578", "0.5403578", "0.5403578", "0.5403578", "0.5399677", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.53918177", "0.5383686", "0.53812736", "0.53790563", "0.5374457", "0.5363112", "0.5356126", "0.5354386", "0.5353547", "0.53485674", "0.5344685", "0.53366256", "0.5334733", "0.53340656", "0.53340656", "0.5324814", "0.5321577", "0.5318815", "0.53140634", "0.5314022", "0.5301897", "0.53001314" ]
0.74601626
0
Drive forward a certain distance
def drive(distance) raise ArgumentError.new("Distance must be a positive number") if distance < 0 @totalDistance += distance @travelLog += "#{@numChanges}. Drive #{distance} miles at speed #{@currSpeed}mph.\n" @numChanges += 1 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def move_by_route(forward = true)\n return unless exist_train_route?\n depart_from_station\n\n train_start_speed_kmh = 5\n train_regular_speed_kmh = 60\n\n move train_start_speed_kmh\n move train_regular_speed_kmh\n move train_start_speed_kmh\n\n arrive_to_station forward\n brake\n end", "def forward(steps)\n move(steps)\n end", "def step(distance)\n i = 0\n t = 1/(distance.to_f/@speed.to_f)\n while i < distance\n move @direction\n sleep t\n i += @speed\n end\n stop\n end", "def drive(distance_to_drive)\n @cum_distance = @cum_distance + distance_to_drive\n puts \"The #{@color} #{@model} drove #{@cum_distance} miles.\"\n end", "def move_forward\n new_location = @location + facing_direction.coordinate_component\n \n if !surface.within_bounds?(new_location)\n raise OutOfBoundaryError, \"The movement has put the robot out of boundaries\"\n end\n \n @location = new_location\n self\n end", "def forward_move\n case @facing\n when 'NORTH'\n @y += 1\n when 'SOUTH'\n @y -= 1\n when 'EAST'\n @x += 1\n when 'WEST'\n @x -= 1\n end\n self\n end", "def drive(duration: nil, distance: nil,backward: false,angle: 0)\n direction = backward ? 1 : 0\n if duration.nil? and not distance.nil?\n turn_dir = angle > 0 ? 0x0 : 0x1\n turn_angle = angle % 360\n turn_angle_high = turn_angle >> 8\n turn_angle_low = turn_angle & 0xFF\n send_command 0x70, direction, distance & 0xFF, turn_dir, turn_angle_high, turn_angle_low\n sleep(distance / 64.0)\n elsif not duration.nil? and distance.nil?\n send_command ((0x71 + direction) & 0xFF), @curr_speed, duration\n sleep(duration / 100)\n else\n raise \"must specify exactly one of either duration or distance\"\n end\n end", "def move_forward\n raise 'Это последняя станция' if @stations[@index + 1].nil?\n\n @stations[@index].departure(self)\n @index += 1\n @current_station = @stations[@index]\n @stations[@index].arrival(self)\n end", "def move_forward\r\r\n @move_poll+= [[@direction, true]] * (32.0 / CXJ::FREE_MOVEMENT::PIXELS_PER_STEP).ceil\r\r\n end", "def forward(steps)\n must_be_number(steps, 'distance')\n angle = heading * DEG\n x, y = xy\n self.xy = [x + steps * sin(angle), y + steps * cos(angle)]\n track.last << xy if pen_down?\n end", "def move_forward\n position.depart_train(self)\n @current_station += 1 if @route.stations[@current_station] != @route.stations.last\n position.add_train(self)\n end", "def drive(distance)\r\n\t\t@total_distance += distance\r\n\t\tputs \"You drove #{distance} mile#{\"s\" unless distance == 1} while going #{@speed}mph.\"\r\n\t\tputs \"You have crashed your father's #{@color} #{@model}.\" if @speed > 80\r\n\tend", "def forward\n direction(:forward)\n end", "def distance_traveled\n return 0 unless @motor == :started || @motor == :stopping\n\n last_trip_duration = (@last_tick - @motor_start_time)\n return 0 unless last_trip_duration >= 4.5\n\n m = 1 + ((last_trip_duration - 4.5) / 1.5).floor\n d = (@direction == :up ? 1 : -1)\n \n m*d\n end", "def drive(miles)\n\t\tif (@fuel - miles/20.0) >= 0\n\t\t\t@distance += miles\n\t\t\t@fuel -= miles/20.0\n\t\telse\n\t\t\t@distance += @fuel * 20.0\n\t\t\t@fuel = 0\n\t\t\tputs \"You're out of gas!\"\n\t\tend\n\tend", "def forward\n\n\t\t#Could use case statement here\n\t\t# case (@angle.abs % 360)\n\t\t# \twhen 0 then x = @x + 1\n\t\t# \tetc...\n\t\t# end\n\n\t\t#Get new x\n\t\tx = @x + Math.cos(@angle * (Math::PI / 180)).round\n\n\t\t#Get new y\n\t\ty = @y + Math.sin(@angle * (Math::PI / 180)).round\n\n\t\t# This should perhaps be tested in the command method after each command\n\t\tif !isLostPoint(x, y) and !isLost(x, y) then\n\t\t\t@x = x\n\t\t\t@y = y\n\t\tend\n\n\tend", "def move_forward(count)\n old_position = position\n\n if facing > 0 and facing < 180\n @x += count\n elsif facing > 180\n @x -= count\n end\n\n if facing > 90 and facing < 270\n @y += count\n elsif facing > 270 or facing < 90\n @y -= count\n end\n draw_line(old_position, position)\n end", "def move_forward\n self.velocity_x = Gosu::offset_x(self.angle, 0.5)*self.max_velocity_x\n self.velocity_y = Gosu::offset_y(self.angle, 0.5)*self.max_velocity_y\n end", "def move_forward\n\t\tnew_position = forward_position\n\t\t@x = new_position[0]\n\t\t@y = new_position[1]\n\tend", "def seek_forward(amount = opts[:seek_size])\n seek_by(amount)\n end", "def fast_forward(seconds)\n drive(Speed::MAX, Direction::STRAIGHT, seconds)\n stop if seconds > 0\n end", "def fast_forward_disk(time_going_forward)\n if (@dvd_time_move - time_going_forward) < @dvd.length\n @dvd_time_move = @dvd_time_move + time_going_forward\n else\n @dvd_time_move = @dvd.length\n end\n end", "def forwardDeg!(point)\r\n point.x *= Proj4::DEG_TO_RAD\r\n point.y *= Proj4::DEG_TO_RAD\r\n forward!(point)\r\n end", "def walk\n @speed = 2\n end", "def walk\n @speed = @speed + (0.2 * @legs)\n end", "def forward(steps)\n\t\t# Calculate ending coordinates\n\t\trad = @degree * Math::PI / 180\n\n\t\tnew_x = (@cursor_x + steps*Math.cos(rad)).round\n\t\tnew_y = (@cursor_y + steps*Math.sin(rad)).round\n\t\n\t\tif(@opened_eye) then\n\t\t\tdraw_points(@cursor_x, @cursor_y, new_x, new_y)\n\t\tend\n\n\t\t# Update coordinates\n\t\t@cursor_x = new_x\n\t\t@cursor_y = new_y\n\tend", "def move_forward\n case @orientation\n when :north\n @position.y_coordinate += 1\n when :east\n @position.x_coordinate += 1\n when :south\n @position.y_coordinate -= 1\n when :west\n @position.x_coordinate -= 1\n end\n end", "def move(direction)\n \n end", "def update_stepping\n FollowingMoveRoute([PBMoveRoute::StepAnimeOn])\n end", "def move_forward\n case @direction\n when 2\n move_down(false)\n when 4\n move_left(false)\n when 6\n move_right(false)\n when 8\n move_up(false)\n end\n end", "def test_forward_gk\n result = @proj_gk.forward( Proj4::Point.new( deg2rad(@lon), deg2rad(@lat) ) ) \n assert_in_delta @rw, result.x, 0.1\n assert_in_delta @hw, result.y, 0.1\n end", "def forward(steps)\n raise ArgumentError unless steps.is_a?(Numeric)\n @xy = [@xy.first + sin(@heading * DEG) * steps, @xy.last + cos(@heading * DEG) * steps]\n @track.last << @xy if @pen_is_down\n end", "def toward(pt)\n x2, y2 = pt\n must_be_number(x2, 'pt.x')\n must_be_number(y2, 'pt.y')\n x1, y1 = xy\n set_h(90.0 - atan2(y2 - y1, x2 - x1) / DEG)\n end", "def toward(pt)\n raise ArgumentError unless is_point?(pt)\n @heading = (atan2(pt.first - @xy.first, pt.last - @xy.last) / DEG) % 360\n end", "def advance(distance = 1)\n @position.x += distance\n end", "def forward(distance = 1)\n ConsoleGlitter.escape(\"#{distance}C\")\n end", "def drive(where)\n case where\n when :forward,:forwards\n @backwards_pin.set(0)\n @forwards_pin.set(1)\n when :backwards,:backward\n @forwards_pin.set(0)\n @backwards_pin.set(1)\n else\n @forwards_pin.set(0)\n @backwards_pin.set(0)\n end\n end", "def drive \n while self.current_speed < self.max_speed\n accelerate()\n end \n # and print that it hit the cars max speed \n puts \"drive method was called\"\n puts \"The current car speed is : #{self.current_speed}\"\n puts \"The car hit it max speed\" \n # The execution of drive should then also stop\n end", "def next_position\n\n # change the direction when the number of a half spin\n # has been walked. Also increase the number of steps\n # in the next turn accordingly.\n if @steps_of_half_spin == 0\n @max_steps_in_dir += 1\n @steps_of_half_spin = 2 * @max_steps_in_dir\n @move_right_or_up = !@move_right_or_up\n @steps = 0\n end\n @steps_of_half_spin -= 1\n\n if @move_right_or_up\n if @steps < @max_steps_in_dir\n @x += 1\n @steps += 1\n else\n # up\n @y += 1\n end\n Pos2.new(@x, @y)\n else\n if @steps < @max_steps_in_dir\n # left\n @x -= 1\n @steps += 1\n else\n # down\n @y -= 1\n end\n Pos2.new(@x, @y)\n end\n end", "def fast_travel(x, y=nil, ms = 5)\n $game_player.move_speed = ms\n if y\n $game_player.find_path to: [x, y]\n else\n $game_player.find_path to: x, type: :Border\n end\n end", "def drive(cmd)\n if @steer.include?(cmd)\n @orientation = @gps.turn(cmd)\n else\n move\n end\n end", "def moveForward\n case @currentDir\n when :north\n incrementY\n when :south\n decrementY\n when :east\n incrementX\n when :west\n decrementX\n end\n\n #if new current position has obstacle, move back and report it\n if @grid.obstacles.include?(@currentPos)\n puts \"Cannot move forward. Obstacle present ahead at (#{@currentPos.x}, #{@currentPos.y})\"\n moveBackward\n return false\n end\n\n true\n end", "def advance\n case bearing\n when :north\n coordinates[1] += 1\n when :east\n coordinates[0] += 1\n when :south\n coordinates[1] -= 1\n when :west\n coordinates[0] -= 1\n end\n end", "def move\n @route.stations[@index_current_station].recieve_train(self)\n @route.stations[@index_current_station - 1].send_train(self)\n end", "def move_straight(step, x)\n comp(:position).add!(x * step)\n on_move\n end", "def forwardDeg(point)\r\n forwardDeg!(point.dup)\r\n end", "def accelForward\n @vel_y -= @VELOCITY\n end", "def drift\n\t\tif @x_speed != 0\n\t\t\t@x_speed = adjust_towards_zero(@x_speed, @speed_inc_step) \t\t\n\t\t\tupdate_x(@x_speed)\n\t\t\t@has_moved = true\n\t\tend\n\t\tif @y_speed != 0\n\t\t\t@y_speed = adjust_towards_zero(@y_speed, @speed_inc_step) \n\t\t\tupdate_y(@y_speed)\n\t\t\t@has_moved = true\n\t\tend\n\tend", "def direction(dest_x,dest_y,start_x,start_y)\n \n if @battler.is_a?(Game_Actor)\n if @move_speed == 10\n return (Math.atan2((start_y - dest_y), (start_x - dest_x))+360) % 360\n else\n return (Math.atan2((dest_y - start_y), (dest_x - start_x))+360) % 360\n end\n else\n if @move_speed == 20\n return (Math.atan2((start_y - dest_y), (start_x - dest_x))+360) % 360\n else\n return (Math.atan2((dest_y - start_y), (dest_x - start_x))+360) % 360\n end\n end\n \n end", "def go_ahead(steps,width=1)\n x0 = @pos.x\n y0 = @pos.y\n x1 = (@pos.x + steps*Math.cos(@angle)).round()\n y1 = (@pos.y - steps*Math.sin(@angle)).round()\n if (@down)\n animiere(3) {\n TkcLine.new( Leinwand.gib_einzige_instanz(),x0,y0,x1,y1,:fill => :black, :width => [1,width] .max()) }\n end\n @pos = Point.new(x1,y1)\n end", "def next_facing(steps)\n current_index = DIRECTIONS.find_index(@facing)\n DIRECTIONS[(current_index + steps) % DIRECTIONS.size]\n end", "def distance_per_frame\r\n 2 ** real_move_speed / 256.0\r\n end", "def move!\n\t\tbounce! until !will_bounce? #TODO add surroundedness checking\n\t\t@x += @@target_coords[@direction][:dx]\n\t\t@y += @@target_coords[@direction][:dy]\n\tend", "def letter_direction\n just_walk_forward = sign_in_direction(direction)\n return direction unless finished?(just_walk_forward)\n crossroads_direction\n end", "def drive\n\t\[email protected] do |cmd|\n\t\t\tunless cmd == 'M'\n\t\t\t\tveer cmd\n\t\t\telse\n\t\t\t\tunless @car.toBeOverFlow?\n\t\t\t\t\tmove\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "def update(point)\n\t\t# move relative to the initial point\n\t\t\n\t\t@destination = @start + movement_delta(point)\n\tend", "def move(distance)\n self.position -= distance\n ensure_bounds\n end", "def jump(x_plus, y_plus)\n if x_plus.abs > y_plus.abs\n set_direction(x_plus < 0 ? 4 : 6) if x_plus != 0\n else\n set_direction(y_plus < 0 ? 8 : 2) if y_plus != 0\n end\n @x += x_plus\n @y += y_plus\n distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round\n @jump_peak = 10 + distance - @move_speed\n @jump_count = @jump_peak * 2\n @stop_count = 0\n straighten\n end", "def jump(x_plus, y_plus)\n # If plus value is not (0,0)\n if x_plus != 0 or y_plus != 0\n # If horizontal distnace is longer\n if x_plus.abs > y_plus.abs\n # Change direction to left or right\n x_plus < 0 ? turn_left : turn_right\n # If vertical distance is longer, or equal\n else\n # Change direction to up or down\n y_plus < 0 ? turn_up : turn_down\n end\n end\n # Calculate new coordinates\n new_x = @x + x_plus\n new_y = @y + y_plus\n # If plus value is (0,0) or jump destination is passable\n if (x_plus == 0 and y_plus == 0) or passable?(new_x, new_y, 0)\n # Straighten position\n straighten\n # Update coordinates\n @x = new_x\n @y = new_y\n # Calculate distance\n distance = Math.sqrt(x_plus * x_plus + y_plus * y_plus).round\n # Set jump count\n @jump_peak = 10 + distance - @move_speed \n @jump_peak += distance if @cool_jumps\n @jump_count = @jump_peak * 2\n # Clear stop count\n @stop_count = 0\n end\n end", "def move(time_step)\n return if !@running\n @position += @speed*time_step + 0.5*@acc*time_step*time_step\n @speed += @acc*time_step\n clip_speed\n end", "def direction\n\t\tpoint_x = end_junction.position.x - start_junction.position.x\n\t\tpoint_y = end_junction.position.y - start_junction.position.y\n\t\t[point_x / @length, point_y / @length]\n\tend", "def partial_move_to_position(sx, sy, steps, wait=false, no_through = false)\n return unless $game_map.passable?(sx,sy,0)\n route = Pathfinder.create_path(Point.new(sx, sy), self, no_through)\n\n if route.list.size > steps\n route.list.slice!(steps...-1)\n end\n\n self.force_move_route(route)\n Fiber.yield while self.move_route_forcing if wait\n end", "def ahead\n if self.route_check_true\n if @current_station != @route.stations.last\n @route.stations[@route.stations.index(@current_station)].departure(self)\n @current_station = next_station\n @route.stations[@route.stations.index(@current_station)].coming(self)\n end\n end\n end", "def new_direction(dir)\n @direction = dir unless @turned\n @turned = true\n end", "def truck(view, time)\n direction = view.camera.direction * Z_AXIS\n direction.reverse! if( (@keys & LEFT_ARROW) != 0 )\n self.move(view, time, direction, @speedx)\nend", "def move (distance, direction=nil)\n if direction\n theta = (direction.is_a?(Symbol) ? COMPASS[direction] : direction)\n else\n theta = angle\n end\n theta = theta / 180.0 * Math::PI\n x = distance * Math.cos(theta) + @x\n y = distance * Math.sin(theta) + @y\n move_to(x, y)\n end", "def move_me\n new_loc = nil\n ploc = @partner[:loc]\n dir = @partner[:dir]\n dist = @partner[:dist]\n if dist == 30\n new_dist = 16\n else\n new_dist = dist / 2\n end\n log \"Moving me. Partner data: #{@partner}\"\n new_loc = [ploc[0] - dir[0] * new_dist, ploc[1] - dir[1] * new_dist]\n log \"Move me to #{new_loc}\"\n \n goto new_loc\n return new_loc\n end", "def direction_on_path(t)\n getDirectionOnPath(view_path_coordinates[\"LonLat\"], average_speed, t)\n end", "def seek(target)\n #A vector pointing from the location to the target\n desired = PVector.sub(target, @location)\n # Scale to maximum speed\n desired.setMag(@maxspeed)\n\n # Steering = Desired minus velocity\n steer = PVector.sub(desired, @velocity)\n steer.limit(@maxforce) # Limit to maximum steering force\n apply_force(steer)\n end", "def move\n return if @fixTime || handlePossibleBreakdown\n\n old_bodyStart = @bodyStart\n @bodyStart += @nextSpeed.fps_i\n\n if self.carAhead && (self.carAhead >= self)\n @bodyStart = carAhead.bodyEnd - 1\n\n actualDistance = @bodyStart - old_bodyStart\n ratio = actualDistance / @nextSpeed.fps\n\n return if 0.5 > ratio && handlePossibleAccident\n end\n\n @nextSpeed = Velocity::Zero\n @lastSpeed = Velocity.FPS(@bodyStart - old_bodyStart)\n @distance += @lastSpeed.fps_i\n\n @bodyEnd = @bodyStart - @length\n @bodyStart\n end", "def getDirectionAndPointOnPath(view_path_coordinates, target, average_speed)\n dist = 0.0\n vpcs = view_path_coordinates\n #puts \"PoP: ***** vps = #{vpcs.inspect}\"\n last_point = vpcs.first\n ti_dist = 0\n for p2 in vpcs.drop(1) do\n if equalCoordinates?(last_point,p2)\n last_point = p2\n next\n end\n # Direction should be valid as there is a distance.\n bearing = getBearing(last_point,p2)\n direction = getGeoAngle(last_point,p2)\n if (dist < target)\n dist2 = dist + getGeoDistance(last_point,p2)\n #puts \"PoP: dist = #{dist} target = #{target} dist2 = #{dist2} target-dist = #{target-dist} last_point = #{last_point.inspect} p2= #{p2.inspect}\"\n if (target <= dist2)\n lon, lat = getDestinationPoint(last_point, target-dist, bearing)\n# ratio = (target-dist)/(dist2-dist)\n# a = getGeoAngle(last_point,p2)\n# lon = last_point[0] + Math.cos(a) * (target-dist) * (1/Math.cos(rad(last_point[1])) * LON_PER_FOOT)\n# lat = last_point[1] + Math.sin(a) * (target-dist) * LAT_PER_FOOT\n# #puts \"PoP: a = #{a} dist = #{target-dist} pop = #{[lon,lat].inspect}\"\n# # This is just integrity check. It can be eliminated.\n if !onLine(last_point,p2,60,[lon,lat])\n onLine1(last_point,p2,60,[lon,lat])\n raise \"Not on Path\"\n end\n ti_dist += getGeoDistance(last_point,[lon,lat])/average_speed\n # We have been returning the GeoAngle, which is different than a bearing. Messes up clients if not.\n # direction should be the same as getGeoAngle(last_point, p2)\n return { :distance => target, :direction => direction,\n :coord => [lon,lat], :ti_dist => ti_dist}\n end\n ti_dist += getGeoDistance(last_point,p2)/average_speed\n dist = dist2\n last_point = p2\n end\n end\n # target is past distance. Return last point, direction may be nil (all equal points)\n return { :distance => dist, :direction => direction, :coord => last_point, :ti_dist => ti_dist }\n end", "def step\n @x = @x + @vx\n @y = @y + @vy\n self\n end", "def move(distance, degree=0, velocity=200)\n distance = distance.to_i.abs #distance can never be negative\n if distance == 0 #not moving, just spinning on axis\n # time = wheelbase * PI / 360degrees * degrees / velocity ABS\n # wheelbase might be different for different roombas\n time_in_seconds = calculate_spin_time(velocity, degree)\n # now that we know how long to spin, set degree to 1 so it will spin roomba instead of put it on an arc\n degree = 1\n else\n time_in_seconds = (distance.to_f / velocity.to_f).abs\n end\n set_velocity(velocity)\n set_degree(degree)\n drive(@velocity_high, @velocity_low, @radius_high, @radius_low)\n start_moving = Time.now\n time_in_seconds = 10 if time_in_seconds > 10\n until (start_moving - Time.now).abs >= time_in_seconds\n # sensors call sleeps the script for 20ms, max read is 50ms, total time between loops about 65ms\n sensors = get_readings(:bumps_and_drops, :wall)\n @messages.push sensors\n break if sensors[:bumps_and_drops][:formatted].to_i(2) > 0\n end\n drive(0,0,0,0)\n sensors\n end", "def continuous_drive(duration_seconds: 0, spin: 0, left_spin: false,backwards: false, crazy: false)\n speed = @curr_speed + 1\n spin += 0x41\n @logger.debug \"A curr speed: #{@curr_speed} speed: #{speed}\"\n speed += 0x20 if backwards # range for backwards is 0x21->\n spin += 0x20 if left_spin\n @logger.debug \"B curr speed: #{@curr_speed} speed: #{speed}\"\n if crazy \n speed += 0x80 \n spin += 0x80\n end\n @logger.debug \"C curr speed: #{@curr_speed} speed: #{speed}\"\n time_start = Time.now\n until (Time.now - time_start) > duration_seconds\n send_command 0x78, speed & 0xFF ,spin & 0xFF\n sleep 0.01\n end\n end", "def move_straight(d, turn_ok = true)\r\n @move_succeed = passable?(@x, @y, d)\r\n if @move_succeed\r\n set_direction(d)\r\n @x = $game_map.round_x_with_direction(@x, d)\r\n @y = $game_map.round_y_with_direction(@y, d)\r\n @real_x = $game_map.x_with_direction(@x, reverse_dir(d))\r\n @real_y = $game_map.y_with_direction(@y, reverse_dir(d))\r\n increase_steps\r\n elsif turn_ok\r\n set_direction(d)\r\n check_event_trigger_touch_front\r\n end\r\n end", "def move_towards(x,y,speed)\n dx = x-@x\n dy = y-@y\n\n norm = Math.sqrt( dx*dx+dy*dy )\n\n if norm < speed || norm < 1\n self.set_pos(x,y)\n return true\n end\n\n #self.look_towards(x, y)\n self.move_pos(dx*(speed/norm),dy*(speed/norm))\n\n return false\n end", "def turn direction\n return unless placed?\n direction = case\n when direction.to_s.match(/^l(?:eft)?$/i); -1\n when direction.to_s.match(/^r(?:ight)?$/i); +1\n else; nil\n end\n # The modulus is to make sure we stay within the 0-4 array boundary\n @f = (@f + direction) % DIRECTIONS.size if direction\n report\n end", "def forward_steps\n forward = forward_dir\n steps = []\n row, col = pos\n\n step1 = [row + forward, col]\n\n unless valid_pos?(step1)\n steps << step1\n\n if at_start_rows?\n step2 = [row + forward * 2, col]\n \n steps << step2 if valid_pos?(step2)\n end\n end\n\n steps\n end", "def dolly(view, time)\n # compute the direction to move in. We want to move in the direction\n # that the camera is pointing but keeping the height constant\n direction = view.camera.direction\n direction.z = 0.0\n \n # see if we need to reverse it\n direction.reverse! if( (@keys & DOWN_ARROW) != 0 )\n\n # now move the camera\n self.move(view, time, direction, @speedy)\nend", "def walk(location, distance)\n\t\t@@distance.append(distance)\n\t\t@@location.append(location)\n\t\t@time = Time.now\n\t\texactLocations = Geocoder.search(location).first.coordinates\n\t\t@@coordinates.append(exactLocations)\n\t\t@@walks += 1\n\t\tself\n\tend", "def turn(by: 90)\n next_direction_index = DIRECTIONS.find_index(@facing) + (by / 90).to_i\n @facing = DIRECTIONS[next_direction_index % 4]\n end", "def change_direction\n if @movement_direction == @directions.fetch(\"forward\")\n @movement_direction = @directions.fetch(\"backward\")\n else\n @movement_direction = @directions.fetch(\"forward\")\n end\n end", "def turn direction, &complete_handler\n @direction = look_at direction\n sleep 0.25 / @speed\n complete_handler.call\n end", "def move(forward)\n moves = [0, forward ? 1 : -1]\n moves.reverse! if @hor\n new_coord = @coord.add(moves + moves)\n set!(new_coord[0], new_coord[1], @hor)\n end", "def move \n\n # If we've reached the end of our path, not much to do\n if @path_step >= @path.length\n return\n end\n\n # So, just set the destination to the next step on the path and let the base\n # ship movement handle it\n @dest_x = @path[@path_step][0]\n @dest_y = @path[@path_step][1]\n super\n\n # Now just check to see if we've reached the target - if so, move on to the next\n # step on the path\n if ( @x == @path[@path_step][0] ) && ( @y == @path[@path_step][1] )\n @path_step += 1\n end\n\n end", "def move\n @tail = @location\n closest_food = detect_closest_food\n @location = calculate_next_location(closest_food)\n\n end", "def move_train_forward_by_route\n if @routes.empty? || @trains.empty?\n routes_or_trains_void\n else\n request = [\"Enter train number [#{@trains.keys.join(', ')}]: \"]\n train = getting(request, :approve_train_for_assign, :select_train)\n train_moved_forward_by_route if train.move_train_forward\n end\n end", "def set_direction(d)\r\n @direction = d if !@direction_fix && d != 0\r\n @stop_count = 0\r\n end", "def jump_forward(power=1)\n jump(0, power) if @direction == 2 \n jump(- power, 0) if @direction == 4\n jump(power, 0) if @direction == 6 \n jump(0, - power) if @direction == 8 \n end", "def move\n\t\tif valid_move?\n\t\t\tputs \"\"\n\t\t\tif OS.mac?\n\t\t\t\tcmd = ('say \"roger-roger\"')\n\t\t\t\tsystem cmd\n\t\t\tend\n\t\t\tputs \"Roger, roger I\\'m moving forward one field!\"\n\t\t\tcase @robot_direction\n\t\t\twhen \"EAST\" then @x += 1\n\t\t\twhen \"WEST\" then @x -= 1\n\t\t\twhen \"NORTH\" then @y += 1\n\t\t\twhen \"SOUTH\" then @y -= 1\n\t\t\tend\n\t\telse\n puts \"This is the end of this world and I can't go further in this direction, please change direction\"\n\t\tend\n\tend", "def move\n return if next_stop.nil?\n return @destinations.shift if at_destination?\n\n if next_stop > @current_floor\n @current_floor += 1\n else\n @current_floor -= 1\n end\n\n @current_floor\n end", "def update\n accelerate(0, 1) if should_fall?\n move\n end", "def add_to_point point\n vec = as_bearing_vector\n point.destination_point vec.bearing, vec.distance.in_kms\n end", "def walk_toward_player_for(ms)\n behavior = MovementBehavior.create do\n if game_state.player.x > self.x\n move_right\n else\n move_left\n end\n end\n if @recording_behavior == :noticed\n behavior.at_end { stop_moving if not movement_states.include? :noticed }\n else\n behavior.at_end { stop_moving }\n end\n behavior.completed_after(ms)\n record_behavior(behavior)\n end", "def moving!\n end", "def distance_on_path(t)\n # for now, just average\n average_speed * t\n end", "def move_steps()\n\n # check end stops\n\n if @board.pins[@pin_min].value == 1 and @steps < 0\n @nr_steps = 0\n @pos = @min\n puts \"end stop min #{@name} reached\"\n end\n\n if @board.pins[@pin_max].value == 1 and @steps > 0\n @nr_steps = 0\n @pos = @max\n puts \"end stop max #{@name} reached\"\n end\n\n # check minimum and maximum position\n\n if (@pos <= @min and @steps < 0) or (@pos >= @max and @steps > 0)\n @nr_steps = 0\n puts \"end position reached #{@name}\"\n end\n\n # send the step pulses to the motor drivers\n\n if @nr_steps > 0\n set_pulse_on_pin(@pin_stp)\n\n @pos += 1.0 / @steps_per_unit * (@steps<=>0.0)\n @nr_steps -= 1\n\n return false\n else\n return true\n end\n\n end", "def hop!\n\t\t#loop throws die until a direction that will not bring skippy outside the boundary is found\n\t\tbegin\n\t\t\tnewpoint = @location.clone\n\t\t\tdirection = @die.throw_die\n\t\t\tcase direction\n\t\t\t\twhen :NORTH\n\t\t\t\t\tnewpoint.y = newpoint.y + 1\n\t\t\t\twhen :SOUTH\n\t\t\t\t\tnewpoint.y = newpoint.y - 1\n\t\t\t\twhen :EAST\n\t\t\t\t\tnewpoint.x = newpoint.x + 1\n\t\t\t\twhen :WEST\n\t\t\t\t\tnewpoint.x = newpoint.x - 1\n\t\t\tend\t\n\t\tend while newpoint.y > @dimension-1 || newpoint.y < 0 || newpoint.x > @dimension-1 || newpoint.x < 0\n\t\t@location = newpoint.clone\n\tend", "def move_station(next_station_index)\n @route.stations[@cur_station_index].send_train(self)\n @route.stations[next_station_index].pass_train(self)\n @cur_station_index = next_station_index\n end", "def change_direction\n @move_x = -@move_x\n @speed = -@speed\n end" ]
[ "0.68540305", "0.68006766", "0.66392756", "0.66114444", "0.65006983", "0.6486461", "0.64681435", "0.6400334", "0.6395105", "0.63660645", "0.6356904", "0.6326759", "0.6281664", "0.62072724", "0.6190248", "0.6180159", "0.6134518", "0.61256254", "0.6107313", "0.6066707", "0.6050794", "0.60489416", "0.6032226", "0.6021687", "0.6014881", "0.59661543", "0.59573513", "0.5926905", "0.58843076", "0.5882173", "0.5819991", "0.5808501", "0.57701325", "0.57549226", "0.57508355", "0.57376087", "0.573408", "0.57278234", "0.5723737", "0.5723431", "0.56934583", "0.5676344", "0.56685984", "0.56674784", "0.56652886", "0.56283456", "0.5616893", "0.5611433", "0.56082195", "0.55782765", "0.5555423", "0.5538697", "0.5536255", "0.552476", "0.5524338", "0.5523447", "0.5503002", "0.54884636", "0.5481351", "0.54775137", "0.54545146", "0.5453447", "0.54494554", "0.54446584", "0.54358274", "0.54292095", "0.54217666", "0.5420463", "0.54194105", "0.54184663", "0.5414483", "0.5406923", "0.54063326", "0.5393106", "0.53851235", "0.53846806", "0.5375875", "0.53546727", "0.5350761", "0.53479797", "0.53419316", "0.5340088", "0.5323712", "0.5318011", "0.53028417", "0.53006357", "0.528027", "0.5277832", "0.52738285", "0.5270794", "0.52704906", "0.52653265", "0.5263566", "0.52561474", "0.5242652", "0.52219415", "0.5221448", "0.521954", "0.5218099", "0.52172863" ]
0.6767001
2
Get total distance in the last trip
def getTotalDistance return @totalDistance end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def distance_calculator\n @trips.each do |trip|\n @total_distance += trip.distance.to_f\n end\n end", "def total_distance\n distances = self.rides.map { |ride| ride.distance }\n distances.inject(:+).to_f\n end", "def total_distance\n rides.reduce(0) {|total, ride| total + ride.distance}\n end", "def total_distance\n rides.reduce(0) {|total, ride| total + ride.distance}\n end", "def total_distance()\n self.rides().map() { | ride | ride.distance() }.reduce(:+)\n end", "def trip_duration(distance)\n distance/speed\n end", "def total_distance_driven\n distances = rides.map{ |ride| ride.distance }\n distances.reduce(:+)\n end", "def trip_distance(duration)\n duration * @speed\n end", "def trip_duration(distance)\n distance / @speed\n end", "def distance\n distance = 0\n @solution.each { |route| distance += route.distance }\n return distance\n end", "def total_distance\n approved_flights.sum(:distance)\n end", "def total_miles\n self.inject(0) do |accum,trip|\n accum += trip.distance_in_miles\n accum\n end\n end", "def total_distance\n @total_distance ||= intervals.inject(0) do |acc, interval|\n acc + interval.distance\n end\n end", "def get_total_time\n return RideShare.get_all_trip_durations_in_seconds(@trips)\n end", "def total_duration\n running_total = 0\n @trips.each do |trip|\n @total_driving_time += trip.duration\n end\n end", "def total_distance\n sum = 0\n previous_city = nil\n @city_names.each do |city|\n sum += @fully_connected_map.get_distance(previous_city, city) if previous_city\n previous_city = city\n end\n \n return sum\n end", "def distance_on_path(t)\n # for now, just average\n average_speed * t\n end", "def distance_traveled\n return 0 unless @motor == :started || @motor == :stopping\n\n last_trip_duration = (@last_tick - @motor_start_time)\n return 0 unless last_trip_duration >= 4.5\n\n m = 1 + ((last_trip_duration - 4.5) / 1.5).floor\n d = (@direction == :up ? 1 : -1)\n \n m*d\n end", "def total_duration\n duration = 0\n trips.each { |trip| duration += trip.duration }\n return duration\n end", "def travel_time\n travel_time = 0\n @solution.each { |route| travel_time += route.travel_time_and_cost[1] }\n return travel_time\n end", "def total_duration\n self.inject(0) do |accum,trip|\n accum += trip.duration\n accum\n end\n end", "def totalDistance\n @gasCost = @milage * @distanceTraveled\n \"You've spent $#{@gasCost} for gas so far!\"\n end", "def calcDistance \t# Calculates 'distance_from_last' i.e. distance between last location and second last location\n\t\t## Finding the current and last location\n\t\tcurrent_location = self\n\t\tif self.run.locations.length == 0 \n\t\t\tlast_location = self\n\t\telse \n\t\t\tlast_location = self.run.locations[self.run.locations.length - 1]\t\t\t\n\t\tend\n\t\t# print \"Current Location #{current_location}\" \n\n\t\tlat1 = current_location.latitude\n\t\tlong1 = current_location.longitude\n\t\tlat2 = last_location.latitude\n\t\tlong2 = last_location.longitude\n\n\t\t dtor = Math::PI/180\n\t\t r = 6378.14*1000\n\t\t \n\t\t rlat1 = lat1 * dtor \n\t\t rlong1 = long1 * dtor \n\t\t rlat2 = lat2 * dtor \n\t\t rlong2 = long2 * dtor \n\t\t \n\t\t dlon = rlong1 - rlong2\n\t\t dlat = rlat1 - rlat2\n\t\t \n\t\t a = (Math.sin(dlat/2)**2) + Math.cos(rlat1) * Math.cos(rlat2) * ((Math.sin(dlon/2)**2))\n\t\t c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))\n\t\t d = r * c\n\t\t \n\t\t return d\n\tend", "def cost_of_trip #Time cost of the trip used to calculate shortest path.\n (self.end_of_trip - self.date_of_trip).round\n end", "def total_time_spent\n return trips.sum {|trip| trip.duration}\n end", "def totalDistance\n @distanceTraveled \n @gasCost = @milage * @distanceTraveled\n @gasCost\n \"You've spent $#{@gasCost} for gas so far!\"\n end", "def totalDistance\n @distanceTraveled \n @gasCost = @milage * @distanceTraveled\n @gasCost\n \"You've spent $#{@gasCost} for gas so far!\"\n end", "def trip_time(distance, speed)\n result = (distance / speed)\n return result\nend", "def getTotalDistance\n\t\t# Get all the connections in the supply chain\n\t\tsupply_chain_connections = SupplierConnection.where(supply_chain_id: self.id)\n\t\t\n\t\t# Add up all distances\n\t\ttotal_distance = 0\n\t\tsupply_chain_connections.each do |c|\n\t\t\ttotal_distance += c.distance\n\t\tend\n\n\t\t# Return the total distance\n\t\ttotal_distance\n\tend", "def distance\n distance = 0\n (@path.size - 1).times { |i| distance += Vertex.euclidean_distance(@path[i], @path[i+1]) }\n return distance\n end", "def distance\n if valid\n route[:distance].to_i\n end\n end", "def distance\n distance = 0\n distance_2d = 0\n elev_change = 0\n num_waypoints = 0\n if @waypoints.nil? then self.load_processed_waypoints end\n ext_waypoints = self.extrapolated_waypoints()\n for waypoint in ext_waypoints do\n if waypoint.length < 3\n waypoint[2] = get_elevation(waypoint[0],waypoint[1])\n end\n end\n for i in 1..ext_waypoints.length-1\n waypointA = ext_waypoints[i-1]\n waypointB = ext_waypoints[i]\n #num_waypoints += 1 + sub_waypoints(waypointA, waypointB)\n elevation_diff = (waypointB[2]-waypointA[2])\n distance_flat = waypoint_distance(waypointA, waypointB)\n distance_3d = Math.sqrt(distance_flat**2 + elevation_diff**2)\n #pp [distance_3d, elevation_diff, distance_flat]\n distance += distance_3d\n distance_2d += distance_flat\n elev_change += elevation_diff.abs\n end\n return [distance, elev_change, distance_2d]\n \n end", "def average_flight_length\n\n sum = 0\n count = 0\n @query.get_graph.each_key do |city|\n route_dict = get_outgoing_routes(city)\n route_dict.each do |dest, dist|\n sum+=dist\n count+=1\n end\n end\n\n return sum/count\n\n end", "def total_time_spent\n\n time_spent = Trip.total_time(trips)\n\n return time_spent\n end", "def total_cost\n costs = 0\n trips.each { |trip| costs += trip.cost }\n return costs\n end", "def total_distance\n distance = 0\n self.each_edge do |source, target, edge|\n distance += get_edge_distance(edge)\n end\n distance\n end", "def travel_time\n return 0 if points.count < 2\n\n points.last.record_time - points.first.record_time\n end", "def calculateTravelTime( distance, speed )\n time = distance / speed\n\n return time.round( 2 )\nend", "def cost\n cost = 0\n @solution.each { |route| cost += route.travel_time_and_cost[0] }\n return cost\n end", "def distance\n distance_and_arc[:distance]\n end", "def distance\n distance_and_arc[:distance]\n end", "def total_spent\n total_cost = 0\n trips.each do |trip|\n total_cost += trip.cost\n end\n return total_cost\n end", "def calculate(route)\n dist = 0\n route.each_cons(2) { |points| dist = dist + points[0].distance(points[1])}\n dist\nend", "def totalDistance\n\t\ti = 0\n\t\tsum = 0\n\t\twhile i < @@walks\n\t\t\tsum += @@distance[i].to_i\n\t\t\ti += 1\n\t\tend\n\t\tputs \"Bark\"\n\t\tif @@walks == 0\n\t\t\tputs \"#{@name}'s owners don't love them. They haven't been on a walk yet :(\"\n\t\telsif @@walks == 1\n\t\t\tputs \"#{@name} has walked #{sum}kms in a single walk\"\n\t\telse\n\t\t\tputs \"#{@name} has already walked #{sum}kms in #{@@walks} walks\"\n\t\tend\n\tend", "def distance\n d = Unitwise(0, log.preferred_distance_unit.name)\n\n if workouts.present?\n d = workouts.reduce(d) { |sum, w|\n sum + w.distance\n }\n end\n\n d\n end", "def distance\n # we use memoization because calculating distance is expensive\n @distance ||= begin\n self.points.inject(nil) do |a, p|\n new_pt = p\n if a\n last_pt = Ubiquity::Point.new(a[:last_lat], a[:last_lon], {'ele' => a[:last_ele]})\n d = last_pt.to new_pt\n a[:dist] += d\n else\n a=Hash.new\n a[:dist]=0\n end\n a[:last_lat]=new_pt.lat\n a[:last_lon]=new_pt.lon\n a[:last_ele]=new_pt.elems['ele']\n a\n end[:dist]\n end\n end", "def total_idling_time\n self.inject(0) do |accum,trip|\n accum += trip.idling_time\n accum\n end\n end", "def distance(ride)\n point_pairs(ride).inject(0) do |total, pair|\n pair.first.distance = total\n pair.last.distance = total + distance_between(*pair)\n end\n end", "def travel_time_and_cost\n cost = 0\n travel_time = 0\n (@path.size - 1).times do |i|\n current_vertex = @path[i]\n next_vertex = @path[i+1]\n # travel time = travel distance\n distance = Vertex.euclidean_distance(current_vertex, next_vertex)\n travel_time += distance\n # calculate how early or how late is service\n early_cost = (next_vertex.ready_time - travel_time) > 0 ? (next_vertex.ready_time - travel_time) : 0\n late_cost = (travel_time - next_vertex.due_time) > 0 ? (travel_time - next_vertex.due_time) : 0\n # calculate penalty cost\n cost += early_cost * @penalty_coefficient + late_cost * @penalty_coefficient\n # add service_time and early_cost (wait-for-service time) to travel time\n travel_time += next_vertex.service_time + early_cost\n end\n return cost, travel_time\n end", "def count_distance(departure, arrival, sub)\n\tdeparture_line = get_station_line(sub, departure)\n\tarrival_line = get_station_line(sub, arrival)\n\n\tif departure_line.to_s == 'red_line'\n\t\tdistance_first = (get_station_no(sub, departure) - 2).abs\n\telse \n\t\tdistance_first = (get_station_no(sub, departure) - 3).abs\n\tend\n\t\n\tif arrival_line.to_s == 'red_line'\n\t\tdistance_second = (get_station_no(sub, arrival) - 2).abs\n\telse \n\t\tdistance_second = (get_station_no(sub, arrival) - 3).abs\n\tend\n\treturn distance_first + distance_second\n\nend", "def per_trip_total\n (per_ticket_cost + checked_bag_cost + per_trip_accom)\n end", "def distance\n return \"\" if @establishments.empty?\n (@establishments.first[\"Distance\"].to_f * METRES_IN_A_MILE).to_i\n end", "def trip_calc dist, miles_per_g, price_per_g, speed_mph\n gallons_used = dist / miles_per_g\n cost = gallons_used * price_per_g\n time = dist / speed_mph\n return {cost: cost.to_f.round(2), time: time.to_f.round(2)}\nend", "def distance\n return 0 if self.loc == @@current_loc\n return 0 if self.loc.nil? or @@current_loc.nil?\n haversine_distance(@@current_loc,self.loc)\n end", "def total_cost\n total_cost = 0\n trips.each do |trip|\n total_cost += trip.cost\n end\n return \"$ #{total_cost/100.round(2)}\"\n end", "def compute_total_distance(distances)\n if distances.size != 0\n distances.reduce(:+)\n else\n 0\n end\n end", "def distance\n properties['distance']\n end", "def flat_distance(ride)\n flat_point_pairs(ride).inject(0) { |total, pair| total + distance_between(*pair) }\n end", "def calculate_stations\n total=($start-$end).abs\n p \"total of stations of your trip is #{total}\"\n end", "def max_flight_distance; end", "def h_dist_total\n self.h_dist_start + self.h_dist_end\n end", "def estimate_trip_time (orbit)\n ( orbit.distance / self.update_speed(orbit).to_f + crater_delay(orbit) ).round 2\n end", "def distance_measurement; end", "def distance(start_point, end_point)\n result = prepare_url(start_point, end_point)\n return result[\"routes\"].first[\"legs\"].first[\"distance\"][\"value\"]/1000\n end", "def distance\n self.distance_from(@origin) * 1.609344\n end", "def distance\n @distance ||= mot_apres.offset - mot_avant.offset\n end", "def total_charged\n return self.trips.sum(&:cost)\n end", "def distance\n return @distance if @distance\n unless @status == 'OK'\n @distance = 0\n else\n @distance = @doc.css(\"distance value\").last.text\n end\n end", "def total_rent\n #go through each location and add the rent property together\n restaurant_rent = 0\n self.locations.inject {|total_rent, ind_rent| restaurant_rent + location.rent}\n end", "def total(carbon_or_km)\n self.trips.pluck(carbon_or_km).inject{ |sum,x| sum + x }\n end", "def last_workout_with_km_calories\n set_sport_by_user.last.try(:distance) || 0\n end", "def distance\n return nil unless @locations.size > 1\n locations.each_cons(2).reduce(0) do |acc, (loc1, loc2)|\n acc + loc1.distance_to(loc2)\n end\n end", "def compute_distance\n if exercise_rows\n exercise_rows.sort_by_part_order.inject(0) do |sum, row|\n actual_row_distance = row.compute_displayable_distance(distance).to_i\n actual_row_distance = distance if actual_row_distance == 0\n sum + actual_row_distance\n end\n else\n distance\n end\n end", "def route_length_in_miles_not_rounded\n departure_airport.distance_from(arrival_airport)\n end", "def get_total_trip_durations_in_hours\n return RideShare.get_all_trip_durations_in_seconds(trips).to_f / 60 / 60\n end", "def trip_count()\n self.trips().length()\n end", "def total_workout_with_km_calories\n set_sport_by_user.sum(:distance)\n end", "def duration\n @flights.map(&:duration).reduce(&:+)\n end", "def distance_price\n distance * price_per_km\n end", "def total_meters\n data[:total_meters]\n end", "def total_time\n @data[1]['ROUTE']['total_time']\n end", "def calculate_distance(booking_id)\n pa = PickupAddress.where(:booking_id => booking_id).last\n da = DropoffAddress.where(:booking_id => booking_id).last\n @loc_distance = Geocoder::Calculations.distance_between(pa.address, da.address, :units=> :km).round(1)\n end", "def trip_count\n return self.trips.length\n end", "def trip_count\n self.trips.length\n end", "def trip_count\n self.trips.length\n end", "def descending_distance(ride)\n descending_point_pairs(ride).inject(0) { |total, pair| total + distance_between(*pair) }\n end", "def distance_calculator(start, destination)\n #http://forrst.com/posts/Read_JSON_data_using_Ruby-13V\n url = \"http://maps.googleapis.com/maps/api/distancematrix/json?origins=#{start}&destinations=#{destination}&mode=driving&sensor=false\"\n \n buffer = open(url).read\n result = JSON.parse(buffer)\n \n duration = result[\"rows\"].first[\"elements\"].first[\"duration\"][\"value\"]\n distance = result[\"rows\"].first[\"elements\"].first[\"distance\"][\"value\"]\n return duration.to_f/60, distance.to_f/1000\nend", "def distance\n @data['distance']['value']\n end", "def trip_count\n self.trips.size\n end", "def kilometers\n self.distance\n end", "def total_time(distance, mph)\n time = distance / mph \nend", "def trip_count\n trips.length\n end", "def getTimeOnPath(view_path_coordinates, average_speed, distance)\n target = distance/average_speed # miliseconds\n end", "def trip_count\n trips.length\n end", "def trip_cost(distance, miles_per_gal, price_per_gal)\n result = (((distance.to_f / 100) * miles_per_gal) * price_per_gal) #can also do distance / 100.0 because as long as one of the numbers is a floating point it will return a decimal number\n return result\nend", "def trip_count\n trips.length\n end", "def trip_count\n trips.length\n end", "def trip_count\n trips.length\n end", "def trip_count\n trips.count\n end", "def total_rent\n rent_array = self.locations.map do |location|\n location.rent\n end\n rent_array.inject(:+)\n end" ]
[ "0.7748273", "0.7583998", "0.7574253", "0.7574253", "0.75377786", "0.73986554", "0.7331795", "0.72896045", "0.72813493", "0.7273556", "0.7194791", "0.70927024", "0.7089133", "0.70791894", "0.70554703", "0.70368886", "0.69736403", "0.6968977", "0.69570434", "0.6906272", "0.68530554", "0.6836469", "0.6752004", "0.67417145", "0.67262363", "0.6721945", "0.6721945", "0.6716517", "0.6716125", "0.6698686", "0.6688922", "0.6659497", "0.6651181", "0.6626776", "0.66120434", "0.65923464", "0.6522817", "0.6522636", "0.6510458", "0.6503991", "0.6503991", "0.6490659", "0.648365", "0.64523345", "0.64360106", "0.6414845", "0.6393003", "0.6372135", "0.63598055", "0.63557667", "0.6344743", "0.6318188", "0.6296007", "0.6293531", "0.62868637", "0.6281859", "0.6278006", "0.6263911", "0.6255041", "0.62500596", "0.6226531", "0.62216234", "0.6218947", "0.6187076", "0.6184081", "0.6148203", "0.6139397", "0.6138861", "0.6134767", "0.6114306", "0.6110533", "0.6104123", "0.6097577", "0.60956776", "0.6088676", "0.60837895", "0.6070456", "0.6064863", "0.6062813", "0.6060439", "0.6056015", "0.6053454", "0.6045952", "0.6043311", "0.6043311", "0.60428977", "0.60198003", "0.6004793", "0.60045207", "0.5985781", "0.59804857", "0.5979346", "0.59788674", "0.5977948", "0.5967133", "0.5963917", "0.5963917", "0.5963917", "0.5961153", "0.59593517" ]
0.75644654
4
add list Things to bring to fun day out
def create_list(name) path = "lists" params = { list: { name: name }} list = request(path, params, :post) list_id = list[:id] # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_list_for(day, hour, dayname, today)\n months = [_(:january), _(:february), _(:march), _(:april), _(:may), _(:june),\n _(:july), _(:august), _(:september), _(:october), _(:november), _(:december)]\n nobroad = \" #{_(:no_broadcast_on)}\"\n broad = \"#{_(:broadcast_on)}\"\n\n aday = DatesSchedule.get_day(@language, day)\n if aday.kind_of?(Array) and !aday.blank?\n d = aday[0].d\n m = aday[0].m - 1\n else\n d = 1\n m = 0\n end\n dm = \"#{d} #{months[m]}\"\n\n alist = Listing.get_day(@language, day)\n return \"<h3>#{nobroad} #{dayname}, #{dm}</h3>\" if alist.blank?\n list = \"<h3>#{broad} #{dayname}, #{dm}</h3>\"\n alist.each_with_index { |item, index|\n time = sprintf(\"<div class='time'>%02d:%02d - %s</div>\",\n item.start_time / 100,\n item.start_time % 100,\n calc_end_time(item.start_time, item.duration))\n title = item.title.gsub '[\\r\\n]', ''\n title.gsub! '<div>', ''\n title.gsub! '</div>', ''\n descr = item.descr.gsub '[\\r\\n]', ''\n descr.gsub!(/href=([^\"])(\\S+)/, 'href=\"\\1\\2\" ')\n descr.gsub!('target=_blank', 'class=\"target_blank\"')\n descr.gsub!('target=\"_blank\"', 'class=\"target_blank\"')\n descr.gsub!('&main', '&amp;main')\n descr.gsub!('<br>', '<br/>')\n descr.gsub!(/<font\\s+color\\s*=\\s*[\"\\'](\\w+)[\"\\']>/, '<span style=\"color:\\1\">')\n descr.gsub!(/<font\\s+color\\s*=\\s*[\"\\'](#[0-9A-Fa-f]+)[\"\\']>/, '<span style=\"color:\\1\">')\n descr.gsub!('</font>', '</span>')\n list += \"<div class='item#{index % 2}'>#{time}<div class='title icon-plus'>#{title}</div><div style='display:none;' class='descr'>#{descr}</div></div>\"\n }\n\n list + '<div class=\"item2\">&nbsp;</div>'\n end", "def meat_toppings()\n\tmeat_toppings = [\"bacon\", \"pepperoni\", \"sausage\", \"anchovies\"]\nend", "def add_weather day\n @weather.push day\n end", "def add_wings_and_take_off\nend", "def all_potential_meetings\n meetings = []\n day_meetings.each do |day|\n @timeline_week_count.times do |wk|\n meetings << (@beginning_of_first_week + wk.weeks).date_of_upcoming(day)\n end\n end\n meetings.sort\n end", "def list_fit_wit_workout(e)\n \"#{e.name} on #{e.date_accomplished}\"\n end", "def addDayOfWeekSpecification(time, dows)\n\t\tcurrentDow = time.wday\n\t\tnextDow = nil\n\t\tdows.each { |d|\n\t\t\tif d < currentDow\n\t\t\t\tdd = d + 7\n\t\t\telse\n\t\t\t\tdd = d\n\t\t\tend\n\t\t\tif nextDow.nil? or (dd < nextDow)\n\t\t\t\tnextDow = dd\n\t\t\tend\n\t\t}\n\t\tif nextDow\n\t\t\treturn time + (nextDow - currentDow) * 24 * 60 * 60\n\t\tend\n\t\treturn time\n\tend", "def timetables_for_select_list( timetables )\n raise TypeError, \"Input timetables should be Array!\" unless timetables.kind_of?(Array) # It is REALLY important to be array.\n\n timetables.collect do |tt|\n [ \"#{translate_day_of_week(tt.tt_day_of_week)} - #{tt.tt_number_of_lesson}й урок\",\n tt.id]\n end\n end", "def backpack_of_the_day\n output = []\n output << \"Melinda, here's your packing list!\"\n output << \"Day: #{@attributes[:day_of_week]}, Weather: #{@attributes[:weather]}\"\n output << \"\"\n\n @items.each do |item|\n output << \"- #{item}\"\n end\n output.join(\"\\n\")\n end", "def get_special_list(type)\n a = []\n\n q = if Rails.env.production?\n \"DATE_FORMAT(date, '%H:%i')\"\n else\n \"strftime('%H:%M', date)\"\n end\n\n if type == 'time'\n a = ActiveRecord::Base.connection.execute(\n \"SELECT DISTINCT #{q} AS 'time' FROM posters\"\n ).to_a\n\n a.map! {|v| v[0]}\n end\n\n i = 0\n a.map! {|v| [i+= 1, v]}\n\n a.to_h\n end", "def day_meetings\n days = []\n @course.weekdays.each_char.each_with_index do |w, i|\n days.push(DAYS_AS_SYM[i]) if w.to_i == 1\n end\n days\n end", "def calculate_week_meetings\n @week_meeting_dates.map do |week_meetings|\n week_meeting_days = week_meetings.map { |date| date.strftime('%a') }\n \"(#{week_meeting_days.join(', ')})\"\n end\n end", "def daily_thievery\r\n\t\t@inventory += (@thieves)*3\r\n\tend", "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 add_supply_to_winter_holidays(holiday_hash, supply)\n holiday_hash.collect do |season, holiday|\n if season == :winter\n holiday.collect do |name, day|\n day.push(\"Balloons\")\n end\n end\n end\nend", "def add_to_list(name, dob)\n @birthday_list[name] = str_to_date(dob)\n puts \"#{name} has been added to the list!\"\n end", "def adding_hours\n if @student_class.Mon_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Mon_fromh), format_hour_minute(@student_class.Mon_fromm), format_hour_minute(@student_class.Mon_toh), format_hour_minute(@student_class.Mon_tom), Dayweek.find_by_abbreviation(\"Mon\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end\n if @student_class.Tue_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Tue_fromh), format_hour_minute(@student_class.Tue_fromm), format_hour_minute(@student_class.Tue_toh), format_hour_minute(@student_class.Tue_tom), Dayweek.find_by_abbreviation(\"Tue\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end\n if @student_class.Wed_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Wed_fromh), format_hour_minute(@student_class.Wed_fromm), format_hour_minute(@student_class.Wed_toh), format_hour_minute(@student_class.Wed_tom), Dayweek.find_by_abbreviation(\"Wed\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end \n if @student_class.Thu_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Thu_fromh), format_hour_minute(@student_class.Thu_fromm), format_hour_minute(@student_class.Thu_toh), format_hour_minute(@student_class.Thu_tom), Dayweek.find_by_abbreviation(\"Thu\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end \n if @student_class.Fri_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Fri_fromh), format_hour_minute(@student_class.Fri_fromm), format_hour_minute(@student_class.Fri_toh), format_hour_minute(@student_class.Fri_tom), Dayweek.find_by_abbreviation(\"Fri\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end \n if @student_class.Sat_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Sat_fromh), format_hour_minute(@student_class.Sat_fromm), format_hour_minute(@student_class.Sat_toh), format_hour_minute(@student_class.Sat_tom), Dayweek.find_by_abbreviation(\"Sat\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end\n if @student_class.Sun_check == \"1\"\n @student_class_dayweek = add_minutes_hour format_hour_minute(@student_class.Sun_fromh), format_hour_minute(@student_class.Sun_fromm), format_hour_minute(@student_class.Sun_toh), format_hour_minute(@student_class.Sun_tom), Dayweek.find_by_abbreviation(\"Sun\")\n @student_class.student_class_dayweeks << @student_class_dayweek\n end \n end", "def in_words(t)\n # to get the number of minutes subtract out days\n # Then calculate hours and subtract those out to get minutes.\n s = []\n days = t.round(4).to_i\n s << \"#{ days } day(s)\" unless days == 0\n \n remainder = t - days\n minutes = remainder * 1440.0 # number of minutes in a day\n hours = (minutes / 60.0).round.to_i\n s << \"#{ hours } hours\" unless hours == 0\n \n # round to 2 decimal places and call it\n minutes = (minutes - hours * 60).round\n s << \"#{ minutes } minutes\" unless minutes == 0\n \n if s.empty?\n s << \"now\"\n else\n s << \"ago\"\n end\n \n s.join(\" \")\n end", "def wday() end", "def vegetable_toppings()\n\tvegetable_toppings = [\"mushrooms\", \"spinach\", \"broccoli\", \"pineapple\", \"peppers\"]\nend", "def setup_timetable\n # Create a hash of free times for output rendering\n @free_times = [{}, {}, {}, {}, {}, {}, {}]\n @person.free_times.each do |ft|\n ft.start_time.step(ft.end_time + (ft.end_time % Timetable::INTERVAL), Timetable::INTERVAL) do |time|\n css_class = ft.css_class.present? ? ft.css_class : 'good'\n @free_times[ft.day_of_week][time] = css_class\n end\n end\n # raise @free_times.inspect\n end", "def worktype_adhoc(begda,endda)\n teams=Team.find(:all)\n curdate = begda\n ad_hoc = []\n until curdate > endda do\n teams.each do |team|\n team_ad_hoc = team.ad_hoc_work(curdate)\n \n ad_hoc << { :month => Date::ABBR_MONTHNAMES[curdate.month], \n :team_id => team.id,\n :adhoc_tasks => team_ad_hoc[:tasks],\n :adhoc_perc => team_ad_hoc[:percentage],\n } \n \n end\n\n curdate = curdate >> 1\n end\n return ad_hoc\n end", "def add_supply_to_memorial_day(holiday_hash, supply)\n holiday_hash.collect do |season, holiday|\n holiday.collect do |name, elem|\n if name == :\"memorial_day\"\n elem.push(\"Grill\", \"Table Cloth\")\n end\n end\n end\nend", "def lunch(day)\n\nend", "def w_day; end", "def add_supply_to_winter_holidays(holiday_hash, item)\n holiday_hash[:winter].each do |holiday, decorations|\n decorations.push(item)\n end\nend", "def add_supply_to_winter_holidays(holiday_supplies, supply)\n holiday_supplies[:winter][:christmas] << supply\n holiday_supplies[:winter][:new_years] << supply\nend", "def add_supply_to_winter_holidays(holiday_hash, item)\n holiday_hash[:winter].each do |holiday, decorations|\n decorations << item\n end\nend", "def add_topping(new_topping)\n self.toppings = toppings.push(new_topping)\n puts \"You've added #{new_topping} to your burrito. Your toppings now include: #{self.toppings}.\"\n end", "def add_supply_to_memorial_day(holiday_supplies, supply)\n holiday_supplies[:spring][:memorial_day] << supply\nend", "def evening_civil_twilight\n create_time @data['evening']['twilight']['civil']\n end", "def print_day date\n @list ||= Array.read TODO\n @done ||= Array.read DONE\n @deleted ||= Array.read DELETED\n\n=begin\n YAML.load_file(RECURRENT).each do |taskstr,dates|\n if dates.include? date.wday #and [email protected]{|t| t[:scheduled] == date and t[:description] == taskstr}.empty?\n task = Task.new(taskstr.split(\" \"))\n task[:scheduled] = date.to_datetime\n @list << task if (@done+@list).select{|t| t.scheduled_at?(date) and t[:description] == task[:description]}.empty?\n end\n end\n @list.save TODO\n=end\n\n not_scheduled = (@list+@done).select{|t| t.day_dur(date) > 0.0 and !t.scheduled_at? date}\n all_stat = Stat.new not_scheduled, date, date#[@list,@done]\n done_stat = Stat.new @done, date, date\n todo_stat = Stat.new @list, date, date\n\n puts yellow(\"#{(date).strftime('%a %d %b %Y')} w#{todo_stat[:work][:planned].to_f.to_datetime}/f#{todo_stat[:not_work][:planned].to_f.to_datetime}/t#{todo_stat[:total][:planned].to_f.to_datetime}\")\n @list.each{|t| @list.print t if t[:scheduled] and t[:scheduled].to_date == date}\n\n if date == Date.today\n puts blue(\" Done: w#{done_stat[:work][:measured].to_f.to_datetime}/f#{done_stat[:not_work][:measured].to_f.to_datetime}/t#{done_stat[:total][:measured].to_f.to_datetime}\")\n @done.each do |t|\n if t[:finished] == date\n print \" \"\n @done.print t\n end\n end\n #puts cyan(\" Not scheduled: w#{all_stat[:work][:measured].to_f.to_datetime}/f#{all_stat[:not_work][:measured].to_f.to_datetime}/t#{all_stat[:total][:measured].to_f.to_datetime}\")\n @list.each do |t|\n unless t.day_dur(date) == 0.0 or t.scheduled_at? date\n print \" \"\n @list.print t\n end\n end\n @done.each do |t|\n unless t.day_dur(date) == 0.0 or t.scheduled_at? date\n print \" \"\n @done.print t\n end\n end\n end\nend", "def dueToday\n dueTodayList = \"\"\n @toDoListArray.each do |e|\n if !e.status && e.dueDate == Date.today\n dueTodayList = dueTodayList + e.printItem + \" \"\n end\n end\n dueTodayList\n end", "def evening_astronomical_twilight\n create_time @data['evening']['twilight']['astronomical']\n end", "def add_people_late\n ### Adding at 50% of finished time\n\n #projected_completion_time = ProjectBlock.tot_cyclo*0.4\n current_work = ($timeline.workdate.day)\n #print \"Current work days \", current_work, \"\\n\"\n #print \"Extimated finish time \", projected_completion_time, \"\\n\"\n if ((current_work > (99.6)) and @idle_people.length > 0) then\n @active_people << @idle_people\n @@active_people2 << @idle_people\n @@active_people2.flatten!\n @active_people.flatten!\n print \" +++++++++++++++++++++++++++++++++++++++++++++++++++\", \"\\n\"\n # print \"Current Work days \", current_work_days/8.to_f, \"\\n\"\n # print \"Adding late arrival\", $timeline.workdate.to_s, \"\\n\"\n\n #@project_manager.add_dependants(@idle_people)\n\n @idle_people = Array.new\n end\n end", "def index\n meals = json_decode(RestClient::Resource.new(BASE_URL).get({:accept => :json}).body)\n\n styled_array(meals.map do |meal|\n [(meal['today'] ? '*' : ''), day_of_week(meal['date']), meal['summary']]\n end, :sort => false)\n end", "def index\n @thursdays = Thursday.all\n end", "def list\n\t\tprintf(\"%02i.%i\\n\", @options[:monat], @options[:jahr])\n\t\[email protected](\"select betrag, gemeinsam, tags from ausgaben_#{@options[:name]} where jahr = #{@options[:jahr]} and monat = #{@options[:monat]} order by jahr, monat, gemeinsam desc\") do |row|\n\t\t\tprintf(\"(%s) %s EUR [%s] \\n\", row[1], sprintf(\"%.2f\",row[0]).rjust(7), row[2])\n\t\tend\n\tend", "def get_data_words_this_week\n words_per_day = Array.new( 7, 0 )\n \n # Get the current day of week\n dateCurrent = DateTime.now\n dayCurrent = dateCurrent.wday().to_i\n \n # Get date at the start of the week\n timeStart = Time.utc( dateCurrent.year, dateCurrent.month, dateCurrent.day )\n timeStart = timeStart - 24 * 60 * 60 * dayCurrent\n \n # Get date at the end of the week\n timeEnd = Time.utc( dateCurrent.year, dateCurrent.month, dateCurrent.day )\n timeEnd = timeEnd + 24 * 60 * 60 * ( 7 - dayCurrent )\n \n # Loop through entries and increment totals\n user_entries = Entry.find( :all, :conditions => [\"userid = #{id}\"] )\n \n user_entries.each do |entry|\n if( entry.words.nil? || entry.hours.nil? || entry.minutes.nil? )\n next \n end\n \n dayEntry = entry.starttime.wday().to_i\n timeEntry = Time.utc( entry.starttime.year, entry.starttime.month, entry.starttime.day, entry.starttime.hour, entry.starttime.min )\n \n if( timeStart.to_i <= timeEntry.to_i && timeEnd.to_i >= timeEntry.to_i )\n words_per_day[dayEntry] += entry.words\n end\n end\n \n # Assemble Data String\n data_string = \"\"\n \n (0..(words_per_day.length - 1)).each do |i|\n data_string = data_string + words_per_day[i].to_s\n if( i < words_per_day.length - 1 )\n data_string = data_string + \",\"\n end\n end\n \n return data_string\n end", "def add_bling(new_bling)\n @bling << new_bling\n puts \"The bike now has #{@bling.join(', ')} for bling.\"\n end", "def add_all(words)\n end", "def list_checker(partial_list, suggested_schedule = [], time_remaining = 8)\n partial_list.each do |meeting|\n time_remaining = time_remaining - meeting[:duration]\n\n if time_remaining < 0\n # This would be done differently in production, but I feel this is a sufficient way to end the method early for this exercise\n return [\"These meetings can't fit into one business day! Consider taking a nap.\", -1]\n else\n start_time = clock_converter(time_remaining + meeting[:duration])\n end_time = clock_converter(time_remaining)\n\n suggested_schedule << start_time + \" - \" + end_time + \" - \" + meeting[:name]\n\n time_remaining = time_remaining - 0.5 if meeting[:type] == :offsite\n end\n end\n\n return [suggested_schedule, time_remaining]\nend", "def list_wagons\n if @wagons['cargo'].empty? && @wagons['passenger'].empty?\n wagons_void\n else\n wagons_list\n end\n end", "def eats_at\n \"#{@meal_time} pm\" \n end", "def kase_type_time_and_offer_in_words(kase)\n result = []\n result << kase_type_and_time_in_words(kase)\n if kase.offers_reward?\n result << \"&nbsp;\"\n result << \"&nbsp;\"\n result << kase_price(kase)\n result << (kase.expires_at > Time.now.utc ? \"offer expires in %{time}\".t : \"offer expired %{time} ago\".t) % {\n :time => distance_of_time_in_words(Time.now.utc, kase.expires_at)\n }\n end\n table_cells_tag(*result)\n end", "def trucks_open_today\n trucks = self.class.get_truck_data\n date = self.class.get_time\n\n trucks_today = []\n trucks.each do |truck|\n if date.strftime(\"%A\") == truck[\"dayofweekstr\"]\n trucks_today << truck[\"applicant\"]\n end \n end\n p trucks_today\n end", "def all_actual_meetings\n # Exceptions are positive (Tue/Thu class meeting on Wed)\n # or negative (Tue/Thu class doesn't meet on Tue)\n positive_exceptions = exceptions_as_dates - all_potential_meetings\n all_potential_meetings - exceptions_as_dates + positive_exceptions\n end", "def evening_nautical_twilight\n create_time @data['evening']['twilight']['nautical']\n end", "def get_stories(number_of_hours)\n date_range_start = Time.now-number_of_hours.hours\n words = Word.where(\"name = ? and story_date > ?\", self, date_range_start)\n stories = []\n words.each do |w|\n stories << w.story\n end \n return stories\n end", "def thirty \n now = Date.today\n end_date = Date.today + 30\n dates = (now...end_date).to_a\n create_log(dates) \n end", "def formatAvailability(data)\n result = \"\"\n data.each do |day, time_list|\n # determine the day\n case day\n when \"1\"\n result += \"Monday: \"\n when \"2\"\n result += \"Tuesday: \"\n when \"3\"\n result += \"Wednesday: \"\n when \"4\"\n result += \"Thursday: \"\n when \"5\"\n result += \"Friday: \"\n when \"6\"\n result += \"Saturday: \"\n when \"7\"\n result += \"Sunday: \"\n end\n\n for time in time_list do\n result += \"#{format24Hour(time)} \"\n end\n end\n return result\n end", "def get_lunch_bookings_over_four(one_day_of_bookings)\n @bookings = one_day_of_bookings\n return_string = \"-\"\n find_values = [5,6,7,8,9,10,11,12]\n time_compare = @bookings.first.booking_date_time.change({ hour: 16, min: 55 })\n \n @bookings.each do |booking|\n unless booking.booking_date_time > time_compare\n if find_values.include?(booking.number_of_diners)\n return_string = return_string+booking.number_of_diners.to_s+\"-\"\n end\n end\n end\n return return_string\n end", "def select_wday(day = nil)\n day = Date.today.wday if day.nil?\n\n wday_symbol = if day.kind_of?(Integer)\n wday_symbol = case day\n when 0\n 'Su'\n when 1\n 'M'\n when 2\n 'T'\n when 3\n 'W'\n when 4\n 'R'\n when 5\n 'F'\n when 6\n 'Sa'\n end\n else\n day\n end\n\n @config['comics'].select {|c| c['update_schedule'].include?(wday_symbol)}\n end", "def fauxify!\n # cleanup the old ones\n self.delete_all\n # instantiate beginning date\n date = 13.months.ago.to_date\n # loop through the days till today\n cutoff_date = Date.parse(\"23/11/2012\")\n until date == cutoff_date\n # skip weekends\n unless (date.saturday? || date.sunday?)\n # choose a random number of entries between 3 and 25\n number_of_entries = (3..25).to_a.sample\n # create the given number of entries\n number_of_entries.times do\n hour = (9..17).to_a.sample\n minute = (0..59).to_a.sample\n # choose a random time in the day between 09:00 and 17:30 and a random happiness value\n entered_at = DateTime.parse(\"#{date} #{hour}:#{minute}\")\n # happiness_value = HappinessValue[]\n entry_date = entered_at.to_date\n entry_time = entered_at.to_time\n uid = entered_at.to_i\n happiness_entry = self.create(:uid => uid, :entry_date => entry_date, :entry_time => entry_time, :happiness_value => [1,1,1,2,3].sample) unless happiness_entry\n end\n end\n date = date + 1.day\n end\n end", "def filter_travel_board_hearing_days(tb_hearing_days)\n tb_hearing_days_formatted = TravelBoardScheduleMapper.convert_from_vacols_format(tb_hearing_days)\n\n tb_hearing_days_formatted.each do |tb_record|\n # assign non-availability days to all the travel board judges\n tb_judge_ids = [tb_record[:tbmem_1], tb_record[:tbmem_2], tb_record[:tbmem_3], tb_record[:tbmem_4]].compact\n judges = @judges.select { |_key, judge| tb_judge_ids.include?(judge[:staff_info].sattyid) }\n\n judges.each_value do |judge_staff_info|\n css_id = judge_staff_info[:staff_info].sdomainid\n\n @judges[css_id][:non_availabilities] ||= Set.new\n @judges[css_id][:non_availabilities] +=\n (TB_ADDITIONAL_NA_DAYS.business_days.before(tb_record[:start_date])..TB_ADDITIONAL_NA_DAYS.business_days\n .after(tb_record[:end_date])).reject { |date| weekend?(date) }\n end\n end\n end", "def week\n first_day_of_week = @date.monday\n \n days_of_week = []\n 7.times do |time|\n days_of_week << day_and_types(first_day_of_week + time.days)\n end \n \n days_of_week\n end", "def what_to_take(outside)\n outside.each do |today|\n if today == 'sunny'\n p \"The weather is #{today}, wear sunscreen\"\n elsif today == 'rainy'\n p \"The weather is #{today}, bring an umbrella\"\n elsif today == 'snowy'\n p \"The weather is #{today}, wear a coat\"\n elsif today == 'icy'\n p \"The weather is #{today}, bring yak traks\"\n else\n p \"The weather is perfect today, you're good to go!\"\n end\n end\nend", "def normalize_day_list(match)\n match[:days].gsub(',', '').gsub(' and', ' ').gsub(/\\s+/, ' ').split(' ')\n .map(&:capitalize)\n end", "def add_deal_to_all_mi(day, deal_name,bur_cat)\n return 'replace with create_deal_for_category'\n end", "def add_wings_and_take_off\n puts \"My name is #{@name} and I'm flying back to #{@origin}\"\n end", "def index\n @thirtyfours = Thirtyfour.all\n end", "def list_of_tmms\n super\n end", "def work_meta_list(work)\n # if we're previewing, grab the unsaved date, else take the saved first chapter date\n published_date = (@chapter && params[:preview_button]) ? @chapter.published_at : work.first_chapter.published_at\n list = [['Published:', localize(published_date)], ['Words:', work.word_count], ['Chapters:', work.chapter_total_display]]\n if work.chaptered?\n prefix = work.is_wip ? \"Updated:\" : \"Completed:\"\n list.insert(1, [prefix, localize(work.revised_at.to_date)])\n end\n '<dl>' + list.map {|l| '<dt>' + l.first + '</dt><dd>' + l.last.to_s + '</dd>'}.to_s + '</dl>'\n end", "def during(time_of_day, *extras)\n merge(during: time_of_day.array_concat(extras))\n end", "def existing_kases_list_header_in_words(kind)\n case kind\n when :idea then \"Existing Ideas in the Community\".t\n when :question then \"Existing Questions in the Community\".t\n when :problem then \"Existing Problems in the Community\".t\n when :praise then \"Existing Praise in the Community\".t\n else \"Existing Cases in the Community\".t\n end\n end", "def happy_hour\n event_display(\"It's HAPPY HOUR! Everybody let's loose.\")\n group_event_hash_creator({soft_skills: 2, wellbeing: 2})\n end", "def tenders_ultimate(start, num, day)\n\nend", "def weekdays\n wdays = []\n wdays << 0 if sun\n wdays << 1 if mon\n wdays << 2 if tue\n wdays << 3 if wed\n wdays << 4 if thu\n wdays << 5 if fri\n wdays << 6 if sat\n\n wdays\n end", "def upcoming\n unless @profile.teachings.empty?\n teach_coming = @profile.teachings.collect{|e| e if !e.open && !e.has_happened}\n end\n unless @profile.subscriptions.empty?\n learn_coming = @profile.subscriptions.collect{|s| s.event unless s.event.has_happened}\n end\n @upcoming = []\n @upcoming += teach_coming if teach_coming\n @upcoming += learn_coming if learn_coming\n respond_to do |wants|\n wants.xml { render :layout => false }\n end \n end", "def thanksgiving_break\n event_display(\"It's Thanksgiving break!\\n Go home and enjoy your time off...\\n But don't let too much knowledge leak from your brains!\")\n group_event_hash_creator({technical_skills: -2, wellbeing: 3})\n end", "def list_of_names\n World.politicians.map { |p| p.name } + World.voters.map { |p| p.name}\nend", "def calculate_week_meeting_dates\n meetings = []\n @timeline_week_count.times do |wk|\n week_start = @beginning_of_first_week + wk.weeks\n # This excludes Sunday, putting the end of the week at Saturday.\n week_end = week_start.end_of_week(:sunday)\n week_mtgs = []\n @meeting_dates.each do |meeting|\n next if (meeting < @course.timeline_start) || (@course.timeline_end < meeting)\n week_mtgs << meeting if date_is_between(meeting, week_start, week_end)\n end\n meetings.push week_mtgs\n end\n meetings\n end", "def index\n @thing_types = ThingType.all\n end", "def add_supply_to_winter_holidays(holiday_hash, supply)\n holiday_hash[:winter].each do |holiday, decorations|\n decorations << supply \n end\nend", "def scheduled_meetings\n return [] if schedule.start_with?('TBA') # sometimes there's trailing whitespace\n\n abbreviations, start_time, end_time = schedule.match(MEETING_SCHEDULE_REGEX).captures\n # For each abbreviation, create a ScheduledMeeting for that day\n abbreviations.scan(/[A-Z][a-z]?/) # MTuWThFSaSu\n .map { |day_abbreviation| ScheduledMeeting.new day_abbreviation, start_time, end_time, self }\n end", "def each_tuesday( n=1, offset=0, dur=1); each_wdays(self.Tue,n,offset,dur); end", "def add_supply_to_winter_holidays(holiday_hash,supply)\n holiday_hash[:winter][:christmas]<<supply\n holiday_hash[:winter][:new_years]<<supply\nholiday_hash\nend", "def scrape_weekend\n url = \"https://www.timeout.com/melbourne/things-to-do/things-to-do-in-melbourne-this-weekend\"\n unparsed_page = HTTParty.get(url)\n parsed_page = Nokogiri::HTML(unparsed_page.body)\n items = parsed_page.css('div.card-content')\n items.each do |activity|\n activity = {\n title: activity.css('h3.card-title').text.strip,\n description: activity.css('p').text } \n @weekend_activities << activity \n end \n end", "def add_s(words)\n words_plural = []\n words.each_index do |index|\n unless index == 1\n words_plural << words[index] + \"s\"\n end\n end\n words_plural.insert(1, words[1])\nend", "def index\n @things = current_user.things.where('the_date >= ?', Date.today ).order('the_date ASC')\n @thing_day = @things.group_by { |t| t.the_date }\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @things }\n end\n end", "def update_weekly_happiness_distributions! \n HappinessEntry.beginning_of_week_days.each do |beginning_of_week_day|\n uid = uid_for_week(beginning_of_week_day)\n end_of_week_day = beginning_of_week_day.end_of_week\n entries_for_week = HappinessEntry.in_week(beginning_of_week_day, end_of_week_day)\n update_happiness_distribution! uid, :week, entries_for_week \n end\n end", "def add_topping(new_topping)\n \t\t@toppings << new_topping\n \tend", "def insert_calendar_list(opts = {})\n end", "def meetings_on(day)\n ((@ending_meetings_by_days[day] || []) + (@starting_meetings_by_days[day] || [])).uniq.sort_by {|meeting| meeting.start_date}\n end", "def day_in_week_str\n\t\tdays = []\n\t\ttoday = Time.now\n\t\tdays.push(formatted(today))\n\t\ttoday_week_day = today.wday\n\t\tanothers = (0..6).select {|e| e != today_week_day}\n\t\tanothers.map do |e|\n\t\t\tdays.push(formatted(Time.at(today.to_i - e*day_second)))\n\t\tend\n\n\t\tdays.sort\n\tend", "def list\n specs = Array.new\n @public_holiday_specifications.each { |phs| specs << phs.to_s }\n specs\n end", "def index\n @twenties = Twenty.all\n end", "def extras_to_tryton\n\n result = []\n\n booking_extras.each do |booking_extra|\n\n extra = ::Yito::Model::Booking::BookingExtra.get(booking_extra.extra_id)\n extra_price_definition = extra.price_definition\n\n if extra_price_definition.units_management == :unitary\n if tryton_product = ::ExternalIntegration::Data.first(source_system: 'mybooking',\n source_entity: 'product',\n source_id: booking_extra.extra_id,\n destination_system: 'tryton',\n destination_entity: 'product.template')\n result << {\n \"product\" => tryton_product.destination_id.to_i,\n \"description\" => booking_extra.extra_description,\n \"gross_unit_price_w_tax\" => {\n \"__class__\" => \"Decimal\",\n \"decimal\" => \"%.2f\" % booking_extra.extra_unit_cost\n },\n \"quantity\" => booking_extra.quantity\n }\n else\n # Tryton product not found\n end \n elsif extra_price_definition.units_management == :detailed\n if self.days < extra_price_definition.units_management_value #do not apply extra days\n if tryton_product = ::ExternalIntegration::Data.first(source_system: 'mybooking',\n source_entity: 'product',\n source_id: \"#{booking_extra.extra_id}-#{self.days}\",\n destination_system: 'tryton',\n destination_entity: 'product.template') \n result << {\n \"product\" => tryton_product.destination_id.to_i,\n \"description\" => build_extra_with_days_description(booking_extra.extra_description, self.days),\n \"gross_unit_price_w_tax\" => {\n \"__class__\" => \"Decimal\",\n \"decimal\" => \"%.2f\" % booking_extra.extra_unit_cost\n },\n \"quantity\" => booking_line.quantity\n } \n else\n # Tryton product not found\n end \n else # apply extra days\n max_days = extra_price_definition.units_management_value\n max_days_price = extra_price_definition.prices.select {|item| max_days == item.units}.first.price\n if tryton_product = ::ExternalIntegration::Data.first(source_system: 'mybooking',\n source_entity: 'product',\n source_id: \"#{booking_extra.extra_id}-#{max_days}\",\n destination_system: 'tryton',\n destination_entity: 'product.template') \n result << {\n \"product\" => tryton_product.destination_id.to_i,\n \"description\" => build_extra_with_days_description(booking_extra.extra_description, max_days),\n \"gross_unit_price_w_tax\" => {\n \"__class__\" => \"Decimal\",\n \"decimal\" => \"%.2f\" % max_days_price\n },\n \"quantity\" => booking_extra.quantity\n } \n else\n # Tryton product not found \n end \n extra_days = self.days - max_days\n extra_day_price = extra_price_definition.prices.select {|item| 0 == item.units}.first.price\n if tryton_product = ::ExternalIntegration::Data.first(source_system: 'mybooking',\n source_entity: 'product',\n source_id: \"#{booking_extra.extra_id}-EXTRA\",\n destination_system: 'tryton',\n destination_entity: 'product.template')\n result << {\n \"product\" => tryton_product.destination_id.to_i,\n \"description\" => build_extra_with_extra_days_description(booking_extra.extra_description),\n \"gross_unit_price_w_tax\" => {\n \"__class__\" => \"Decimal\",\n \"decimal\" => \"%.2f\" % extra_day_price\n },\n \"quantity\" => booking_extra.quantity * extra_days\n } \n\n else\n # Tryton product not found\n end\n end \n end \n\n end\n\n return result\n\n end", "def time_entries\n get_ticket_property_list(\"time_entries\" , Unfuddled::TimeEntry)\n end", "def each_thursday( n=1, offset=0, dur=1); each_wdays(self.Thu,n,offset,dur); end", "def list_days\n puts \"This Week's Forecast:\"\n\n Scraper.scrape_cast \n\n days = Project1::Forecast.all\n days.map.with_index(1) do |day, i|\n puts \"#{i}. #{day.name}\"\n end\n end", "def combine_lists\n @combined_list = @due_date_task_list + @task_list\n end", "def current_week_tasks\n @current_week_tasks = {monday:[], tuesday:[], wednesday:[], thursday: [], friday: [], saturday:[], sunday:[]}\n end", "def day_trader(bigger_substraction)\n return [a,v]\nend", "def get_week_hash current_day\n monday_idx = current_day_id + 1 - current_day\n {monday: people.find(person_order[monday_idx]).name,\n tuesday: people.find(person_order[monday_idx + 1]).name,\n wednesday: people.find(person_order[monday_idx + 2]).name,\n thursday: people.find(person_order[monday_idx + 3]).name,\n friday: people.find(person_order[monday_idx + 4]).name}\n end", "def worktype_tracking(begda,endda)\n teams=Team.find(:all)\n curdate = begda\n wt_total = []\n until curdate > endda do\n teams.each do |team|\n wt_team_month = calculate_worktype_distribution(curdate,team.id)\n # get the total time and calculate percentages\n sum_of_times_booked = 0\n wt_team_month.keys.each do |wt|\n sum_of_times_booked += wt_team_month[wt][:daysbooked]\n end\n\n wt_team_month.keys.each do |wt|\n perc = (wt_team_month[wt][:daysbooked] / sum_of_times_booked)*100\n wt_total << { :month => Date::ABBR_MONTHNAMES[curdate.month], \n :team_id => team.id,\n :worktype_id => wt,\n :daysbooked => wt_team_month[wt][:daysbooked],\n :perc => perc} \n end\n end\n\n curdate = curdate >> 1\n end\n return wt_total\n end", "def add_supply_to_memorial_day(holiday_hash, supply)\nholiday_hash[:spring][:memorial_day] << supply\nend", "def print_dates ()\n for date in DATES\n pp \"#{date[1]} Tweets On #{date[0].strftime(\"%Y-%m-%d\")}\"\n end\nend", "def dates\n\t\t@times = { \n\t\t\t:haiti=>{\n\t\t\t\t:one_week_before=>\tTime.new(2010,01,5),\n\t\t\t\t:event\t\t\t=>\tTime.new(2010,01,12),\n\t\t\t\t:one_week_after\t=>\tTime.new(2010,01,19),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2010,02,12)\n\t\t\t},\n\n\t\t\t:philippines=>{ \n\t\t\t\t:one_week_before=>\tTime.new(2013,11,1),\n\t\t\t\t:event\t\t\t=>\tTime.new(2013,11,8),\n\t\t\t\t:one_week_after\t=>\tTime.new(2013,11,15),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2013,12,8)\n\t\t\t},\n\t\t\t:phil=>{ \n\t\t\t\t:one_week_before=>\tTime.new(2013,11,1),\n\t\t\t\t:event\t\t\t=>\tTime.new(2013,11,8),\n\t\t\t\t:one_week_after\t=>\tTime.new(2013,11,15),\n\t\t\t\t:dw_end\t\t\t=>\tTime.new(2013,12,8)\n\t\t\t}\n\t\t}\n\tend", "def add_to_list(list)\n\n end", "def add_to_list(list)\n\n end" ]
[ "0.59974456", "0.57232827", "0.5666081", "0.5531866", "0.55171186", "0.5437819", "0.54077137", "0.53978616", "0.53953034", "0.5359762", "0.5356192", "0.5349697", "0.52841043", "0.52736056", "0.5244733", "0.5213936", "0.51874477", "0.5178218", "0.5177939", "0.51646775", "0.51527005", "0.5150489", "0.51465726", "0.51372075", "0.51326126", "0.51316214", "0.5128847", "0.5126838", "0.5122297", "0.51214534", "0.5120067", "0.51136285", "0.5112529", "0.51005316", "0.50847423", "0.5078105", "0.5066846", "0.50607395", "0.505661", "0.50508815", "0.5034166", "0.50255007", "0.5003376", "0.50017667", "0.5001385", "0.49925026", "0.4990539", "0.49883455", "0.49876845", "0.49713975", "0.49677867", "0.4964525", "0.4951239", "0.4950999", "0.49445972", "0.493738", "0.49328715", "0.4932098", "0.4928129", "0.49257743", "0.49227855", "0.4911573", "0.49093306", "0.48961464", "0.4885234", "0.48827863", "0.4880813", "0.48764628", "0.48705906", "0.48673275", "0.4862188", "0.48611218", "0.48582986", "0.4858248", "0.485443", "0.4854391", "0.4853713", "0.48531476", "0.48394328", "0.4831484", "0.48269296", "0.48235196", "0.48228616", "0.48177612", "0.4810517", "0.4800036", "0.47996914", "0.47852358", "0.47839177", "0.47812468", "0.47803965", "0.47792375", "0.47780582", "0.47774297", "0.47750473", "0.47704896", "0.47676197", "0.47632694", "0.4762876", "0.47594357", "0.47594357" ]
0.0
-1
rename list 1 Bring stuff
def rename_list(list_id, name) path = "lists/#{list_id}" params = { list: { name: name }} request(path, params, :put ) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renamed(item, oldName, newName)\n end", "def rename_submenu\n\t\tputs \"Enter new list name:\"\n\t\tchoice = get_choice\n\t\t@todo_list.rename_title choice\n\t\tprint_menu\n\tend", "def rename_pets(uncustomized_pets_ordered, pets_to_update)\n counter = 1 # Because the pets are ordered by admittance date already, a counter can be used to properly number them\n uncustomized_pets_ordered.each do |pet|\n pet.name = \"#{pet.breed} #{counter}\"\n pets_to_update << pet\n counter += 1\n end\n end", "def change_file_names\n sorted_all_images_name.each do |f|\n File.rename(f, sterilize(f))\n end\n end", "def update_list_name(id, new_name)\n sql = \"UPDATE lists SET name = $1 WHERE id = $2\"\n query(sql, new_name, id)\n end", "def renumber_lists\n lists.order(\"upper(name) asc\").each_with_index do |list, ndx|\n list.update(number: ndx+1)\n end\n end", "def bulk_rename\n Destination.rename_by_prefix(params[:destination], params[:prefix])\n flash[:status] = _('Destinations_were_renamed')\n redirect_to :controller => :destination_groups, :action => :list\n end", "def renamenx(old_name, new_name); end", "def renamenx(old_name, new_name); end", "def change_names(offset)\n puts \"Changing files...\"\n Dir.foreach('.') do |item|\n next if item == '.' or item == '..' or item == 'numberFix.rb'\n fullname = modify_item(item, offset)\n File.rename(item, fullname)\n end\n puts \"Done.\"\nend", "def rename(old_name, new_name); end", "def rename(old_name, new_name); end", "def name_swap(name_to_be_altered)\n\t#STEP \t1) Breaking it into a word array\n\n\tname_arrayed = name_to_be_altered.split(' ')\n\t# STEP\t2) Doing a method that switches the first and second elements in the array\n\tname_arrayed.insert(0, name_arrayed.delete_at(1))\nend", "def change_names(map, names, target)\n names.each_with_index do |name, j|\n\t if map[name]\n\t\t\ttarget[j] = map[name]\n\t else\n\t\t\ttarget[j] = $id\n\t\t\tmap[name] = $id\n\t\t\t$id += 1\n\t end\n end\nend", "def rename!(args)\n collection_modifier_update('$rename', args)\n end", "def update_list(list_name, text)\n update_value(\"#{list_name}-list\", text)\n end", "def rename_files(format:)\n require 'pp'\n child_items.each_with_index do |child, index|\n new_name = sprintf(format, index+1)\n extname = child.path.extname\n dirname = child.path.dirname.to_s\n new_filename = dirname + \"/\" + new_name + extname\n FileManager.rename(from_file: child.path.to_s, to_file: new_filename)\n end\n end", "def onRenamed(item, oldName, newName)\n @object.renamed(import(item), import(oldName), import(newName))\n end", "def rename(event)\n @rename.each do |old, new|\n item = event.get(old)\n next if item.nil?\n event.set(new, item)\n event.remove(old)\n end\n end", "def subst_list!(nonterm, list)\n each_nonterm(nonterm) { |node| node.replace_with_before list.copy }\n end", "def bulk_name_edit # :prefetch: :norobots:\n @list_members = nil\n @new_names = nil\n if request.method == :post\n list = params[:list][:members].strip_squeeze rescue ''\n construct_approved_names(list, params[:approved_names])\n sorter = NameSorter.new\n sorter.sort_names(list)\n if sorter.only_single_names\n sorter.create_new_synonyms\n flash_notice :name_bulk_success.t\n redirect_to(:controller => 'observer', :action => 'list_rss_logs')\n else\n if sorter.new_name_strs != []\n # This error message is no longer necessary.\n flash_error \"Unrecognized names given, including: #{sorter.new_name_strs[0].inspect}\" if TESTING\n else\n # Same with this one... err, no this is not reported anywhere.\n flash_error \"Ambiguous names given, including: #{sorter.multiple_line_strs[0].inspect}\"\n end\n @list_members = sorter.all_line_strs.join(\"\\r\\n\")\n @new_names = sorter.new_name_strs.uniq.sort\n end\n end\n end", "def rename(aliases)\n new(aliases.each_with_object(entries.dup) { |(old, new), new_entries|\n new_entries[new] = new_entries.delete(old)\n })\n end", "def swap_name(name)\n name.split(' ')[1] + ', ' + name.split(' ')[0]\nend", "def rename(aliases)\n new(map { |direction| direction.rename(aliases) })\n end", "def rename(id, name = \"\")\n item = Item.find(id)\n item.class == Item ? item.update(:name => name) : item\n end", "def new_list(list_name)\n list_name = {}\nend", "def swap_names(name)\n real_names = name.downcase.split(\" \")\n real_names[0], real_names[-1] = real_names[-1], real_names[0]\n real_names.join(\" \")\nend", "def name_swap(name)\n new_name = name.downcase.split(' ')\n spy_name = new_name[1] + ' ' + new_name[0]\n vowels = 'aeioua'\n consonants = 'bcdfghjklmnpqrstvwxyzb'\n new_letter = \"\"\n spy_name.chars.each do |letter|\n if vowels.include?(letter)\n new_letter += change_vowels(letter)\n #p new_letter\n elsif consonants.include?(letter)\n new_letter += change_consonant(letter)\n #p new_letter\n else\n new_letter += letter\n end\n end\n change_name = new_letter.split(' ')\n final_name = change_name.map{|name| name.capitalize}.join(' ')\n# Add a hash to store names and alias names\n alias_names = { name: name, encrypted_name: final_name}\n alias_names.store(:name, name)\n alias_names.store(:encrypted_name, final_name)\n return alias_names\n end", "def rename_task(list_id, task_id, text)\n path = \"lists/#{list_id}/tasks/#{task_id}\"\n params = {task: {text: text}}\n request(path, params, :put)\n \n # output full list again\n show_list(list_id)\n end", "def rename(*arguments)\n dup.rename!(*arguments)\n end", "def swap_name(name)\n \"#{name.split[1]}, #{name.split[0]}\"\nend", "def swap_name(name)\n\tname.split.reverse.join(', ')\nend", "def rename(new_name, update_all_tracks)\n @ole.Rename(new_name, update_all_tracks)\n end", "def rename\n render\n end", "def swap_name(str)\n str.split(\"\\n\").map do |name|\n n = name.split(\" \")\n n[1] + \", \" + n[0]\n end.join\nend", "def rename\r\n render\r\n end", "def change_item_name(new_name:, **)\n self.name = new_name # This will generate the event!\n end", "def rename(entry, new_name, &continue_on_exists_proc); end", "def swap_name(name)\r\n name.split.reverse.join(', ')\r\nend", "def rename(name)\n url = prefix + \"rename&name=#{name}\" \n return response(url)\n end", "def swap_name(name)\r\n name.split.reverse.join(\", \")\r\nend", "def swap_name(name)\n name_array = name.split\n \"#{name_array[-1]}, #{name_array[0]}\"\nend", "def swap_names(left , right)\n left , right = left.to_s , right.to_s\n l = @names[left]\n r = @names[right]\n raise \"No such name #{left}\" unless l\n raise \"No such name #{right}\" unless r\n @names[left] = r\n @names[right] = l\n end", "def swapping_names(name)\n names = name.split('')\n names.reverse!\n names.join('')\nend", "def rename_story\n\n end", "def swap_name(full_name)\n name_array = full_name.split(\" \")\n \"#{name_array[1]}, #{name_array[0]}\"\nend", "def swap_name(strings)\n strings.split.reverse.join(', ')\nend", "def swap_name(name)\n #name_array = name.split(' ')\n #\"#{name_array[1]}, #{name_array[0]}\"\n name.split(' ').reverse.join(', ')\nend", "def rename(renames)\n operations = renames.inject({}) do |ops, (old_name, new_name)|\n ops[old_name] = new_name.to_s\n ops\n end\n view.update_many(\"$rename\" => collect_operations(operations))\n end", "def set_ListName(value)\n set_input(\"ListName\", value)\n end", "def rename(new_name)\n raise 'to be implemented in subclass'\n end", "def new_alias(full_name)\r\n\tnames = full_name.split(\" \")\r\n\tnames.reverse!\r\n\tnames.map! {|each_name| each_name.split(\"\")}\r\n\tnames.map! do |namearray|\r\n\t namearray.map! do |letter|\r\n\t if letter == \"z\"\r\n\t letter = \"a\"\r\n\t else letter.next!\r\n\t end\r\n\tend\r\n\tnames = namearray.join(\"\")\r\n\tend\r\nend", "def swap_name(full_name)\n first, last = full_name.split\n \"#{last}, #{first}\"\n\n # LS solution:\n # full_name.split.reverse.join(', ')\nend", "def swapName(full_name)\n split_name = full_name.split(' ')\n temp = split_name[1]\n split_name[1] = split_name[0]\n split_name[0] = temp\n full_name = split_name.join(' ')\nend", "def rename(name)\n url = prefix + \"rename&name=#{name}\"\n return response(url)\n end", "def replace_names!(former,nname)\n # Replace owns name if required.\n if self.name == former then\n self.set_name!(nname)\n end\n # Recurse on the interface.\n self.each_input {|input| input.replace_names!(former,nname) }\n self.each_output {|output| output.replace_names!(former,nname) }\n self.each_inout {|inout| inout.replace_names!(former,nname) }\n # Recurse on the scope.\n self.scope.replace_names!(former,nname)\n end", "def swap_name(name)\n name.split.reverse.join(', ')\nend", "def swap_name(name)\n name.split.reverse.join(', ')\nend", "def swap_name(name)\n name.split.reverse.join(', ')\nend", "def swap_name(name)\n name.split.reverse.join(', ')\nend", "def set_listname\n @listname = Listname.find(params[:id])\n end", "def rename(options={}, &block)\n map_mv(options, &block)\n end", "def replace_names!(former,nname)\n # Recurse on the block.\n self.block.replace_names!(former,nname)\n end", "def change(final_list, item, quan)\r\n p final_list[item] = quan\r\n end", "def resetLists()\n\t`rm -rf outputList.txt`\n\t`rm -rf outputListFinal.txt`\n\t`touch outputList.txt`\n\t`touch outputListFinal.txt`\nend", "def rename(_old_team, _new_team)\n # stub\n end", "def rename_item(index_no, rename)\n index_exist(index_no)? index_exist_rename(index_no, rename) : conf_message(index_no, \"does not exist\")\n end", "def replace_names_subs!(former,nname)\n self.each_statement do |stmnt|\n stmnt.replace_names!(former,nname)\n end\n end", "def change_name(name)\n\t\t# create alphabet range\n\t\tvowels = 'aeiou'\n\t\tvowel_change = vowels.split('').reverse\n\t\tconsonants = 'abcdefghijklmnopqrstuvwxyz'\n\t\tconsonant_change = consonants.delete('aeiou').split('').reverse\n\n\t\toriginal_name = name\n\t\tname_reverse = original_name.downcase.split.reverse.join('').split('')\n\n\n\t\tnew_name = name_reverse.map do |letter|\n\t\t\tif vowels.include?(letter)\n\t\t\t\tvowel_change[vowel_change.index(letter)-1]\n\t\t\telsif consonants.include?(letter)\n\t\t\t\tconsonant_change[consonant_change.index(letter)-1]\n\t\t\telse\n\t\t\t\tletter\n\t\t\tend\nend\n\nfinal_name = new_name.join.split.map { |name| name.capitalize}.join('')\nend", "def swap_name(name)\n arr = name.split\n arr[0], arr[1] = arr[1], arr[0]\n arr.join(', ')\nend", "def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend", "def rename_to_bob\n name = 'Bob'\n end", "def swap_name(name)\n name.split(' ').reverse.join(', ')\nend", "def change_name(name)\r\n\t#store new name in new variable, downcase, split in an array and reverse order\r\n\tnew_name = name.downcase.split(' ').reverse.join(' ')\r\n\t#return the array of all the letters\r\n\t#p new_name\r\n\t#puts new_name.length\r\n\t#p new_name\r\n\talias_and_real_name = []\r\n\tindex = 0\r\n\tvowel_list = \"aeiou\"\r\n\tconsonant_list = \"bcdfghjklmnpqrstvwxyz\"\r\n\twhile index < new_name.length\r\n\t\t#[index] takes and integer and retunrs char, .index takes a char\r\n\t\t#and returns integer**\r\n\t\t#Does the letter at the # index of new_name match the vowel_list string\r\n\t\tif vowel_list.include?(new_name[index])\r\n\t\t\t#next_vowel_index is a #\r\n\t\t\t#it equals the vowel string at the letter index \r\n\t\t\t#from new_name's # index\r\n\t\t\t#Then get the next number\r\n\t\t\tnext_vowel_index = vowel_list.index(new_name[index]).next\r\n\t\t\t#new_name at that index # now equal this new # \r\n\t\t\t#Equals the vowel list at index of the next #\r\n\t\t\tnew_name[index] = vowel_list[next_vowel_index]\r\n\t\t\t\t#Solve for edge cases\r\n\t\t\t\t#If the letter is the name is going to be the last letter \r\n\t\t\t\t#in the vowel string, change it automatically to \r\n\t\t\t\t#the first on\r\n\t\t\r\n\t\t\t\r\n\t\telsif consonant_list.include?(new_name[index])\r\n\t\t\tnext_consonant_index = consonant_list.index(new_name[index]).next\r\n\t\t\tnew_name[index] = consonant_list[next_consonant_index]\r\n\r\n\t\tend #End if statement\r\n\t\t#Incriment outside of if statment but inside while loop\r\n\t\tindex += 1\r\n\t\r\n\tend #End While loop\r\n\r\n\t#return the new alias name\r\n\tnew_name\r\n\t\r\n\t#Take the alias name and stoe it in an array, new name first and real \r\n\t#name second\r\n\talias_and_real_name << new_name << name\r\n\t\r\n#End method\t\t\r\nend", "def update_quantity(list, item_name, quantity)\n\tlist.each do |item, qty|\n\t\tif item === item_name\n\t\t\tlist[item] = quantity\n\t\tend\n\tend\nend", "def move_cards(list_from_name, list_to_name)\n\tfrom_list = get_list(list_from_name)\n\tto_list = get_list(list_to_name)\n\n # if from_list == nil || to_list == nil\n # p \"nil list error, check list names\"\n # return \n # end\n cards = get_cards(from_list)\n cards.each do |card|\n \tif card.badges[\"checkItems\"] == card.badges[\"checkItemsChecked\"]\n \t\tcard.move_to_list(to_list)\n \tend\n end\nend", "def prepopulate_list\n\t\tname_list = ['ben', 'bob obobb', 'mary kate', 'kim possible', 'steve-o', 'jill and jack', 'veronica mars', 'danny trejo',\n\t\t 'jon snow', 'mario anluigi', 'ed obannon', 'amy winehouse', 'juan jones', 'walter okiefe', 'fred love']\n\t\tparty_list = ['tea party', 'conservative', 'neutral', 'liberal', 'socialist']\n\t\tjimbo = Human.new \"politician\", 'jimbo jones', 'democrat'\n\t\tgene = Human.new \"politician\", 'gene wilder', 'republican'\n\t\t@people_list << jimbo\n\t\t@people_list << gene\n\n\t\tname_list.map do |name|\n\t\t\trandom_party = party_list.sample\n\t\t\tname = Human.new \"voter\", name, random_party\n\t\t\t@people_list << name\n\t\tend\n\n\tend", "def merge_script_names(previous_script_name, new_script_name); end", "def rename_file\n\n end", "def rename!(*arguments)\n Hash[*arguments.flatten].each_pair do |from,to|\n if fields.has_key?(from) && !fields.has_key?(to)\n fields[to] = fields[from]\n fields.delete(from)\n end\n end\n self\n end", "def swap_name(str)\n full_name = str.split\n \"#{full_name[1]}, #{full_name[0]}\"\nend", "def swap_name(str)\n \"#{str.split[1]}, #{str.split[0]}\"\nend", "def name_change(real_name)\r\n\tnew_name = real_name.downcase.split(' ')\r\n\tnew_name.map! { |real_name|\r\n\t\treal_name.split('').map! { |char|\r\n\t\t\tif \"aeiou\".index(char) != nil\r\n\t\t\t\tchange_char(char, \"aeiou\")\r\n\t\t\telse \r\n\t\t\t\tchange_char(char, \"bcdfghjklmnpqrstvwxyz\")\r\n\t\t\tend\r\n\t\t}\r\n\t}\r\n\tnew_first_name = new_name[1].join('')\r\n\tnew_last_name = new_name[0].join('')\r\n\treturn new_first_name.capitalize + \" \" + new_last_name.capitalize\r\nend", "def swap(first_n, last_n) \n\tnew_first_n = last_n\n\tnew_last_n = first_n\n\tnew_name = new_first_n + \" \" + new_last_n\n\nend", "def swap_names(full_name)\n names = full_name.split(\" \")\n first_name = names[0]\n last_name = names[1]\n\n return [last_name, first_name]\nend", "def swap_name(first_last)\n first, last = first_last.split\n \"#{last}, #{first}\"\nend", "def swap_name(string)\n \"#{string.split[1]}, #{string.split[0]}\"\nend", "def rename_projects!\n projects_new_names_map.each do |dxid, new_name|\n @user_api.project_update(dxid, name: new_name)\n end\n end", "def rename(name)\n url = prefix + \"rename&name=#{name}\"\n return response(url)\n end", "def rename(name)\n url = prefix + \"rename&name=#{name}\"\n return response(url)\n end", "def rename(pattern)\n from, to = pattern.sub(/^\\//, '').sub(/\\/$/, '').split '/'\n if to.nil?\n from, to = current_item.name, from\n else\n from = Regexp.new from\n end\n unless in_zip?\n selected_items.each do |item|\n name = item.name.gsub from, to\n FileUtils.mv item, current_dir.join(name) if item.name != name\n end\n else\n Zip::File.open(current_zip) do |zip|\n selected_items.each do |item|\n name = item.name.gsub from, to\n zip.rename item.name, name\n end\n end\n end\n ls\n end", "def update_list(list, item_name, quantity=1)\r\n list[item_name] = quantity\r\n list\r\nend", "def replace_names!(former,nname)\n # By default: try to replace the name recursively.\n self.each_node_deep do |node|\n if node.respond_to?(:name) && node.name == former then\n node.set_name!(nname)\n end\n end\n end", "def swap_split_name(name)\n split_name = name.split(' ')\n split_name.shuffle!\n split_name.join(' ')\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def remove_item(list, item_name)\n\tlist.delete(item_name)\n\tlist\nend", "def name_swap(real_name)\n\tnew_name = name_handler(real_name)\n puts new_name\n return new_name\nend", "def fix_names(w)\n row = 2\n changed = 0\n until (name = w[row, 2]).empty?\n fixed = fix_name(name)\n if fixed != name\n puts '%-3s: %s\\n %s' % [row, name, fixed]\n w[row, 2] = fixed\n changed += 1\n end\n row += 1\n end\n puts 'changed %s' % changed\nend", "def replace_names_subs!(former,nname)\n # puts \"replace_names_subs! for #{self} with former=#{former} and nname=#{nname}\"\n self.each_type do |type|\n type.replace_names!(former,nname)\n end\n self.each_systemT do |systemT|\n systemT.replace_names!(former,nname)\n end\n self.each_scope do |scope|\n scope.replace_names!(former,nname)\n end\n self.each_inner do |inner|\n inner.replace_names!(former,nname)\n end\n self.each_systemI do |systemI|\n systemI.replace_names!(former,nname)\n end\n self.each_connection do |connection|\n connection.replace_names!(former,nname)\n end\n self.each_behavior do |behavior|\n behavior.replace_names!(former,nname)\n end\n end" ]
[ "0.6592992", "0.6263636", "0.62197423", "0.62015516", "0.61688036", "0.61241317", "0.6103437", "0.606769", "0.606769", "0.60386324", "0.60321814", "0.60321814", "0.60057396", "0.5985535", "0.59683335", "0.5900342", "0.58735573", "0.5844665", "0.580964", "0.57396555", "0.57300043", "0.57295823", "0.57159525", "0.5705558", "0.5694594", "0.56748146", "0.56721085", "0.56702834", "0.5659129", "0.563474", "0.5613309", "0.56043977", "0.5604227", "0.5601266", "0.5598463", "0.5597453", "0.55770737", "0.55692303", "0.5566934", "0.5563588", "0.5553543", "0.5551356", "0.5551017", "0.554968", "0.5529706", "0.5528161", "0.5524961", "0.5514849", "0.55093235", "0.549948", "0.5495275", "0.5474411", "0.5473145", "0.54673046", "0.5443753", "0.54419494", "0.543678", "0.543678", "0.543678", "0.543678", "0.54345924", "0.54341686", "0.5431517", "0.54292315", "0.5427515", "0.5416619", "0.5408828", "0.5401135", "0.5397369", "0.5393443", "0.5380504", "0.53768396", "0.53623873", "0.53593326", "0.5354014", "0.53427875", "0.533588", "0.5334513", "0.5332412", "0.5327763", "0.53275824", "0.53254026", "0.5321328", "0.53130877", "0.53061634", "0.530544", "0.5295605", "0.52859074", "0.5280325", "0.5280325", "0.52802753", "0.5276236", "0.52733004", "0.5267386", "0.5266702", "0.5266702", "0.5266702", "0.5263905", "0.5263761", "0.5260084" ]
0.71933025
0
TASK add list 1 task Buy some milk
def create_task(list_id, text) path = "lists/#{list_id}/tasks" params = {task: {text: text}} request(path, params, :post) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_to_my_list(task)\n @my_list << task\n end", "def add(task)\n @list << task\n end", "def add_an_item\n item = Item.new\n item.description = \"Task number #{to_do_list.size+1}\"\n to_do_list << item\n end", "def backend_addTask(param) \n @Tasks.push(param) \n end", "def add task\n\t\t\t@count+=1\n\t\t\t@tasks[@count] = task\n\t\t\tputs \"Added task #{task}.\"\n\t\t\tupdate\n\t\tend", "def add_tasks(tasklist)\n tasklist.each{ |task| new_task(task)}\n end", "def add_task\r\n\r\n task = task_info(params[:id], true)\r\n dup = BgWorker.first(:conditions => {:name => task[:fullname], :no_duplicate => true})\r\n res = BgWorker.run_task(task, 3) unless dup\r\n if res.nil?\r\n flash[:error] = _(\"Task could not be added to job list!\")\r\n else\r\n flash[:notice] = _(\"Task added to job list.\")\r\n end\r\n redirect_to(:action => :list) and return\r\n end", "def add_task\n\n new_description_prompt_print\n\n increment_task_id_counter\n\n new_text = gets.chomp\n\n @tasks[@id_counter] = create_task(new_text)\n\n end", "def add task\n @tasks << task\n end", "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 add_task(task)\n @task_list << task\n @combined_list = @due_date_task_list + @task_list\n end", "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)\n @all_tasks << task\n end", "def add_todo\n puts\n desc = description('Todo description (required):')\n return if desc.nil?\n due = due_date\n priority = item_priority\n @list.add('todo',desc, { due: due, priority: priority})\n puts\n end", "def add_tasks(list_of_hash_tasks, *args)\n list_of_hash_tasks = [list_of_hash_tasks,] if list_of_hash_tasks.is_a Hash\n raise ArgumentError, 'Only 50 tasks may be added in a single call' if list_of_hash_tasks.length > 50\n list_of_hash_tasks.each do |task|\n raise ArgumentError, 'A title must be specified when a task is added' if unless task.has_key? :title or task.has_key 'title'\n end\n add('tasks', Babar::Task, list_of_hash_tasks, 'tasks', false)\n end\n\n #Edit a single task through the Toodledo API, using the values specified in the Hash\n #\n\n def edit_task(hash_task, *args)\n edit_tasks([hash_task,], *args)\n end\n\n #Edit a list of up to 50 Task objects through the Toodledo API, using the values specified in the list of Hash objects\n #\n\n def edit_tasks(list_of_hash_tasks, *args)\n list_of_hash_tasks = [list_of_hash_tasks,] if list_of_hash_tasks.is_a Hash\n list_of_hash_tasks.each do |task|\n raise ArgumentError, 'An id must be specified when a task is edited' if unless task.has_key? :id or task.has_key 'id'\n end\n edit(\"tasks\", Babar::Task, list_of_hash_tasks, 'tasks', false, *args)\n end\n\n \n #Given a list of Task ids, delete all the corresponding tasks from the Toodledo API \n def delete_tasks(list_of_task_ids, *args)\n #TODO modify this to accept Task objects as well\n #TODO check that this will work because array is of IDs, not hashes\n modify(endpoint, 'delete', desired_class, array_of_hashes, array_field_name, delete_first_result, *args)\n end\n\n\n #Implement add/edit/delete methods for each of the following Toodledo User-defined lists: Context, Folder, Goal, Location\n %w(context folder goal location).each do |list|\n current_class = Babar::const_get(list.capitalize)\n define_method(\"get_#{list}s\") { get(\"#{list}s\", param_map = {}, desired_class = current_class, delete_first_result = false) }\n %w(add edit delete).each do |mod_endp|\n #Hash_goal is a Hash representation of the (desired) list AFTER it is added/edited/deleted\n #TODO in the case of deletion, make sure an ID suffices\n define_method(\"#{mod_endp}_#{list}\") { |hash_goal| modify_single( endpoint = \"#{list}s\", action = mod_endp, param_map = hash_goal, desired_class = current_class, delete_first_result = false)}\n end\n end\n\n end\n\nend", "def new_tasks_pending tasks\n tasks ||= []\n self.task_ids += tasks\n\n # Salva a instancia apos adicionar as novas task's\n self.save\n end", "def add_task(task)\n\t\t@tasks << task\n\tend", "def add(task)\n @tasks << task\n end", "def createTask(description) \n task = Task.new\n task.Description = description\n @Tasks.push task\n end", "def add list\n list_action list, \"add\"\n end", "def add(*t)\n t.flatten.each do |task|\n unless @tasks.include? task\n @tasks << task\n else\n task.commit_collection.each do |c|\n @tasks[@tasks.index(task)].commit_collection.add(c)\n end\n end\n end\n end", "def create\n @task = @list.tasks.build(task_params)\n @task.user = current_user\n @task.save\n redirect_to list_url(@list)\n end", "def add(tasks)\n tasks.each do |task|\n iter = @model.append()\n self.set(iter, task)\n end\n @tasks += tasks\n end", "def update(list, item, qty)\n add_item(list, item, qty)\nend", "def add_item(list, item, quantity=1)\r\n# input: item name and optional quantity\r\n# steps: \r\n # Use shopping list as input\r\n # Use the item to be added as 2nd input\r\n # Use the item quantity as a 3rd input (look up whether optional input is possible)\r\n # Add the item and quantity to the shopping list\r\n list[item] = quantity\r\n# output: shopping list with the added item and quantity\r\n printlist(list)\r\nend", "def task_params\n params.require(:task).permit(:name, :description, :list_id)\n end", "def description\n \"This task hits the Corpwatch API and creates an entity for all found entities.\"\nend", "def add_item(list, item, quantity = 1)\r\n# input: list, item name, and optional quantity\r\n# steps: \r\n # check for optional quantity. if not present, set to default (1)\r\n list[item] = quantity\r\n # update list with input\r\n puts \"#{item.upcase} has been added to your grocery list!\"\r\n p list\r\n# output: complete list, updated\r\nend", "def add_to_list(list,item,quantity)\n\tupdate_item(list,item,quantity)\nend", "def setupTasksList\n require 'tmpdir'\n lTasksFileName = \"#{Dir.tmpdir}/WEACE_Tasks_#{Thread.current.object_id}.lst\"\n File.open(lTasksFileName, 'w') do |oFile|\n oFile << 'TaskID 1\nTaskID 2\nTaskID 3'\n end\n yield(lTasksFileName)\n File.unlink(lTasksFileName)\n end", "def add(task) # Add task method\n unless task.to_s.chomp.empty? # Checks to see if array is empty\n all_tasks << task # Adds/Pushes a task to the all tasks array\n end # End of unless expression\n end", "def create\n tasks = Task.count + 1\n @task = Task.new(params[:task])\n @task.order = tasks\n respond_to do |format|\n if @task.save\n format.html { redirect_to_index('Task was successfully created', 1) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "def addTask(sourceDescription, sourceURL, context, taskText)\n\t\n\t\tapplication=Appscript.app(self.getApplicationName())\n\t\n\t\t#Applescript dictionary defines this list as \"default list\", rbappscript uses an underscore to replace spaces in situations like this.\n\t\tapplication.default_list.make(:new => :reminder, :with_properties => {\n\t\t\t:name => \"#{sourceDescription} #{sourceURL} #{context}\",\n\t\t\t:body => \"#{taskText}\",\n\t\t})\n\tend", "def add_task(task_name)\n unless File.exist? \"app/scheduled_jobs/#{task_name}.rb\"\n raise \"Task #{task_name} does not exist!\"\n end\n url = \"http://localhost:#{server_port}/tasks/#{task_name}\"\n command \"/usr/bin/curl #{url} -X POST\"\nend", "def add\n\t\tputs \"\\nEnter the name of the item you would like to add:\"\n\t\tnew_item = gets.chomp\n\t\tputs \"\\nHow many #{new_item} would you like?\"\n\t\tnew_qty = gets.chomp\n\t\t@grocery_list.add(new_item, new_qty)\n\t\tputs \"\\nAdding #{new_item} to list...\"\n\t\tputs \"#{new_qty} #{new_item} were added to your Grocery List!\"\n\tend", "def new\n @list = List.new\n 1.times { @list.tasks.build }\n respond_with(@list)\n end", "def add1\n bp = bpn\n bp.add_list_item('Apollo13',actors,hanks)\nend", "def CreateTasksForDefect (aDefect, tasks)\n\n\trally = RallyRestAPI.new(:base_url => @base_url, :username => @user_name, :password => @password)\n\n query_result = rally.find(:defect) {equal :formatted_i_d, aDefect}\n\n defect = query_result.results.first\n\n tasks.each { |task|\n\n fields = {\n :work_product => defect,\n :name => task,\n :state => \"Defined\",\n :estimate => 1,\n :to_do => 1\n }\n\n rally.create(:task, fields)\n\n print aDefect + \":\" + task + \" - OK\\n\"\n }\nend", "def task\n end", "def add_item(item,amount=1,the_lists)\r\n\t# steps: accept 2 arguments. Item name and Quantity (with default)\r\n\tif the_lists[item] != nil\r\n\t puts \"Item is already on the List !\"\r\n\t puts \"Added amount to the quantity\"\r\n\t the_lists[item] += amount\r\n\telse\r\n the_lists[item] = amount\r\n\tend\r\n\r\n\tprint_list(the_lists)\r\nend", "def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend", "def add_task(task)\n @tasks << task\n end", "def create_todo_item(name, list_id)\n data = {\n item: {\n name: name\n }\n }\n rest(\"post\", \"lists/#{list_id}/items\", data)\n end", "def task_params\n params.require(:task).permit(:title, :content, :completed, :date_completed, :list_id, \n list:[:name, :id, :user_id, :privacy, :description, :status])\n end", "def description\n \"This task hits the Corpwatch API and creates an object for all found entities.\"\nend", "def create_list(project_id, list)\n record \"/projects/#{project_id}/todos/create_list\", list\n end", "def set_task\n @task = Task.includes(:todo).find(params[:id])\n @todo = @task.todo\n @list = @todo.list\n end", "def run_shopping_list\n\tputs \"Here's your list so far:\"\n\tputs\n\tputs format_list(@shopping_list)\n\tputs\n\titem = request_item\n\twhile item != \"\"\n\t\ttry_add_item(item)\n\t\titem = request_item\n\tend\nend", "def add(todo)\n @items << Item.new(todo)\n save\n @items.last\n end", "def create\n @task_list = TaskList.find(params[:task_list_id])\n @task = Task.new({ :attributes => params[:task], :task_list => @task_list }) \n \n respond_to do |format|\n if @task.valid? && @task_list.tasks << @task \n add_to_top = params[:task][:add_to_top_of_list] == \"1\" ? true : false\n if add_to_top\n @task.move_to_top\n else\n @task.move_to_bottom\n end\n @task_list.reload\n \n format.html { redirect_to(@task_list, :notice => \"task successfully added to the #{add_to_top ? 'top' : 'bottom'} of the list\") }\n format.xml { render :xml => @task, :status => :created, :location => @task }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @task.errors, :status => :unprocessable_entity }\n end\n end\n end", "def task(name, &block)\n task = Wodan::Task.new(name)\n yield(task)\n wodan.tasks << task\n end", "def add(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def schedule_loan_tasks(order)\n comment = \"system note - Made payment on #{order.created_at}\"\n msg = \"Call #{customer.full_name} about there payment.\"\n new_date = self.due_date.next_month\n tasks.each do |t|\n t.mark_completed_and_msg(order.user_id, comment)\n end\n self.update_attribute(:due_date, new_date)\n Task.create!(:user_id => user_id, :assigned_to => user_id, :name => msg, :asset_id => self.id, :asset_type => self.class, :company_id => company_id, :category => \"call\", :due_at => new_date - 2.days)\n end", "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(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity = 1)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(item, quant=0)\n\t$grocery_list.store(item, quant)\n\tp \"You added #{item} to your list.\"\nend", "def createItemOfList\n results1 = checkUser(params[:target_account]) #userid user to give the money\n if results1.code == 200\n parameters={user_id: (@current_user[\"id\"]).to_i, description: (params[:description]), date_pay: params[:date_pay], cost: params[:cost], target_account: params[:target_account], state_pay:params[:state_pay]}\n options = {\n :body => parameters.to_json,\n :headers => {\n 'Content-Type' => 'application/json'\n }\n }\n results = HTTParty.post(\"http://192.168.99.101:4055/lists\", options)\n if results.code == 201\n head 201\n else\n render json: results.parsed_response, status: results.code\n end\n elsif results1.code == 404\n renderError(\"Not Found\", 404, \"The resource does not exist\")\n end\n end", "def add(task_name, group, date)\n group = @default_group unless @default_group.nil? || group != ''\n date = @default_date unless @default_date.nil? || date != ''\n add_group_array(group)\n task = Task.new(next_id, task_name, group, date)\n @to_dos.add(task)\n end", "def create\n @task = @list.tasks.build(task_params)\n\n if @task.save\n return render_success_task_created\n else\n return render_error_save @task\n end\n end", "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 add(task)\n\t\tbegin\n\t\t\t@all_tasks << task\n\t\trescue=>detail\n\t\t\tputs detail.backtrace.join(\"\\n\")\n\t\tend\n\tend", "def add_task(hash_task, *args)\n add_tasks([hash_task,], *args)\n end", "def add_task(t)\n @progress.update do |progress|\n t.id = @task.size\n @task << t\n progress.add_task\n end\n return\n end", "def add(*tasks)\n tasks.flatten.each do |task|\n enqueue_task(task)\n end\n end", "def task_params\n params.require(:task).permit(:name, :offer_id, :task_type_id, :on_switch, :quota, :no_products)\n end", "def extra_pubish_tasks(p)\n \n end", "def task_params\n params.require(:task).permit(:spree_products_id,:quantity, :merchant, :notified, :sent, :recieved)\n end", "def add_item_to_list(grocery_list, grocery_item, quantity = 1)\n grocery_list.store(grocery_item,quantity)\n puts \"I've added #{grocery_item} to the list. Please pick up #{quantity} of these.\"\nend", "def create_subtasks(card)\n #if card.checklists\n # task_item = Cards.get_first_unchecked_item(card.checklists.first.check_items) \n #end \n end", "def set_task_list\n @task_list = Task::List.find(params[:id])\n end", "def new_task(task)\n @greeting = \"Hi\"\n @id = task.id\n\n mail to: task.email\n end", "def add_item(list, name, quantity = 1) \r\n# input: item name and optional quantity\r\n# steps: \r\n# create add method with name and optional quantity arguments\r\n# add name and quantity to hash\r\n list[name] = quantity\r\n# output: print \"your item has been added to the hash\"\r\n return list\r\nend", "def create(name:)\n attributes = client.create_list(name: name)\n\n Todoable::List.new(attributes)\n end", "def task name, options={}, &block\n task = Task.new name, options, &block\n TodoRunner.registry[name] = task\n end", "def add_item(list,name,value)\n list = List.find(list)\n list.add(Item.new(name,value))\n say_set list.name, name, value\n end", "def load_special_tasks\n $bot[:tasks][:list] = {\n block: -> do\n list_tasks\n end,\n desc: 'List all available tasks'\n }\n end", "def add_items(list, item_name, quantity=0)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "def add_units(qty)\n qty.to_i.times do\n #create item\n item = supply_items.new\n item.status = SupplyItem::STATUS_AVAILABLE\n item.save\n end\n end", "def task_params\n params.require(:task).permit(:name, :completed, :due_date, :list_id)\n end", "def doit\n puts \"\\nadd user to ALL workflows\"\n netid = ask('Netid ? ')\n\n p = DEPerson.find(netid)\n\n if !p\n puts \"no such account #{netid}\"\n else\n DSpace.login DConstants::LOGIN\n create_tasks p\n if 'Y' == ask('Commit changes: Yes or No (Y/N) ')\n DSpace.commit\n else\n DSpace.context_renew\n end\n end\n doit\nend", "def set_task_list\n @task_list = TaskList.find(params[:id])\n end", "def task(name, &block)\n name = name.to_s\n\n unless task = @tasks.find{|t| t.name == name}\n task = Salticid::Task.new(name, :salticid => self)\n @tasks << task\n end\n \n if block_given?\n task.block = block\n end\n\n task \n end", "def create_list(list_name,list_of_items)\n # create empty array\n list_name = []\n # for each item in string, use add item method to add item to grocery list (set default quantity to 1)\n shopping_items = list_of_items.split(' ')\n shopping_items.each do |thing_to_add|\n add_item_to_list(list_name,thing_to_add,1)\n end\n # print the list to the console\n print_list(list_name)\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def add_item(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "def create_task\n task = Task.create!(\n description: 'Test Task'\n )\nend", "def add_items!(items)\n add_items_to_queue!(:todo, items)\n end", "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend", "def add_item(list,item_name, qty)\n list[item_name] = qty\nend", "def listitem_params\n params.require(:listitem).permit(:task, :todolist_id)\n end", "def edit_tasks(list_of_hash_tasks, *args)\n list_of_hash_tasks = [list_of_hash_tasks,] if list_of_hash_tasks.is_a Hash\n list_of_hash_tasks.each do |task|\n raise ArgumentError, 'An id must be specified when a task is edited' if unless task.has_key? :id or task.has_key 'id'\n end\n edit(\"tasks\", Babar::Task, list_of_hash_tasks, 'tasks', false, *args)\n end\n\n \n #Given a list of Task ids, delete all the corresponding tasks from the Toodledo API \n def delete_tasks(list_of_task_ids, *args)\n #TODO modify this to accept Task objects as well\n #TODO check that this will work because array is of IDs, not hashes\n modify(endpoint, 'delete', desired_class, array_of_hashes, array_field_name, delete_first_result, *args)\n end\n\n\n #Implement add/edit/delete methods for each of the following Toodledo User-defined lists: Context, Folder, Goal, Location\n %w(context folder goal location).each do |list|\n current_class = Babar::const_get(list.capitalize)\n define_method(\"get_#{list}s\") { get(\"#{list}s\", param_map = {}, desired_class = current_class, delete_first_result = false) }\n %w(add edit delete).each do |mod_endp|\n #Hash_goal is a Hash representation of the (desired) list AFTER it is added/edited/deleted\n #TODO in the case of deletion, make sure an ID suffices\n define_method(\"#{mod_endp}_#{list}\") { |hash_goal| modify_single( endpoint = \"#{list}s\", action = mod_endp, param_map = hash_goal, desired_class = current_class, delete_first_result = false)}\n end\n end\n\n end", "def add_list(item_name, item_list, quantity = 1)\n item_list[item_name] = quantity\nend", "def task_params\n params.require(:task).permit(:name, :list_id, :tag, :isStarred, :isDone, :isArchived)\n end", "def call(_obj, args, _ctx)\n Task.create!(\n name: args[:name],\n description: args[:description]\n )\n end", "def tasks(project_id)\n account = Config.details \n c = FreshBooks::Client.new(account[\"account\"], account[\"token\"])\n c.task.list :project_id => project_id\n end", "def plan(tasks)\n\t\t\ttasks.each do |day,task|\n\t\t\t puts \"#{day}, we must complete the #{task}\"\n\t\t\tend\n\t\t\tputs \"I'm the Boss! No one must do anything without my knowledge!\"\n\t\tend", "def task_params\n params.require(:task).permit(:title, :description, :list_id, :list_title)\n end", "def create_pirate_tasks\r\n phunts = PirateHunt.where(hunt: hunt).to_a\r\n phunts.each do |phunt|\r\n PirateTask.create(user: phunt.user, hunt: self.hunt, task: self, pirate_hunt: phunt, answer_uploaded: false, completed: false)\r\n end\r\n end" ]
[ "0.66103536", "0.6558703", "0.6495973", "0.6470691", "0.64175904", "0.6337446", "0.6209851", "0.62046725", "0.615628", "0.60582346", "0.605705", "0.605568", "0.60356414", "0.5991172", "0.5953119", "0.59485656", "0.59061915", "0.5891833", "0.58779305", "0.58248794", "0.5820802", "0.58192825", "0.5779799", "0.57571495", "0.57529104", "0.57466465", "0.57260484", "0.57210064", "0.57207173", "0.5716144", "0.5714636", "0.57109463", "0.57100034", "0.5708099", "0.5707676", "0.57026654", "0.5699928", "0.5695795", "0.5685614", "0.56822747", "0.5681512", "0.5681335", "0.5677485", "0.5655317", "0.56543887", "0.56532943", "0.56517875", "0.56489086", "0.5648204", "0.5647219", "0.5639919", "0.56224215", "0.5614216", "0.5612238", "0.5609021", "0.5609021", "0.56077456", "0.5605664", "0.5600619", "0.55947083", "0.55933183", "0.5590967", "0.55851716", "0.558441", "0.55826265", "0.5568977", "0.5567138", "0.55502295", "0.55408454", "0.5527985", "0.5525979", "0.5525207", "0.55215514", "0.5521516", "0.5518349", "0.5517206", "0.5509418", "0.55054325", "0.55012757", "0.5501052", "0.5492177", "0.5489315", "0.5488819", "0.54863834", "0.5485756", "0.54819584", "0.54819584", "0.54783374", "0.5474193", "0.546725", "0.54634446", "0.54605234", "0.54522145", "0.5449815", "0.5449772", "0.5448254", "0.5446905", "0.54370034", "0.54341966", "0.54306954" ]
0.59316725
16
rename list 1 task 1 Buy some apples
def rename_task(list_id, task_id, text) path = "lists/#{list_id}/tasks/#{task_id}" params = {task: {text: text}} request(path, params, :put) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def renamed(item, oldName, newName)\n end", "def rename_pets(uncustomized_pets_ordered, pets_to_update)\n counter = 1 # Because the pets are ordered by admittance date already, a counter can be used to properly number them\n uncustomized_pets_ordered.each do |pet|\n pet.name = \"#{pet.breed} #{counter}\"\n pets_to_update << pet\n counter += 1\n end\n end", "def rename_list(list_id, name)\n path = \"lists/#{list_id}\"\n params = { list: { name: name }}\n request(path, params, :put )\n \n # output full list again\n show_list(list_id)\n end", "def undo task, is_num\n\t\t\tif is_num\n\t\t\t\tif !@completed_tasks[task.to_i].nil?\n\t\t\t\t\t@tasks[task.to_i] = @completed_tasks[task.to_i]\n\t\t\t\t\t@completed_tasks.delete(task.to_i)\n\t\t\t\t\t@completed_count-=1\n\t\t\t\t\t@tasks = Hash[@tasks.sort]\n\t\t\t\t\tputs \"Undo completeing #{@tasks[task.to_i]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task \\##{task} not in list.\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\thash = Hash.new\n\t\t\t\t@completed_tasks.each do |k,v|\n\t\t\t\t\thash[k] = v.downcase\n\t\t\t\tend\n\t\t\t\tif hash.value?(task.downcase)\n\t\t\t\t\tnum = hash.key(task.downcase)\n\t\t\t\t\t@tasks[num] = @completed_tasks[num]\n\t\t\t\t\t@completed_tasks.delete(num)\n\t\t\t\t\t@completed_count-=1\n\t\t\t\t\t@tasks = Hash[@tasks.sort]\n\t\t\t\t\tputs \"Undo completeing #{@tasks[num]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task #{task} is not in list.\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tupdate\n\t\tend", "def task_names\n map do |task|\n task.name\n end\n end", "def task_names \n\t\t\tHelpers::DATABASE[:Tasks].join(:Task_list, :Tasks__Id => :Task_list__Task_Id).join(\n\t\t\t:Lists, :Lists__Id => :Task_list__List_id).select(:Tasks__Id, :Tasks__Task_number, \n\t\t\t:Tasks__Name, :Tasks__Completed, :Tasks__Priority).filter(:Lists__Name => Config[:working_list_name])\n\t\tend", "def task_names\n @task_names ||= tasks.map { |task| task.name.underscore }\n end", "def setTaskName(taskName)\r\n\t\t\t\t\t@taskName = taskName\r\n\t\t\t\tend", "def normalize_tasks_harvest(tasks)\n tasks.each do |task|\n project_original_id = task[\"payload\"][\"project\"][\"id\"]\n project = Project.find_by(workspace_id: harvest_workspace.id, original_id: project_original_id)\n found_task = Task.find_by(project_id: project.id, original_id: task[\"payload\"][\"task\"][\"id\"])\n if found_task\n found_task.name = task[\"payload\"][\"task\"][\"name\"]\n else\n found_task = Task.create!(project_id: project.id, name: task[\"payload\"][\"task\"][\"name\"], original_id: task[\"payload\"][\"task\"][\"id\"])\n end\n end\n end", "def renameTargetCollection(tcId, name)\n payload = { :name => name }\n path = PATH_GET_TC.dup\n path[PLACEHOLDER_TC_ID] = tcId\n return sendRequest('POST', path, payload)\n end", "def renameTargetCollection(tcId, name)\n payload = { :name => name }\n path = PATH_GET_TC.dup\n path[PLACEHOLDER_TC_ID] = tcId\n return sendRequest('POST', path, payload)\n end", "def rename(old_name, new_name); end", "def rename(old_name, new_name); end", "def normalize_tasks!\n x = tasks_list.join(' ')\n self.tasks = x.empty? ? '' : ' ' + x + ' '\n end", "def display_tasks(tasks) # we need the tasks\n # CONTRACT:\n # [x] buy croissants\n # [ ] buy coffee\n tasks.each_with_index do |task, index|\n # if task.done?\n # puts \"[x] #{task.name}\"\n # else\n # puts \"[ ] #{task.name}\"\n # end\n\n status = task.done? ? 'x' : ' '\n puts \"[#{status}] #{index + 1}. #{task.name}\"\n end\n end", "def rename_submenu\n\t\tputs \"Enter new list name:\"\n\t\tchoice = get_choice\n\t\t@todo_list.rename_title choice\n\t\tprint_menu\n\tend", "def finish task, is_num\n\t\t\tif is_num\n\t\t\t\tif !@tasks[task.to_i].nil?\n\t\t\t\t\t@completed_tasks[task.to_i] = @tasks[task.to_i]\n\t\t\t\t\[email protected](task.to_i)\n\t\t\t\t\t@completed_count+=1\n\t\t\t\t\t@completed_tasks = Hash[@completed_tasks.sort]\n\t\t\t\t\tputs \"Finished #{@completed_tasks[task.to_i]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task \\##{task} not in list.\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\thash = Hash.new\n\t\t\t\[email protected] do |k,v|\n\t\t\t\t\thash[k] = v.downcase\n\t\t\t\tend\n\t\t\t\tif hash.value?(task.downcase)\n\t\t\t\t\tnum = hash.key(task.downcase)\n\t\t\t\t\t@completed_tasks[num] = @tasks[num]\n\t\t\t\t\[email protected](num)\n\t\t\t\t\t@completed_count+=1\n\t\t\t\t\t@completed_tasks = Hash[@completed_tasks.sort]\n\t\t\t\t\tputs \"Finished #{@completed_tasks[num]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task #{task} is not in list.\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tupdate\n\t\tend", "def adjust_task_output_names_patterns(task) #:nodoc:\n local_name = task.params[:_cb_pipeline][\"0\"][:savename].presence\n global_name = task.params[:_cb_output_renaming_pattern].presence\n if local_name\n task.params[:_cb_output_renaming_pattern] = (local_name || \"\") # crush global name\n else\n task.params[:_cb_pipeline][\"0\"][:savename] = (global_name || \"\")\n end\n end", "def update(task_number, task) # Update task based on task number\n all_tasks[task_number -1] = task # Updates task\n end", "def renameTargetCollection(tcId, tcName)\n payload = { 'name' => tcName }\n path = @@PATH_GET_TC.dup\n path[@@PLACEHOLDER_TC_ID] = tcId\n return sendHttpRequest(payload, \"POST\", path)\n end", "def name\n\t\t\t@task\n end", "def rename(id, name = \"\")\n item = Item.find(id)\n item.class == Item ? item.update(:name => name) : item\n end", "def rename_item(index_no, rename)\n index_exist(index_no)? index_exist_rename(index_no, rename) : conf_message(index_no, \"does not exist\")\n end", "def names_only(tasks)\r\n tasks.map {|task| task[\"name\"]}\r\nend", "def add_task_names(task_names)\n return if task_names.empty?\n\n missing_task_names = task_names - all_tasks.map(&:name)\n\n missing_task_names.each { |task_name| add_eval_task_named(task_name) }\n\n all_tasks\n end", "def setupTasksList\n require 'tmpdir'\n lTasksFileName = \"#{Dir.tmpdir}/WEACE_Tasks_#{Thread.current.object_id}.lst\"\n File.open(lTasksFileName, 'w') do |oFile|\n oFile << 'TaskID 1\nTaskID 2\nTaskID 3'\n end\n yield(lTasksFileName)\n File.unlink(lTasksFileName)\n end", "def rename(_old_team, _new_team)\n # stub\n end", "def rename(event)\n @rename.each do |old, new|\n item = event.get(old)\n next if item.nil?\n event.set(new, item)\n event.remove(old)\n end\n end", "def bulk_rename\n Destination.rename_by_prefix(params[:destination], params[:prefix])\n flash[:status] = _('Destinations_were_renamed')\n redirect_to :controller => :destination_groups, :action => :list\n end", "def task_remove(task_name)\n return unless task_present? task_name\n tasks.delete prepare_key(task_name)\n reset\n end", "def rename_story\n\n end", "def remove_desc_for_task( names )\n Array(names).each do |task_name|\n task = Rake.application.tasks.find {|t| t.name == task_name}\n next if task.nil?\n task.instance_variable_set :@comment, nil\n end\nend", "def onRenamed(item, oldName, newName)\n @object.renamed(import(item), import(oldName), import(newName))\n end", "def change_item_name(new_name:, **)\n self.name = new_name # This will generate the event!\n end", "def remove_desc_for_task( names )\n Array(names).each do |task_name|\n task = Rake.application.tasks.find {|t| t.name == task_name}\n next if task.nil?\n task.instance_variable_set :@comment, nil\n end\nend", "def update_list_name(id, new_name)\n sql = \"UPDATE lists SET name = $1 WHERE id = $2\"\n query(sql, new_name, id)\n end", "def change_task_content_of_list(id, new_content)\n \t\tpos = find_task_by_id(id)\n \t\t@task_list[pos].change_update_content(new_content) \n \t\t@task_list[pos].change_update_content_state!\n \tend", "def _create_task_by_name(task_name)\n @tasks.each do |t|\n return t.clone if t.name == task_name\n end\n raise \"Unknown Task!\" # couldn't find it. boo.\n end", "def remove_desc_for_task( names )\n Array(names).each do |task_name|\n task = Rake.application.tasks.find {|t| t.name == task_name}\n next if task.nil?\n task.instance_variable_set :@comment, nil\n end\n end", "def edit_tasks(list_of_hash_tasks, *args)\n list_of_hash_tasks = [list_of_hash_tasks,] if list_of_hash_tasks.is_a Hash\n list_of_hash_tasks.each do |task|\n raise ArgumentError, 'An id must be specified when a task is edited' if unless task.has_key? :id or task.has_key 'id'\n end\n edit(\"tasks\", Babar::Task, list_of_hash_tasks, 'tasks', false, *args)\n end\n\n \n #Given a list of Task ids, delete all the corresponding tasks from the Toodledo API \n def delete_tasks(list_of_task_ids, *args)\n #TODO modify this to accept Task objects as well\n #TODO check that this will work because array is of IDs, not hashes\n modify(endpoint, 'delete', desired_class, array_of_hashes, array_field_name, delete_first_result, *args)\n end\n\n\n #Implement add/edit/delete methods for each of the following Toodledo User-defined lists: Context, Folder, Goal, Location\n %w(context folder goal location).each do |list|\n current_class = Babar::const_get(list.capitalize)\n define_method(\"get_#{list}s\") { get(\"#{list}s\", param_map = {}, desired_class = current_class, delete_first_result = false) }\n %w(add edit delete).each do |mod_endp|\n #Hash_goal is a Hash representation of the (desired) list AFTER it is added/edited/deleted\n #TODO in the case of deletion, make sure an ID suffices\n define_method(\"#{mod_endp}_#{list}\") { |hash_goal| modify_single( endpoint = \"#{list}s\", action = mod_endp, param_map = hash_goal, desired_class = current_class, delete_first_result = false)}\n end\n end\n\n end", "def change_names(map, names, target)\n names.each_with_index do |name, j|\n\t if map[name]\n\t\t\ttarget[j] = map[name]\n\t else\n\t\t\ttarget[j] = $id\n\t\t\tmap[name] = $id\n\t\t\t$id += 1\n\t end\n end\nend", "def change_names(offset)\n puts \"Changing files...\"\n Dir.foreach('.') do |item|\n next if item == '.' or item == '..' or item == 'numberFix.rb'\n fullname = modify_item(item, offset)\n File.rename(item, fullname)\n end\n puts \"Done.\"\nend", "def rename!(args)\n collection_modifier_update('$rename', args)\n end", "def add_hardcoded_duplicates(task)\n task.add_duplicate('t1 duplicate 1')\n task.add_duplicate('t1 duplicate 2')\n end", "def rename(old_name, new_name)\n send_command([:rename, old_name, new_name])\n end", "def task_in_todo (nb)\n t = get_todo (nb)\n if t\n task_in t.chomp\n else\n puts \"No task specified\"\n end\n end", "def rename(entry, new_name, &continue_on_exists_proc); end", "def assign_tasks(incoming_tasks=[])\n incoming_tasks.each do |task_data|\n task = Task.find_or_initialize_by(list: self, id: task_data[:id])\n task.update(task_data)\n end\n end", "def add_to_my_list(task)\n @my_list << task\n end", "def task(str, create_if_nil = false)\n t = tasks.find(:all).reject{|t| t.title.gsub(/\\s/,\"_\").underscore != str.to_s.gsub(/\\s/,\"_\").underscore}.first\n t = tasks.create(:title => str.to_s.humanize) if t.nil?\n t\n end", "def toodle_to_taskwarrior(task)\n twtask = {}\n twtask[:toodleid] = task[:id]\n twtask[:description] = task[:title]\n twtask[@due_field] = from_toodle_date(task[:duedate].to_i) if task[:duedate]\n twtask[:tags] = task[:tag].split(\",\").map(&:strip) if task[:tag]\n twtask[:project] = toodle_folder_to_tw(task[:folder]) if task[:folder]\n twtask[:priority] = toodle_priority_to_tw(task[:priority]) if task[:priority]\n twtask[:status] = task[:completed] ? \"completed\" : \"pending\"\n twtask[:uuid] = SecureRandom.uuid\n twtask[:entry] = Time.now.to_i\n if task[:context]\n con = toodle_context_to_tw(task[:context])\n twtask[:tags] = twtask[:tags] ? twtask[:tags].concat([ con ]) : [con]\n end\n\n twtask\n end", "def rename_projects!\n projects_new_names_map.each do |dxid, new_name|\n @user_api.project_update(dxid, name: new_name)\n end\n end", "def reassign_judge_assign_tasks\n judge_assign_tasks = open_tasks.of_type(:JudgeAssignTask)\n\n if judge_assign_tasks.any?\n task_ids = judge_assign_tasks.pluck(:id).sort\n message = \"#{cancel} #{task_ids.count} JudgeAssignTasks with ids #{task_ids.join(', ')} and #{create} \" \\\n \"#{task_ids.count} DistributionTasks\"\n Rails.logger.info(message)\n\n if !dry_run\n judge_assign_tasks.each do |task|\n DistributionTask.create!(appeal: task.appeal, parent: task.appeal.root_task)\n update_task_status_with_instructions(task, Constants.TASK_STATUSES.cancelled)\n end\n end\n end\n end", "def renamenx(old_name, new_name); end", "def renamenx(old_name, new_name); end", "def change_name!\n @project[:name] = \"#{@project[:name]}-PR#{@number}\" if @project[:name]\n @project[:value][:name] = \"#{@project[:value][:name]}-PR#{@number}\" if @project[:value][:name]\n end", "def move_task_in_to_do(from_index, to_index)\n initial = to_do_tasks[from_index].element\n target = to_do_tasks[to_index].element\n\n move_task(initial, target)\n end", "def write_taskwarrior_file(file, tasks)\n open(file, 'w') do |f|\n tasks.sort_by(&:toodleid).each do |t|\n t.tags = t.tags.join(\",\") if not t.tags.to_s.empty?\n f.puts('[' + t.to_h.collect{|k, v| %Q{#{k}:\"#{v}\"} }.join(\" \") + ']')\n end\n end\n end", "def resolve_task(name)\n name = name.to_s\n @tasks.each do |task|\n return task if task.name == name\n end\n @salticid.tasks.each do |task|\n return task if task.name == name\n end\n nil\n end", "def rename new_name\n @name = new_name.to_sym\n end", "def rename new_name\n @name = new_name.to_sym\n end", "def add_tasks(tasklist)\n tasklist.each{ |task| new_task(task)}\n end", "def undef_tasks(name, list)\r\n\t namespace name do\r\n\t metaclass = class << self; self; end\r\n\t list.each do |k|\r\n\t k = k.to_sym \r\n\t metaclass.send(:undef_method, k)\r\n\t tasks.delete k\r\n\t end\r\n\t end\r\n\t end", "def plan(tasks)\n\t\t\ttasks.each do |day,task|\n\t\t\t puts \"#{day}, we must complete the #{task}\"\n\t\t\tend\n\t\t\tputs \"I'm the Boss! No one must do anything without my knowledge!\"\n\t\tend", "def rename(new_name, update_all_tracks)\n @ole.Rename(new_name, update_all_tracks)\n end", "def ensure_unique_tasks_names! \n for i in 0..(@tasks_params.count-2)\n for j in (i+1)..(@tasks_params.count-1)\n raise RuntimeError, 'Duplicated tasks names' if @tasks_params[i.to_s][:name] == @tasks_params[j.to_s][:name]\n end\n end\n end", "def bulk_name_edit # :prefetch: :norobots:\n @list_members = nil\n @new_names = nil\n if request.method == :post\n list = params[:list][:members].strip_squeeze rescue ''\n construct_approved_names(list, params[:approved_names])\n sorter = NameSorter.new\n sorter.sort_names(list)\n if sorter.only_single_names\n sorter.create_new_synonyms\n flash_notice :name_bulk_success.t\n redirect_to(:controller => 'observer', :action => 'list_rss_logs')\n else\n if sorter.new_name_strs != []\n # This error message is no longer necessary.\n flash_error \"Unrecognized names given, including: #{sorter.new_name_strs[0].inspect}\" if TESTING\n else\n # Same with this one... err, no this is not reported anywhere.\n flash_error \"Ambiguous names given, including: #{sorter.multiple_line_strs[0].inspect}\"\n end\n @list_members = sorter.all_line_strs.join(\"\\r\\n\")\n @new_names = sorter.new_name_strs.uniq.sort\n end\n end\n end", "def change_file_names\n sorted_all_images_name.each do |f|\n File.rename(f, sterilize(f))\n end\n end", "def execute()\r\n File.rename(@OldFileName, @NewFileName)\r\n end", "def rename(renames)\n operations = renames.inject({}) do |ops, (old_name, new_name)|\n ops[old_name] = new_name.to_s\n ops\n end\n view.update_many(\"$rename\" => collect_operations(operations))\n end", "def add_task(task)\n @task_list << task\n @combined_list = @due_date_task_list + @task_list\n end", "def swap_name(str)\n str.split(\"\\n\").map do |name|\n n = name.split(\" \")\n n[1] + \", \" + n[0]\n end.join\nend", "def name_swap(name_to_be_altered)\n\t#STEP \t1) Breaking it into a word array\n\n\tname_arrayed = name_to_be_altered.split(' ')\n\t# STEP\t2) Doing a method that switches the first and second elements in the array\n\tname_arrayed.insert(0, name_arrayed.delete_at(1))\nend", "def rename_files(format:)\n require 'pp'\n child_items.each_with_index do |child, index|\n new_name = sprintf(format, index+1)\n extname = child.path.extname\n dirname = child.path.dirname.to_s\n new_filename = dirname + \"/\" + new_name + extname\n FileManager.rename(from_file: child.path.to_s, to_file: new_filename)\n end\n end", "def rename(name)\n url = prefix + \"rename&name=#{name}\" \n return response(url)\n end", "def delete_similar(user, taskname)\n Assignment.all.each do |assignment_instance|\n if assignment_instance.taskname == taskname\n assignment_instance.delete \n # puts \"#{user.name} finishes #{assignment_instance.taskname}\"\n end\n end \n end", "def update_quantity(list, item_name, quantity)\n\tlist.each do |item, qty|\n\t\tif item === item_name\n\t\t\tlist[item] = quantity\n\t\tend\n\tend\nend", "def exist_item_remane(index_no, rename)\n index_no -= 1\n @o_description = @items[index_no].description\n @items[index_no].description = rename.capitalize\n conf_message(@o_description, \"replaced\")\n end", "def alias_task(aliases)\n aliases.each do |alias_name,task_name|\n t = Rake::Task[task_name]\n task alias_name, *t.arg_names do |_, args|\n args = t.arg_names.map { |a| args[a] }\n t.invoke(args)\n end\n end\nend", "def update_internal_task_lists\n\n # Security - discard tasks the user should not be able to see.\n\n if ( @current_user.restricted? )\n @tasks.select do | task |\n task.is_permitted_for?( @current_user )\n end\n end\n\n # Now the fiddly bit! Sort the task objects by augmented title, then\n # retrospectively rebuild the task ID arrays using the reordered list.\n\n Task.sort_by_augmented_title( @tasks )\n\n @task_ids = []\n @active_task_ids = []\n @inactive_task_ids = []\n\n @tasks.each do | task |\n @task_ids << task.id\n @active_task_ids << task.id if ( task.active )\n @inactive_task_ids << task.id unless ( task.active )\n end\n end", "def rename_to_bob\n name = 'Bob'\n end", "def rename_team(oldname, newname)\n\t\tcounter = 0\n\t\[email protected]! do |game|\n\t\t\tif game.teams.index(oldname)\n\t\t\t\tgame.teams[game.teams.index(oldname)] = newname \n\t\t\t\tcounter +=1 \n\t\t\tend\n\t\t\tgame\n\t\tend\n\n\t\treturn counter\n\tend", "def task(name, &block)\r\n if name.kind_of?(Hash)\r\n name.each do |alias_name, task_name|\r\n raise(\"Undefined task `#{task_name}'\") unless @@tasks[task_name.to_s]\r\n @@tasks[alias_name.to_s] = @@tasks[task_name.to_s]\r\n @@descriptions[alias_name.to_s] = @@last_description\r\n end\r\n else\r\n raise(\"Task `#{name}' is defined more than once\") if @@tasks[name.to_s]\r\n @@tasks[name.to_s] = block\r\n @@descriptions[name.to_s] = @@last_description\r\n end\r\n\r\n @@last_description = nil\r\n end", "def show_tasks(tasks)\n tasks.each_with_index do |task, index|\n status = task.done? ? \"x\" : \" \"\n puts \"#{index + 1}. [#{status}] #{task.name}\"\n end\n end", "def taskwarrior_to_toodle(task)\n toodletask = {}\n toodletask[:title] = task[:description]\n toodletask[:id] = task[:toodleid] if task[:toodleid]\n toodletask[:duedate] = to_toodle_date(task[@due_field].to_i) if task[@due_field]\n toodletask[:completed] = to_toodle_date(task[:end].to_i) if task[:end]\n toodletask[:priority] = tw_priority_to_toodle(task[:priority]) if task[:priority]\n toodletask[:folder] = tw_project_to_toodle(task[:project]) if task[:project]\n if task[:tags]\n context = task[:tags].find{|i| i.start_with? '@' }\n if context\n toodletask[:context] = tw_context_to_toodle(context)\n task[:tags] = task[:tags].select{|t| not t.start_with? '@'}\n end\n toodletask[:tag] = task[:tags].join(\",\")\n end\n toodletask\n end", "def task_options\n task_types.map do |et|\n [et.gsub('Task', '').titlecase, et]\n end\n end", "def rename_file\n\n end", "def reassign_task\n clusters = @task.receiver.clusters\n users = []\n set_default_task_data(@task)\n if @back_office_task\n users = Cluster.get_back_office_cluster_livians\n else\n users = User.all_cluster_livian(clusters)\n end\n if @task.work_subtype && @back_office_task\n differentiat_users_on_skills(users, @task.work_subtype, @task.work_subtype_complexity)\n elsif @task.work_subtype\n differentiat_users_on_skills(users, @task.work_subtype)\n else\n @users_select = [[\"no skilled user\",\"\"],[\"-------Other Users-------\",\"\"]]\n @users_select += users.collect {|u| [ u.full_name, u.id ]}\n end\n render :layout=> false\n end", "def update_item(list, name, change_in_quantity)\n normalize_string(name)\n if (list[name] + change_in_quantity <= 0)\n remove_item(list, name)\n else\n list[name] += change_in_quantity\n return list\n end\nend", "def add_task\r\n\r\n task = task_info(params[:id], true)\r\n dup = BgWorker.first(:conditions => {:name => task[:fullname], :no_duplicate => true})\r\n res = BgWorker.run_task(task, 3) unless dup\r\n if res.nil?\r\n flash[:error] = _(\"Task could not be added to job list!\")\r\n else\r\n flash[:notice] = _(\"Task added to job list.\")\r\n end\r\n redirect_to(:action => :list) and return\r\n end", "def items_list_deletion(tasks_to_delete_list,log_file)\n tasks_to_delete_list.each do |task|\n copy_to_log_file(log_file,\"Task deletion\",to_do_list:to_do_list,id:task)\n remove_an_item(task)\n print_out_all_items\n end\n end", "def test_finish_list_item\n list = Todo::List.new\n list.add(name: 'do this')\n list.finish('do this')\n assert_equal(true, list.tasks.first.finished?)\n end", "def rename(new_name)\n raise 'to be implemented in subclass'\n end", "def rename oldname, newname\n add \"mv #{oldname} #{newname}\", check_file(newname)\n end", "def reassign_manually_assigned_org_tasks(parent_tasks, tasks)\n task_ids = tasks.pluck(:id).sort\n message = \"#{cancel} #{task_ids.count} tasks with ids #{task_ids.join(', ')} and #{move} #{task_ids.count} parent\" \\\n \" tasks back to the organization's unassigned queue tab\"\n Rails.logger.info(message)\n\n if !dry_run\n parent_tasks.update_all(status: Constants.TASK_STATUSES.assigned)\n tasks.each { |task| update_task_status_with_instructions(task, Constants.TASK_STATUSES.cancelled) }\n end\n end", "def rename(name)\n url = prefix + \"rename&name=#{name}\"\n return response(url)\n end", "def getTaskName\r\n\t\t\t\t\treturn @taskName\r\n\t\t\t\tend", "def rename(options={}, &block)\n map_mv(options, &block)\n end", "def add_rollback_task(task_name)\n rollback_tasks << task_name if Rake::Task.task_defined? task_name\n end", "def complete_task(list_id, task_id, is_completed)\n path = \"lists/#{list_id}/tasks/#{task_id}\"\n if is_completed\n completed = 1\n else\n completed = 0\n end\n params = {task: {is_completed: completed}}\n request(path, params, :put)\n\n # output full list again\n show_list(list_id)\n end" ]
[ "0.6326878", "0.62918496", "0.61123323", "0.5901944", "0.58919173", "0.58775043", "0.58026034", "0.5790262", "0.5778467", "0.57389337", "0.57389337", "0.5670252", "0.5670252", "0.561361", "0.56024164", "0.5599311", "0.5593268", "0.55859166", "0.5575229", "0.55732566", "0.5565229", "0.5542769", "0.5475372", "0.5466918", "0.5460631", "0.54521155", "0.5408874", "0.5404055", "0.5386004", "0.5382373", "0.53760093", "0.5371753", "0.5369938", "0.5351497", "0.53315276", "0.5327438", "0.5316907", "0.53140575", "0.53101325", "0.53053534", "0.52955717", "0.5272303", "0.5267665", "0.5267487", "0.52629113", "0.52596265", "0.52574414", "0.5252972", "0.5252272", "0.5239828", "0.52281564", "0.5226079", "0.5225986", "0.5210662", "0.5210662", "0.5198557", "0.51964366", "0.5189708", "0.51742566", "0.5173275", "0.5173275", "0.51719636", "0.5171866", "0.5168869", "0.51639235", "0.5162505", "0.5160439", "0.5144039", "0.5139273", "0.5138666", "0.5135742", "0.5126459", "0.512321", "0.5119585", "0.5116185", "0.5110316", "0.5093562", "0.50893635", "0.5087829", "0.50803804", "0.5073961", "0.5064296", "0.5062052", "0.5060874", "0.50581825", "0.50553215", "0.5054888", "0.50529015", "0.5048455", "0.50481856", "0.504126", "0.50343245", "0.50271803", "0.5027153", "0.50255305", "0.5024721", "0.5020063", "0.50108135", "0.5006767", "0.50065625" ]
0.7182696
0
check list 1 task 1 uncheck list 1 task 1
def complete_task(list_id, task_id, is_completed) path = "lists/#{list_id}/tasks/#{task_id}" if is_completed completed = 1 else completed = 0 end params = {task: {is_completed: completed}} request(path, params, :put) # output full list again show_list(list_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uncheck(id_string)\n set_done(id_string, false)\n #checking all other tasks with same name/description as the newly unchecked task which id is 'id_string'\n id = id_string.to_i\n @tasks.each { |project_name, project_tasks|\n project_tasks.each { |task|\n if task.id == id\n # puts 'here1'\n @tasks.each do |project_name, project_tasks|\n project_tasks.each do |t|\n if t.description == task.description\n set_done(t.id.to_s, false)\n # puts 'here2'\n # puts task.done\n # puts t.done\n end\n end\n end\n end\n }\n\n }\n end", "def uncheck\n action(action: Actions::UNCHECK)\n self\n end", "def uncheck\n click unless unchecked?\n end", "def toggle(task_number) # Toggle method that calls the toggle_status method on the appropriate task from the all_tasks array\n all_tasks[task_number - 1].toggle_status\n end", "def uncheck\n self.checked = Time.at(0)\n end", "def unanswered_check_in_questions\n action_items.where(component_type:Check::COMPONENT_TYPE, day:1..day.to_i).select{|i| !i.complete?}\n end", "def tasks() []; end", "def create_subtasks(card)\n #if card.checklists\n # task_item = Cards.get_first_unchecked_item(card.checklists.first.check_items) \n #end \n end", "def uncheck *params\n opt = parse_params_for_check params\n @adapter.check opt, false\n end", "def incomplete_tasks\n\t\ttasks.select{ |t| !t.completed? }\n\tend", "def check_tasks\n if !(@free_workers.empty? || @tasks_to_assign.empty?)\n @free_workers.each { |worker| find_task_for(worker) }\n end\n end", "def undo task, is_num\n\t\t\tif is_num\n\t\t\t\tif !@completed_tasks[task.to_i].nil?\n\t\t\t\t\t@tasks[task.to_i] = @completed_tasks[task.to_i]\n\t\t\t\t\t@completed_tasks.delete(task.to_i)\n\t\t\t\t\t@completed_count-=1\n\t\t\t\t\t@tasks = Hash[@tasks.sort]\n\t\t\t\t\tputs \"Undo completeing #{@tasks[task.to_i]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task \\##{task} not in list.\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\thash = Hash.new\n\t\t\t\t@completed_tasks.each do |k,v|\n\t\t\t\t\thash[k] = v.downcase\n\t\t\t\tend\n\t\t\t\tif hash.value?(task.downcase)\n\t\t\t\t\tnum = hash.key(task.downcase)\n\t\t\t\t\t@tasks[num] = @completed_tasks[num]\n\t\t\t\t\t@completed_tasks.delete(num)\n\t\t\t\t\t@completed_count-=1\n\t\t\t\t\t@tasks = Hash[@tasks.sort]\n\t\t\t\t\tputs \"Undo completeing #{@tasks[num]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task #{task} is not in list.\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tupdate\n\t\tend", "def reset\n @tasks_have_failed = false\n @tasks_are_finished = false\n @tasks_are_successful = false\n end", "def remove_inactive_tasks\n self.tasks = self.tasks.active\n end", "def tick(*args)\n prior_status = @status\n @status = :tick\n task = first\n result = task.call(*args)\n delete task\n merge(result) if result.is_a?(TaskList)\n @status = prior_status\n finished?\n result\n end", "def empty?; tasks.empty? end", "def clear_all_checks\n \n self.trim_checklist_for_design_type\n \n self.design_checks.each do | design_check |\n design_check.auditor_result = 'None' #if design_check.check.is_peer_check?\n design_check.designer_result = 'None' #if design_check.check.is_self_check?\n design_check.save\n end\n \n self.auditor_completed_checks = 0\n self.auditor_complete = false\n self.designer_completed_checks = 0\n self.designer_complete = false\n self.save\n \n end", "def clear clear_all\n\t\t\tclear_completed\n\t\t\tif clear_all\n\t\t\t\t@tasks = Hash.new\n\t\t\t\t@completed_count = 0\n\t\t\t\t@count = 0\n\t\t\t\tputs \"Cleared list.\"\n\t\t\telse\n\t\t\t\tputs \"Cleared completed tasks.\"\n\t\t\tend\n\t\t\tupdate\n\t\tend", "def undef_tasks(name, list)\r\n\t namespace name do\r\n\t metaclass = class << self; self; end\r\n\t list.each do |k|\r\n\t k = k.to_sym \r\n\t metaclass.send(:undef_method, k)\r\n\t tasks.delete k\r\n\t end\r\n\t end\r\n\t end", "def delete_all_completed!\n @todos = @todos.reject { |todo| todo.completed == true }\n end", "def trim_checklist_for_peer_audit\n \n self.trim_checklist_for_design_type\n \n self.checklist.sections.each do |section|\n section.subsections.each do |subsection|\n subsection.checks.delete_if { |check| !check.is_peer_check? }\n end\n end\n \n # Lop off any empty sections and subsections\n self.checklist.sections.delete_if { |section| section.check_count == 0 }\n self.checklist.sections.each do |section|\n section.subsections.delete_if { |subsection| subsection.check_count == 0 }\n end\n \n end", "def change_item_state(checklist, item)\n id = item.id\n pos = item.pos\n # checked = item.state_was == \"complete\" ? true : false\n name = item.name\n checklist.delete_checklist_item(id)\n checklist.add_item(name, true, pos)\n checklist.save\nend", "def actionable_tasks\n\t\tnext_tasks.select{ |t| !t.deferred? }\n\tend", "def deploy_checklists\n return if checklist_not_allowed?\n\n # WITH REQUEST\n if (self.active_requests.count > 0)\n self.project.active_requests.each { |r|\n next if !r.milestone_names or !r.milestone_names.include?(self.name)\n for t in ChecklistItemTemplate.find(:all, :conditions=>\"is_transverse=0\").select{ |t|\n t.milestone_names.map{|n| n.title}.include?(self.name) and\n (t.workpackages.map{|w| w.title}.include?(r.work_package)) and\n (r.contre_visite==\"No\" or r.contre_visite_milestone==self.name)\n }\n deploy_checklist(t,r)\n end\n\n }\n # WITHOUT REQUEST + IS_QR_QWR\n elsif self.project.is_qr_qwr == true\n for t in ChecklistItemTemplate.find(:all, :conditions=>\"is_transverse=0 and is_qr_qwr=1\").select{ |t|\n t.milestone_names.map{|n| n.title}.include?(self.name)\n }\n deploy_checklist_without_request(t)\n end\n end\n\n end", "def inactive_tasks\n @tasks.select { | task | ! task.active }\n end", "def change_item_state(checklist, item)\n\tid = item.id\n\tpos = item.pos\n # checked = item.state_was == \"complete\" ? true : false\n name = item.name\n checklist.delete_checklist_item(id)\n checklist.add_item(name, true, pos)\n checklist.save\nend", "def check_completed\n\t\tend", "def uncheck_content(item)\n name_li(item).checkbox.clear\n end", "def starting_tasks\n each_task.reject do |task|\n task.dependency_backward_any?\n end\n end", "def trim_checklist_for_self_audit\n \n self.trim_checklist_for_design_type\n self.checklist.sections.each do |section|\n section.subsections.each do |subsection|\n subsection.checks.delete_if { |check| !check.is_self_check? }\n end\n end\n \n # Lop off any empty sections and subsections\n self.checklist.sections.delete_if { |section| section.check_count == 0 }\n self.checklist.sections.each do |section|\n section.subsections.delete_if { |subsection| subsection.check_count == 0 }\n end\n \n end", "def reset_checks\n @check_count = 0\n end", "def index\n @tasks = Task.where(checklist: false).order(\"end_date asc\")\n @tasks1 = Task.where(checklist: true).order(\"end_date asc\")\n \n end", "def clean_up_coding_tasks\n wait_for_clean_up_tasks\n clean_up_tasks.click\n wait_for_clean_up_success_message\n raise \"Error occured while cleaning up coding tasks\" if !clean_up_success_message.text.include? 'All the Coding Tasks have been removed'\n end", "def validate_tasks\n validated = false\n if tasks_completed?\n validated = tasks_completed!\n end\n\n validated\n end", "def test03_LI2_follow_uncheck\n\t\t$browser.goto($patch_login)\n\t\tloginDirectory\n\t\t$browser.goto($patch_directory_listing)\n\t\t\n\t\tif_following_unfollow\n\t\t\n\t\t$directory_review_follow.fire_event(\"onclick\")\n\t\t$directory_group_follow_updates_off.click\n\t\t$directory_group_follow_ok.click\n\t\t\n\t\tsleep 5\n\t\tbegin\n\t\tassert $browser.text.include? \"Following\"\n\t\trescue => e\n\t\t\tputs e\n\t\tputs \"LI2_follow_uncheck: FAILED! Unable to follow listing without instant updates.\"\n\t\tend\n\tend", "def items_list_deletion(tasks_to_delete_list,log_file)\n tasks_to_delete_list.each do |task|\n copy_to_log_file(log_file,\"Task deletion\",to_do_list:to_do_list,id:task)\n remove_an_item(task)\n print_out_all_items\n end\n end", "def check_down; end", "def check\n click unless checked?\n end", "def undone?\n !done?\n end", "def remove(task)\n @complete = true\n end", "def reset_checks\n @checks_used = 0\n end", "def reset_checks\n @checks_remaining = 3\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def uncheck locator\r\n command 'uncheck', locator\r\n end", "def check(id_string)\n set_done(id_string, true)\n #checking all other tasks with same name/description as the newly checked task which id is id_string\n id = id_string.to_i\n @tasks.each { |project_name, project_tasks|\n project_tasks.each { |task|\n if task.id == id\n @tasks.each do |project_name, project_tasks|\n project_tasks.each do |t|\n if t.description == task.description\n set_done(t.id.to_s, true)\n end\n end\n end\n end\n }\n }\n end", "def try_again(hostname)\n mirror = Mirror.find_by_hostname hostname\n\n if mirror\n mirror.tasks.each do |task|\n task.block = false\n task.save\n end\n\n puts \"done (unblocked)\"\n else\n puts \"hostname not found\"\n end\n\n nil\nend", "def reset_checks\n @checks = 0\n end", "def task_schedule_status(task)\n\t\tstatus = []\n\tend", "def toggle_status\n @chain_task.toggle_status!\n render :text => :ok and return\n end", "def delete_similar(user, taskname)\n Assignment.all.each do |assignment_instance|\n if assignment_instance.taskname == taskname\n assignment_instance.delete \n # puts \"#{user.name} finishes #{assignment_instance.taskname}\"\n end\n end \n end", "def reset_checks\n @counter = 0\n end", "def reassign_judge_assign_tasks\n judge_assign_tasks = open_tasks.of_type(:JudgeAssignTask)\n\n if judge_assign_tasks.any?\n task_ids = judge_assign_tasks.pluck(:id).sort\n message = \"#{cancel} #{task_ids.count} JudgeAssignTasks with ids #{task_ids.join(', ')} and #{create} \" \\\n \"#{task_ids.count} DistributionTasks\"\n Rails.logger.info(message)\n\n if !dry_run\n judge_assign_tasks.each do |task|\n DistributionTask.create!(appeal: task.appeal, parent: task.appeal.root_task)\n update_task_status_with_instructions(task, Constants.TASK_STATUSES.cancelled)\n end\n end\n end\n end", "def next_tasks\n\t\tincomplete_tasks.select{ |t| !t.blocked? }\n\tend", "def update_completed\n uncompleted_items = todo_list_items.select { |e| !e.completed? }\n update(completed: true) if uncompleted_items.zero?\n end", "def deploy_checklist_without_request(template)\n p = template.find_or_deploy_parent_without_request(self)\n parent_id = p ? p.id : 0\n i = ChecklistItem.find(:first, :conditions=>[\"template_id=? and milestone_id=?\", template.id, self.id])\n if not i\n ChecklistItem.create(:milestone_id=>self.id, :request_id=>nil, :parent_id=>parent_id, :template_id=>template.id)\n else\n # parent change handling\n i.parent_id = parent_id\n i.save\n # if some milestone_names or workpackages have been added, the new ChecklistItem will be created\n # The detection of removal of milestones or workpackages must be done elsewhere\n # TODO is_transverse:\n # if changed from no to yes, a lot of cleanup must be done\n # for yes to no, the ChecklistItems will be created, cleanup the ProjectCheckItems\n end\n end", "def silent_delete(m, ind)\n found_attribs = get(:tasks, ind)\n m.reply \"task not found. please relist and try again\" && return unless found_attribs\n m.reply \"silently deleting the task. Bang!\"\n delete(:tasks, ind)\n end", "def uncheck_all_checkboxes(count, id)\n Log.logger.info(\"Unchecking all '#{count}' options in the checkbox\")\n count.times {|i|\n i += 1\n check = @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).selected?\n if(check == true)\n @browser.find_element(:xpath => @webformmgr.clickbox_id(id, i)).click\n end\n }\n end", "def all_tasks_to_run\n self.all_tasks - all_tasks_previously_run - all_tasks_duplicates\n end", "def show\n @[email protected](\"estado = ?\",\"expirada\").order(:prioridad)\n end", "def destroy\n OrderUnit.where(produce_task_id: @produce_task.id).each do |ou|\n ou.produce_task_id = nil\n ou.state = 0\n ou.save!\n ou.order.checked! unless ou.order.checked?\n end\n\n OrderPart.where(produce_task_id: @produce_task.id).each do |op|\n op.produce_task_id = nil\n op.state = 0\n op.save!\n op.order.checked! unless op.order.checked?\n end\n\n @produce_task.destroy\n respond_to do |format|\n format.html { redirect_to produce_tasks_url, notice: '生产任务已删除。' }\n format.json { head :no_content }\n end\n end", "def clean\n # Each the tasks\n @tasks.each do |task|\n # Clean all of them\n task.clean\n end\n end", "def create\n @checklist = Checklist.new(checklist_params)\n @checklist.user_id = current_user.id\n @checklist.completed = false\n if @checklist.save\n redirect_to '/checklists/index'\n else\n redirect_to '/checklists/new'\n flash[:notice] = \"Error saving your Task. Task name is blank or shorter than 5 characters\"\n end\n end", "def reassign_judge_review_tasks\n judge_review_tasks = open_tasks.of_type(:JudgeDecisionReviewTask)\n\n if judge_review_tasks.any?\n task_ids = judge_review_tasks.pluck(:id).sort\n message = \"#{cancel} #{task_ids.count} JudgeDecisionReviewTasks with ids #{task_ids.join(', ')} and #{move} \" \\\n \"#{task_ids.count} AttorneyTasks to new JudgeDecisionReviewTasks assigned to the attorney's new judge\"\n Rails.logger.info(message)\n\n if !dry_run\n judge_review_tasks.each do |task|\n attorney_task = task.children_attorney_tasks.not_cancelled.order(:assigned_at).last\n reassign_judge_review_task(task, attorney_task)\n end\n end\n end\n end", "def tasks_status(tasks)\n return 'passing' if tasks.all?(&:passing?)\n return 'failing' if tasks.any?(&:failing?)\n return 'errored' if tasks.any?(&:errored?)\n return 'pending' if tasks.any?(&:pending?)\n return 'incomplete' if tasks.any?(&:incomplete?)\n\n 'unstarted'\n end", "def reset\n num_removed = completed_task_ids.size\n self.completed_task_ids = []\n\n self.set_current_task_id=(lesson.tasks.first.id)\n @last_completed_task_id = 0\n self.points = 0\n\n num_removed\n end", "def check_default_check_list\n if too_big_for_check_list? && !prefers_check_lists && check_list\n delay(:priority => USER_INTEGRITY_PRIORITY).remove_default_check_list\n end\n if too_big_for_check_list?\n self.prefers_check_lists = false\n end\n if prefers_check_lists && check_list.blank?\n self.create_check_list(:place => self)\n save(:validate => false)\n unless check_list.valid?\n Rails.logger.info \"[INFO] Failed to create a default check list on \" + \n \"creation of #{self}: \" + \n check_list.errors.full_messages.join(', ')\n end\n end\n true\n end", "def testSimpleTasksReordering\n executeSimpleTest(\n [ [ 'T1', 'R1', 800, 2, [], ' =='],\n [ 'T2', 'R1', 100, 2, ['T3'], '=='],\n [ 'T3', 'R2', 900, 2, [], ' =='],\n [ 'T4', 'R3', 200, 3, ['T3'], '==='] ] )\n end", "def destroy\n @checklist.destroy\n end", "def noop_tasks(name, list)\r\n\t namespace name do\r\n\t metaclass = class << self; self; end\r\n\t list.each do |k|\r\n\t tasks[k.to_sym].instance_variable_set(:@body, lambda {})\r\n\t end\r\n\t end\r\n\t end", "def orphan_tasks\n each_task.reject do |task|\n task.dependency_backward_any? or task.dependency_forward_any?\n end\n end", "def filtered_checklist(user)\n\n sections = self.checklist.sections\n \n if self.design.date_code?\n sections.delete_if { |sec| !sec.date_code_check? }\n sections.each do |section|\n section.subsections.delete_if { |subsec| !subsec.date_code_check? }\n end\n elsif self.design.dot_rev?\n sections.delete_if { |sec| !sec.dot_rev_check? }\n sections.each do |section|\n section.subsections.delete_if { |subsec| !subsec.dot_rev_check? }\n end\n end\n \n if self.is_peer_audit? && self.is_peer_auditor?(user)\n sections.delete_if { |sec| sec.designer_auditor_check_count == 0 }\n sections.each do |section|\n section.subsections.delete_if { |subsec| subsec.designer_auditor_check_count == 0 }\n end\n end\n \n end", "def reassign_task\n clusters = @task.receiver.clusters\n users = []\n set_default_task_data(@task)\n if @back_office_task\n users = Cluster.get_back_office_cluster_livians\n else\n users = User.all_cluster_livian(clusters)\n end\n if @task.work_subtype && @back_office_task\n differentiat_users_on_skills(users, @task.work_subtype, @task.work_subtype_complexity)\n elsif @task.work_subtype\n differentiat_users_on_skills(users, @task.work_subtype)\n else\n @users_select = [[\"no skilled user\",\"\"],[\"-------Other Users-------\",\"\"]]\n @users_select += users.collect {|u| [ u.full_name, u.id ]}\n end\n render :layout=> false\n end", "def all_complete\n self.tasks.count == self.tasks.done.count\n end", "def all_changed_by_completion_toggle\n handle_xhr_request do\n raise MissingUserChecklistParameterError, t('.missing-checklist-param-error') if params[:id].blank?\n\n user_checklist_id = params[:id]\n user_checklist = UserChecklist.find(user_checklist_id)\n raise ActiveRecord::RecordNotFound, t('.not_found', id: user_checklist_id) if user_checklist.nil?\n\n # toggle the date_completed and update any parents needed\n user_checklist.all_changed_by_completion_toggle\n\n check_membership_status_if_complete(user_checklist.root, user_checklist.root.percent_complete)\n\n { checklist_id: user_checklist.id,\n date_completed: user_checklist.date_completed,\n overall_percent_complete: user_checklist.percent_complete\n }\n end\n end", "def orphaned_design_checks\n \n log = []\n \n total_design_checks = self.design_checks.size\n self.trim_checklist_for_design_type\n self.get_design_checks\n \n completed_check_counts = self.completed_check_count\n \n attached_design_checks = []\n self.checklist.each_check { |ch| attached_design_checks << ch.design_check }\n\n directory_name = self.design.directory_name\n \n orphaned_design_checks = self.design_checks - attached_design_checks\n \n if orphaned_design_checks.size > 0\n \n self.designer_completed_checks = completed_check_counts[:self]\n self.auditor_completed_checks = completed_check_counts[:peer]\n self.save\n \n log << \" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\"\n log << \" REMOVING INAPPROPRIATE DESIGN CHECKS\"\n log << \" %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\"\n\n orphaned_design_checks.each do |dc|\n check = Check.find(dc.check_id)\n \n log << \"\"\n log << \" DESIGN CHECK ID: \" + dc.id.to_s\n log << \" CHECK ID: \" + dc.check_id.to_s\n log << \" SELF CHECKED: \" + dc.self_auditor_checked?.to_s\n log << \" PEER CHECKED: \" + dc.peer_auditor_checked?.to_s\n log << \" NEW REVIEW: \" + check.full_review?.to_s\n log << \" BB REVIEW: \" + check.dot_rev_check?.to_s\n \n dc.destroy \n \n design_check_list = DesignCheck.find(:all, :conditions => \"audit_id=#{self.id} AND check_id=#{dc.check_id}\")\n if design_check_list.size > 1\n log << \"\"\n log << \" **********************************************\"\n log << \" **********************************************\"\n log << \" ***** WARNING: FOUND MULTIPLE DESIGN CHECKS!!!\"\n log << \" **********************************************\"\n log << \" **********************************************\"\n log << \"\"\n end\n end\n end\n \n log\n \n end", "def display_tasks(tasks) # we need the tasks\n # CONTRACT:\n # [x] buy croissants\n # [ ] buy coffee\n tasks.each_with_index do |task, index|\n # if task.done?\n # puts \"[x] #{task.name}\"\n # else\n # puts \"[ ] #{task.name}\"\n # end\n\n status = task.done? ? 'x' : ' '\n puts \"[#{status}] #{index + 1}. #{task.name}\"\n end\n end", "def delete_task(i)\n filtered_tasks = []\n session_tasks.each_with_index do |task, index|\n filtered_tasks << task unless index.eql?(i)\n end\n @session_tasks = filtered_tasks\n end", "def update_internal_task_lists\n\n # Security - discard tasks the user should not be able to see.\n\n if ( @current_user.restricted? )\n @tasks.select do | task |\n task.is_permitted_for?( @current_user )\n end\n end\n\n # Now the fiddly bit! Sort the task objects by augmented title, then\n # retrospectively rebuild the task ID arrays using the reordered list.\n\n Task.sort_by_augmented_title( @tasks )\n\n @task_ids = []\n @active_task_ids = []\n @inactive_task_ids = []\n\n @tasks.each do | task |\n @task_ids << task.id\n @active_task_ids << task.id if ( task.active )\n @inactive_task_ids << task.id unless ( task.active )\n end\n end", "def task_in_todo (nb)\n t = get_todo (nb)\n if t\n task_in t.chomp\n else\n puts \"No task specified\"\n end\n end", "def destroy_multiple\n\t @list.delete(params[:id])\n\t redirect_to '/tasks'\n\tend", "def task_remove(task_name)\n return unless task_present? task_name\n tasks.delete prepare_key(task_name)\n reset\n end", "def do_hold(last_check)\n if last_check.off?\n # If the status report says the Equipment is offline, try\n # resending the Task. If that doesn't work, fail and punt to the launcher.\n hold_failure! unless send_to_rhizome\n end\n end", "def reset_checks\n @checks_used = 0\n puts \"Checks used: #{@checks_used}\"\n end", "def incomplete!\n self.update_attribute(:is_completed, false)\n # TODO: send an email to teacher about tasks reopening\n end", "def get_tasks_from_todoist\n return Todoist::Task.uncompleted(PROGRAMMING_PROJECT_ID)\n end", "def remove_in_progress_task\n $redis.del(\"#{studio.studio_id}:#{ip}\")\n end", "def finish task, is_num\n\t\t\tif is_num\n\t\t\t\tif !@tasks[task.to_i].nil?\n\t\t\t\t\t@completed_tasks[task.to_i] = @tasks[task.to_i]\n\t\t\t\t\[email protected](task.to_i)\n\t\t\t\t\t@completed_count+=1\n\t\t\t\t\t@completed_tasks = Hash[@completed_tasks.sort]\n\t\t\t\t\tputs \"Finished #{@completed_tasks[task.to_i]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task \\##{task} not in list.\"\n\t\t\t\tend\n\t\t\telse\n\t\t\t\thash = Hash.new\n\t\t\t\[email protected] do |k,v|\n\t\t\t\t\thash[k] = v.downcase\n\t\t\t\tend\n\t\t\t\tif hash.value?(task.downcase)\n\t\t\t\t\tnum = hash.key(task.downcase)\n\t\t\t\t\t@completed_tasks[num] = @tasks[num]\n\t\t\t\t\[email protected](num)\n\t\t\t\t\t@completed_count+=1\n\t\t\t\t\t@completed_tasks = Hash[@completed_tasks.sort]\n\t\t\t\t\tputs \"Finished #{@completed_tasks[num]}.\"\n\t\t\t\telse\n\t\t\t\t\tputs \"Task #{task} is not in list.\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tupdate\n\t\tend", "def destroy\n begin\n @list = current_user.lists.find params[:list_id]\n @task = @list.tasks.find(params[:id])\n rescue\n current_user.lists.each do |list|\n begin\n @list=list\n @task = @list.tasks.find(params[:id])\n break\n rescue\n\n end\n end\n end\n #print '*'*50\n authorize! :read, @list\n authorize! :destroy, @task\n @task.destroy\n\n respond_to do |format|\n # format.html { render :test=>''}#redirect_to list_path(@list) }\n format.json { head :no_content }\n end\n end", "def successful_tasks\n @successful_tasks ||= @tasks_results.select(&:success?)\n end", "def check_out\n @current_guests = nil\n end", "def ending_tasks\n each_task.reject do |task|\n task.dependency_forward_any?\n end\n end", "def delete(category,task_index)\n @todo_container[category].each do |task_item|\n if task_item.index == task_index\n task_item.flag = false\n end\n end\n end", "def destroy_multiple\n affected = Task.where(id: params[:task_ids]).destroy_all.size\n\n if affected > 0\n @activity = PublicActivity::Activity.create key: \"task.destroy_multiple\", parameters: { affected: affected }, owner: current_user\n @activity.mark_as_read! for: current_user\n PushNotificationService.new(current_user.id, current_tenant.id).push @activity, :add\n end\n\n respond_to do |format|\n format.html { redirect_to tasks_url(completed: \"yes\"), notice: 'Aufgaben erfolgreich gelöscht.' }\n format.json { head :no_content }\n end\n end", "def done(item)\n @todo_list.each { |todo| todo.update_status if todo.description == item }\n end", "def all_not_done\n self.select { |todo| !todo.done? }\n end", "def get_incomplete\n @task_list.select { |task| task.status == \"incomplete\" }\n end", "def failed_tasks\n each_task.select do |task|\n task.status == :failed\n end\n end", "def start_checkin\n\t#First, let's ask for the name of the task\n\tputs \"Task Name:\"\n\tt_name = gets.chomp\n\t#Now we'll ask for a description\n\tputs \"Description:\"\n\tt_desc = gets.chomp\n\t#and now we'll go to work...\n\tresult = task_checkin(t_name, t_desc)\n\tif result == 0\n\t\tputs \"Your task has been successfully updated.\" \n\tend\nend", "def validate_workflow\n e = 0\n status_usage = Array.new( flow_list.count, 0 )\n obsolete_use = Array.new( flow_list.count, 0 )\n @flow_list.each_with_index do |f,i|\n # count usage\n if f.status_id < 0 or f.status_id >= status_usage.count then\n puts \" status_id outside range: (0,#{flow_list.count})\"\n e += 1\n else\n status_usage[ f.status_id ] += 1\n obsolete_use[ f.status_id ] += 1 if f.obsolete\n end\n # there must be no gaps = undefined flows in the flow_list\n if f.nil? then\n puts \" Missing Flow definition with id = #{ i }\"\n e += 1\n else\n # flow id must match index in flow_list\n if i != f.id then\n puts \" Mismatch of flow_list index #{ i } and flow.id #{ f.id } - they must be identical.\"\n e += 1\n end\n end\n end\n # check number of status labels\n status_usage_sum = status_usage.reduce(0,:+)\n if status_usage_sum != flow_list.count then\n puts \" Number of status labels (#{ status_usage_sum }) does not correspond to number of flows (#{ flow_list.count })\"\n e += 1\n end\n if permit_duplicate_status then\n if status_list.count > flow_list.count then\n puts \" Number of status labels (#{ status_list.count }) must be <= number of flows (#{ flow_list.count })\"\n e += 1\n end\n else\n if status_list.count != flow_list.count then\n puts \" Number of status labels (#{ status_list.count }) must be == number of flows (#{ flow_list.count })\"\n e += 1\n end\n end\n status_usage.each_with_index do |u,i| \n if obsolete_use[ i ] > 0 and obsolete_use[ i ] != u then\n puts \" Status '#{ status_list[ i ]}' must be obsolete for ALL flows or NONE:\\n\" + \\\n \" Remove single obsolete flows manually instead of marking them as obsolete\"\n e += 1\n end\n end\n # check tasks\n @task_list.each_with_index do |t,i|\n # there must be no gaps = undefined tasks in the task_list\n if t.nil? then\n puts \" Missing Task definition with id = #{ i }\"\n e += 1\n else\n # task id must match index in task_list\n if i != t.id then\n puts \" Mismatch of task_list index #{ i } and task.id #{ t.id } - they must be identical.\"\n e += 1\n end\n # all tasks but the initial task must have incoming flows\n if t == @task_list.first then\n if !t.inflows.empty? then\n puts \" Initial Task must not have any incoming flows.\"\n e += 1\n end\n else\n if t.inflows.empty? then\n puts \" Task #{ t.id } '#{ t.label }' cannot be reached: no incoming flows.\"\n e += 1\n end\n end\n # all tasks but the terminal task must have outgoing flows\n if t == @task_list.last then\n if !t.outflows.empty? then\n puts \" Terminal Task must not have any outgoing flows.\"\n e += 1\n end\n else\n if t.outflows.empty? then\n puts \" Task #{ t.id } '#{ t.label }' has no outgoing flows but is not the Terminal Task.\"\n e += 1\n end\n end\n # task label must be unique\n @task_list[ i+1 .. -1 ].each do |s|\n next if s.nil?\n if s.label == t.label then\n puts \" Identical label for tasks #{ t.id } and { s.id }: '#{ t.label }'\"\n e += 1\n end\n end\n t.outflows.each do |fo|\n # flow must be in flow_list\n if fo != @flow_list[ fo.id ] then\n puts \" Outgoing flow from #{ t.id } with status '#{ fo.status }' not found in worklist's flow_list.\"\n e += 1\n end\n # outgoing flow must have a corresponding incoming flow - this should always pass\n if !@task_list[ fo.target_task_id ].inflows.include?( fo ) then\n puts \" Outgoing flow from #{ t.id } with status '#{ status_list[ fo.status_id ]}' is not incoming flow to #{ fo.target_task_id }\"\n e += 1\n end\n # check if obsolete task has non-obsolete outgoing flow\n if t.obsolete and !fo.obsolete then\n puts \" Obsolete task #{ t.id } has non-obsolete outgoing flow\\n\"\\\n \" with status '#{ fo.status }' to task ##{ fo.target_task_id}\"\n e += 1\n end\n end\n t.inflows.each do |fi|\n # flow must be in flow_list\n if fi != @flow_list[ fi.id ] then\n puts \" Incoming flow to #{ t.id } with status '#{ status_list[ fi.status ]}' not found in worklist's flow_list.\"\n e += 1\n end\n # incoming flow must have a corresponding outgoing flow - this should always pass\n if !@task_list[ fi.source_task_id ].outflows.include?( fi ) then\n puts \" Incoming flow to #{ t.id } with status '#{ fi.status }' is not outgoing flow from #{ fi.source_task_id}\"\n e += 1\n end\n # check if obsolete task has non-obsolete incoming flow\n if t.obsolete and !fi.obsolete then\n puts \" Obsolete task #{ t.id } has non-obsolete incoming flow\\n\"\\\n \" with status '#{ fi.status }' from task ##{ fi.source_task_id}\"\n e += 1\n end\n end\n end\n end\n # test initial task\n if @task_list.first.outflows.length > 1 then\n puts\n puts \">>> Warning: Initial Task has more than one outgoing flow:\"\n @task_list.first.outflows.each do |f|\n puts \">>> #{f.to_s}\"\n end\n puts\n end\n # summarize\n puts \" Validation of Tasks: #{ e > 0 ? 'failed' : 'OK' }\"\n @validation_errors += e\n end", "def client_tasks_open\n self.find_all {|e| e.completed.nil? or !e.completed }\n end", "def index\n @tasks = @list.tasks.where(\"type = ?\",\"TaskTemp\").where.not(\"estado = ?\",\"expirada\").order(:prioridad)\n end" ]
[ "0.74488217", "0.6325061", "0.62209827", "0.60691065", "0.5955056", "0.5947984", "0.5934444", "0.59334666", "0.59239626", "0.5891228", "0.5891113", "0.58644843", "0.58197373", "0.5817437", "0.58088315", "0.571243", "0.5675918", "0.56555706", "0.56518376", "0.564893", "0.56436116", "0.5611955", "0.5603462", "0.5582875", "0.5581831", "0.5578001", "0.5576518", "0.5565326", "0.5554541", "0.5550811", "0.5547931", "0.55425185", "0.5510994", "0.5506255", "0.5500808", "0.5492611", "0.5490265", "0.5488421", "0.5483332", "0.54770494", "0.54696494", "0.5448848", "0.54298764", "0.54298764", "0.5424894", "0.54206955", "0.53937566", "0.53837466", "0.5379304", "0.5371368", "0.5368644", "0.5358183", "0.53567797", "0.53523165", "0.5334562", "0.53339326", "0.53305185", "0.5329981", "0.53248066", "0.53244674", "0.532111", "0.53159523", "0.5311191", "0.5310415", "0.53099465", "0.5301778", "0.5295326", "0.5283895", "0.52827424", "0.5281714", "0.5270614", "0.5269744", "0.5264918", "0.525559", "0.5254788", "0.52536136", "0.5239351", "0.5237534", "0.5237212", "0.5228977", "0.52240247", "0.5223032", "0.5210473", "0.52017355", "0.5198016", "0.5193078", "0.5192126", "0.51886934", "0.5184764", "0.51824915", "0.51802063", "0.517675", "0.51746446", "0.51726216", "0.51663285", "0.5165503", "0.51650923", "0.51569", "0.51561373", "0.51526666", "0.51428664" ]
0.0
-1
delete list 1 task 1
def destroy_task(list_id, task_id) path = "lists/#{list_id}/tasks/#{task_id}" params = {} request(path, params, :delete) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy_multiple\n\t @list.delete(params[:id])\n\t redirect_to '/tasks'\n\tend", "def items_list_deletion(tasks_to_delete_list,log_file)\n tasks_to_delete_list.each do |task|\n copy_to_log_file(log_file,\"Task deletion\",to_do_list:to_do_list,id:task)\n remove_an_item(task)\n print_out_all_items\n end\n end", "def delete_task(i)\n filtered_tasks = []\n session_tasks.each_with_index do |task, index|\n filtered_tasks << task unless index.eql?(i)\n end\n @session_tasks = filtered_tasks\n end", "def destroy\n @task_list.destroy\n\n head :no_content\n end", "def deleteTask(id)\n task_to_remove = nil\n @Tasks.each do |task|\n task_to_remove = task if task.ID == id \n end \n \n if task_to_remove != nil \n @Tasks.delete(task_to_remove)\n else\n puts \"No such task to delete\"\n end \n end", "def destroy\n @task_list.tasks.find(params[:id]).destroy\n render nothing: true\n end", "def complete_task(db, id)\n db.execute(\"DELETE FROM list WHERE id=?\", [id])\nend", "def silent_delete(m, ind)\n found_attribs = get(:tasks, ind)\n m.reply \"task not found. please relist and try again\" && return unless found_attribs\n m.reply \"silently deleting the task. Bang!\"\n delete(:tasks, ind)\n end", "def destroy\n\t @task = Task.find(params[:id]) \n\t @task.destroy \n\t @tasks = Task.accessible_by(current_ability) \n\tend", "def delete_task\n\n puts 'Enter task number(ID), please'\n\n entered_id = get_id_input\n\n if @tasks[entered_id]\n\n @tasks.delete(entered_id)\n\n else\n\n no_entry_message\n\n end\n\n end", "def destroy\n begin\n @list = current_user.lists.find params[:list_id]\n @task = @list.tasks.find(params[:id])\n rescue\n current_user.lists.each do |list|\n begin\n @list=list\n @task = @list.tasks.find(params[:id])\n break\n rescue\n\n end\n end\n end\n #print '*'*50\n authorize! :read, @list\n authorize! :destroy, @task\n @task.destroy\n\n respond_to do |format|\n # format.html { render :test=>''}#redirect_to list_path(@list) }\n format.json { head :no_content }\n end\n end", "def destroy\n @list = @task.list\n @task.destroy\n redirect_to user_category_list_path(@list.category, @list)\n end", "def destroy\n DB.execute(\"DELETE FROM tasks WHERE id = ?\", @id)\n end", "def destroy\n DB.execute('DELETE FROM tasks WHERE id LIKE ?', @id)\n end", "def delete(task_number)\n all_tasks.delete_at(task_number - 1) # Deletes Task number selected\n puts \"Task (#{task_number}) has been deleted\" # Confirms that Task has been deleted\n end", "def destroy\n # substituido pela funcao no before_action\n # @task = Task.find(params[:id])\n @task.destroy\n\n redirect_to tasks_path\n end", "def destroy\n find_task\n @task.destroy\n end", "def backend_deleteTask(param) \n @Tasks.delete(param) if @Projects.include? param \n end", "def destroy\n # @task_list = TaskList.find(params[:id])\n @task_list.destroy\n\n respond_to do |format|\n format.html { redirect_to task_lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n begin\n @task_list = @active_project.task_lists.find(params[:id])\n rescue\n return error_status(true, :invalid_task_list)\n end\n \n authorize! :delete, @task_list\n\n @on_page = (params[:on_page] || '').to_i == 1\n @removed_id = @task_list.id\n @task_list.updated_by = @logged_user\n @task_list.destroy\n\n respond_to do |format|\n format.html {\n error_status(false, :success_deleted_task_list)\n redirect_to(task_lists_url)\n }\n format.js { index_lists(@logged_user.member_of_owner?) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Task[params[:id]]\n id = @task.id\n @task.delete\n # Also remove from the pending and completed lists\n @user = User[params[:user_id]]\n Ohm.redis.lrem(@user.pending.key, 1, id)\n Ohm.redis.lrem(@user.completed.key, 1, id)\n session[:current_tab] = 1\n \n respond_to do |format|\n format.html { redirect_to action: 'index', notice: 'Todo was deleted.' }\n format.json { head :ok }\n end\n end", "def delete_by_id(id)\n item = self[id]\n if item\n @tasks.delete_at(index(id))\n end\n end", "def delete_list(id)\n query(\"DELETE FROM todos WHERE list_id = $1\", id)\n query(\"DELETE FROM lists WHERE id = $1\", id)\n end", "def destroy\n @task.destroy\n end", "def destroy\n @task.destroy\n end", "def delete()\n\n client.delete(\"/tasks/#{gid}\") && true\n end", "def destroy\n @page_title = \"Task List Delete\"\n @task_list = TaskList.find(params[:id])\n @task_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(task_lists_url) }\n format.xml { head :ok }\n end\n end", "def delete_tasks(list_of_task_ids, *args)\n #TODO modify this to accept Task objects as well\n #TODO check that this will work because array is of IDs, not hashes\n modify(endpoint, 'delete', desired_class, array_of_hashes, array_field_name, delete_first_result, *args)\n end", "def delete_todo_from_list(list_id, todo_id)\n sql = \"DELETE FROM todos WHERE id = $1 AND list_id = $2\"\n query(sql, todo_id, list_id)\n end", "def destroy\n @task = current_user.lists.find(params[:list_id]).tasks.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.js\n end\n end", "def delete_list(id)\n record \"/todos/delete_list/#{id}\"\n end", "def delete(v)\n\n\tif List.all[v.to_i - 1] == nil\n\n\n\t# id = List.all[v.to_i - 1][:id]\n\n # list_of_ids = []\n\n # List.all.each do |idv|\n\t # list_of_ids << idv.id\n # end\n\n # if (list_of_ids.include?id) == false \n\n # target_id = List.where(id: id)\n\n # if target_id.count == 0\n\n\n clear_screen\n 20.times do blank_line \n end \n \tputs \"Sorry man, there is no such id/person! Did you remember correctly? Please try again..\".center(180)\n blank_line\n puts \"Your list still looks like this! Woohoo!\".center(180)\n sleep(3)\n clear_screen\n normal_list\n blank_line\n else\n id = List.all[v.to_i - 1][:id]\n\n target_person = List.find(id)\n\ttarget_person.destroy\n\n \t# list_of_people = List.where(id: id)\n \t# target = list_of_people[0]\n \t# target.destroy\n \n clear_screen\n 20.times do blank_line \n end \n \tputs \"Muahahhahaahha!! AHHAHA! We've found that person and BLOWN that person up!\".center(180)\n \tblank_line\n \tputs \"THIS IS YOUR UPDATED CONTACT LIST WITH THAT PERSON DEAD! MUAHAHAHHAHA!\".center(180)\n \tsleep(3)\n \tclear_screen\n \tnormal_list\n \tblank_line\n end \nend", "def destroy\n @task.destroy\n redirect_to project_tasklist_path(@project, @tasklist)\n end", "def destroy\n @default_task = DefaultTask.find(params[:id])\n @default_task.destroy\n\n head :no_content\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n redirect_to(tasks_url())\n end", "def destroy\n @task.destroy\n \n head :no_content\n end", "def destroy\n @task.destroy\n redirect_to tasks_path\n end", "def backend_deleteUser(param) \n @Tasks.delete(param) if @Tasks.include? param \n end", "def delete\n newTodos = []\n\n @@allTodos.each { |item|\n if item['id'] != @id\n newTodos.push(item)\n end\n }\n\n @@allTodos = newTodos\n Todo.presist_data\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to(task_list_url(params[:task_list_id])) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t @task = Task.find(params[:id])\n\t @task.destroy\n\t redirect_to '/tasks'\n\tend", "def destroy\n @task = Task.find(params[:id])\n @task_efforts = Effort.where(:task_id => @task.id)\n @task_efforts.map(&:destroy)\n destroy!\n end", "def delete_similar(user, taskname)\n Assignment.all.each do |assignment_instance|\n if assignment_instance.taskname == taskname\n assignment_instance.delete \n # puts \"#{user.name} finishes #{assignment_instance.taskname}\"\n end\n end \n end", "def destroy\n @task.destroy!\n end", "def delete_task id\n request :delete, \"tasks/#{id}\"\n nil\n end", "def delete(category,task_index)\n @todo_container[category].each do |task_item|\n if task_item.index == task_index\n task_item.flag = false\n end\n end\n end", "def destroy\n @task.destroy\n success_task_destroy\n end", "def task_remove(task_name)\n return unless task_present? task_name\n tasks.delete prepare_key(task_name)\n reset\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\tredirect_to admin_session_path\n end", "def removeSimpleTask _obj, _args\n \"_obj removeSimpleTask _args;\" \n end", "def destroy\n @task.destroy\n redirect_to tasks_path\n end", "def destroy_task(id)\n task = Task.find(id)\n task.destroy\n task.save\nend", "def destroy\n @task_list.destroy\n respond_to do |format|\n format.html { redirect_to task_lists_url, notice: 'List was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def remove(task_id)\n @tasks.delete_at(task_id - 1)\n end", "def remove(task_id)\n @tasks.delete_at(task_id - 1)\n end", "def delete(task)\n raise ArgumentError, \"Task expected, got #{task.class}.\" unless task.is_a?(Task)\n\n @tasks.delete_if { |t2| t2.to_s == task.to_s }\n end", "def delete_tasks conditions\n tasks.where(conditions).map(&:destroy)\n end", "def delete\n \n end", "def delete!\n uniq.bulk_job { |e| e.delete! }\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to lists_url, notice: \"Task was successfully deleted.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @task_list.destroy\n respond_to do |format|\n format.html { redirect_to task_lists_url, notice: 'Task list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def tasks() []; end", "def destroy_multiple\n affected = Task.where(id: params[:task_ids]).destroy_all.size\n\n if affected > 0\n @activity = PublicActivity::Activity.create key: \"task.destroy_multiple\", parameters: { affected: affected }, owner: current_user\n @activity.mark_as_read! for: current_user\n PushNotificationService.new(current_user.id, current_tenant.id).push @activity, :add\n end\n\n respond_to do |format|\n format.html { redirect_to tasks_url(completed: \"yes\"), notice: 'Aufgaben erfolgreich gelöscht.' }\n format.json { head :no_content }\n end\n end", "def delete_task\n task = MailTasks::Task.find( params[:id] )\n task.update_attribute( :deleted, true )\n flash[:notice] = \"Task \\\"#{task.name}\\\" has been deleted!\"\n redirect_to :action => \"index\"\n end", "def remove_all_tasks\n ids = []\n Task.all.each { |task| ids << task.id }\n delete_tasks_from_todoist(ids)\n Task.destroy\n end", "def remove_in_progress_task\n $redis.del(\"#{studio.studio_id}:#{ip}\")\n end", "def destroy\n @reminder_task_list = ReminderTaskList.find(params[:id])\n @reminder_task_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(reminder_task_lists_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n head :no_content\n end", "def destroy\n @short_term_goal = ShortTermGoal.find(params[:id])\n @short_term_goal.tasks.each do |task|\n task.destroy\n end\n @short_term_goal.destroy\n\n respond_to do |format|\n format.html { redirect_to(short_term_goals_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task.destroy\n redirect_to action: \"index\", notice: 'Task was successfully destroyed.' \n end", "def destroy\n @task_list = TaskList.find(params[:id])\n @project = @task_list.project\n respond_to do |format|\n if @project.project_members.find_by_user_id(current_user.id) != nil\n if @project.project_members.find_by_user_id(current_user.id).role == \"owner\" \n @task_list.tasks.each do |task|\n task.destroy\n end\n @task_list.destroy\n format.html { redirect_to @project, notice: 'Task list deleted.' }\n format.json { render json: @project }\n else\n format.html { redirect_to @project, alert: 'You dont have permission to delete the selected Task List.' }\n format.json { head :no_content }\n end\n else\n format.html { redirect_to @project, alert: 'You dont have permission to delete the selected Task List.' }\n format.json { head :no_content }\n end\n end\n end", "def delete_item(list_name,name)\n if storage.list_exists?(list_name)\n list = List.find(list_name)\n if list.delete_item(name)\n output \"#{cyan(\"Boom!\")} #{yellow(name)} is gone forever.\"\n save\n else\n output \"#{yellow(name)} #{red(\"not found in\")} #{yellow(list_name)}\"\n end\n else\n output \"We couldn't find that list.\"\n end\n end", "def destroy\n @task.destroy\n head :no_content, status: :ok\n end", "def delete(index)\n todo = @items.delete_at(index.to_i-1)\n save\n todo\n end", "def delete(id_string)\n id = id_string.to_i\n @tasks.each do |project_name, project_tasks|\n project_tasks.each do |task|\n project_tasks.delete_if {task.id == id_string.to_i}\n end\n end\n end", "def delete(item, list)\n\tlist.delete(item)\nend", "def delete_item(list,item)\n list.delete(item)\n list\nend", "def delete_item(list,item)\n list.delete(item)\n list\nend", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n Task.find_by_name(unescape_url(params[:id]))\n respond_to do |format|\n format.html { redirect_to(tasks_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @task = current_user.tasks.find(params[:id])\n @task.destroy\n @tasks = current_user.tasks.order(\"created_at DESC\")\n \n respond_with @task do |format|\n format.html { redirect_to tasks_path }\n end\n end", "def destroy\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_url }\n end\n end", "def delete_item(list_item)\n @list.delete(list_item)\n @list\n end", "def remove list\n list_action list, \"remove\"\n end", "def delete_item(list, item)\n del_list = list.delete(item)\nend", "def delete\n\t @name = self.name\n\t @tasks = nil\n\t if plan\n\t\tplan.remove_object(self)\n\t else\n\t\tclear_relations\n\t\tfreeze \n\t end\n\tend", "def destroy\n @task_list = TaskList.find(params[:id])\n @task_list.update_attributes(:active => 0)\n \n respond_to do |format|\n format.html { redirect_to project_path(@project) }\n format.json { head :no_content }\n end\n end", "def delete_item(list, item)\n list.delete(item)\n list\nend", "def delete_item(list, item)\n list.delete(item)\n list\nend", "def destroy\n @task = Node.find(params[:id])\n @task.destroy\n respond_to do |format|\n format.html { redirect_to tasks_path}\n format.json { head :no_content }\n end\n \n end", "def destroy\n name = @task.name\n @task.destroy\n\n render json: [\"You have successfullly deleted '#{name}''\"], status: 200\n end", "def undef_tasks(name, list)\r\n\t namespace name do\r\n\t metaclass = class << self; self; end\r\n\t list.each do |k|\r\n\t k = k.to_sym \r\n\t metaclass.send(:undef_method, k)\r\n\t tasks.delete k\r\n\t end\r\n\t end\r\n\t end", "def delete_task\n @task = Task.find_by(id: params[:id])\n @task.destroy\n render :json => @task.as_json(:only => [:id])\n end", "def destroy\n tmp_element_error = PostitTask.new\n tmp = PostitTask.find(params[:id])\n if tmp\n name = tmp.name\n unless tmp.destroy\n tmp.errors.full_messages.each do |tmp_error| \n tmp_element_error.errors.add(:base, tmp_error)\n end\n end\n end\n if tmp_element_error.errors.empty? \n flash[:notice] = 'Cette tâche a correctement été supprimée.'.trn\n else\n flash[:errors_destroy] = tmp_element_error\n end\n redirect_to :action => \"list\"\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :ok }\n end\n end", "def delete_list(list)\n @lists[list.title].delete(list.title)\n end", "def delete_item(list, item)\n\tdel_list = list.delete(item)\nend", "def delete!\n uniq.both_e.uniq.bulk_job { |e| e.delete! }\n uniq.bulk_job { |e| e.delete! }\n end", "def destroy\n @task = Task.find(params[:id])\n @task.destroy\n\n respond_to do |format|\n format.html { redirect_to tasks_url }\n format.json { head :ok }\n end\n end", "def delete_item(list, item)\n\tlist.delete(item)\n\tlist\nend", "def destroy\n @task.destroy\n set_tasks\n respond_to do |format|\n format.js { render_index }\n format.json { head :no_content }\n end\n end" ]
[ "0.74499184", "0.74246424", "0.7383013", "0.7267619", "0.7146352", "0.71208733", "0.71060187", "0.7089439", "0.6990777", "0.697835", "0.6913286", "0.6911017", "0.690578", "0.68853194", "0.6857508", "0.68467265", "0.6822805", "0.6809336", "0.6747672", "0.6716759", "0.6700191", "0.6650525", "0.66434854", "0.6633207", "0.6633207", "0.66315067", "0.6626021", "0.66155714", "0.6575555", "0.65356815", "0.6534752", "0.65208536", "0.65200245", "0.65183944", "0.6511397", "0.650749", "0.6505965", "0.64985454", "0.649477", "0.6492711", "0.6485079", "0.6484443", "0.64710283", "0.6464734", "0.6451561", "0.6442343", "0.64278775", "0.6412569", "0.6398099", "0.6378635", "0.6375519", "0.63731766", "0.6362281", "0.63621354", "0.63621354", "0.6359714", "0.635742", "0.6357413", "0.6356429", "0.63542956", "0.6324606", "0.6306365", "0.63025653", "0.6302549", "0.6299596", "0.62685174", "0.6261716", "0.6255299", "0.62469894", "0.6242851", "0.6242533", "0.62403756", "0.6240017", "0.62368816", "0.62352854", "0.62238777", "0.62188315", "0.62188315", "0.62092865", "0.6200813", "0.6200239", "0.6173442", "0.6168887", "0.6168874", "0.61666435", "0.6154674", "0.61539", "0.61539", "0.614719", "0.6143614", "0.6140925", "0.6138953", "0.6131172", "0.6124718", "0.6124192", "0.61236656", "0.61236054", "0.61230606", "0.6116519", "0.61125475" ]
0.67304647
19
A toy... Tries to calculate the method name you want by camelizing it and doing a get.
def method_missing(name, *args) options = args.first options = {} unless options.kind_of?(Hash) method_name = toCamel(name) get(options.merge(:method => method_name)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def method_name; end", "def specialize_method_name( name )\n return \"#{name}#{self.class.name.split(\"::\")[-1].gsub(/[A-Z]/){|s| \"_#{s.downcase}\"}}\".intern\n end", "def calls_by_method_name; end", "def doubles_by_method_name; end", "def name\n 'method 2'\n end", "def method_name\r\n method_info[:method_name]\r\n end", "def lookup_method(method_name_)\n @level_methods[method_name_.to_sym]\n end", "def api_method\n @_api_method ||= \"#{method_from_class_name}.get\"\n end", "def method(method_name)\n \n @_method = method_name.to_s\n \n end", "def method_missing(method)\n\t\t self[method]\n\t\tend", "def build_method_name\n \"#{METHOD_PREFIX}#{super}\"\n end", "def build_method_name\n \"#{METHOD_PREFIX}#{super}\"\n end", "def camelize_methodname\n self.titleize.gsub(' ', '').camelize(:lower)\n end", "def method_missing(meth, *args, &block)\n # method in Ruby are all lowercase...\n if meth.to_s =~ /_[a-z0-9]+_order/\n STDERR.print(\"[!] method #{meth} not defined yet...\\n\")\n Kernel.exit 1\n else\n super\n end\n end", "def method_missing(method_name, box_id)\n # get_(bone / kibble / treat )_(info / tastiness) and pass 'box_id'\n raise \"Simple argument error\" unless box_id.is_a?(Integer)\n\n method_name = method_name.to_s\n\n if method_name.start_with?(\"get_\")\n attr_str = method_name[(\"get_\".length)..-1]\n attr_names = attr_str.split(\"_\")\n\n raise 'Second-level method name error' unless attr_names.length == 2\n\n food , data_request = attr_names\n\n return data[box_id][\"#{food}\"][\"#{data_request}\"]\n else\n raise 'Simple method name error'\n end\n end", "def genability_method_name_converter(method_name)\n method_name.to_s.gsub(/(?:^|_)(.)/){ $1.upcase }.gsub(/^[A-Z]/){ $&.downcase }.to_sym\n end", "def method_missing(method_id) #search for method, if it doesn't have it go up the chain, doesn't find it, and comes back and finds method missing\n singular_currency = method_id.to_s.gsub( /s$/, '') #if there is an 's' at the end take it out \n if @@currencies.has_key?(singular_currency) #check if we have the currency \n self * @@currencies[singular_currency] # This multiplys the self by the multiplier, creates a method on the fly\n else\n super #just return the super\n end\n end", "def dispatch_method_names(command, type = 'bot')\n [type + '_' + command.join('_').downcase,\n type + '_' + command.first.downcase]\n end", "def method_missing(sym, *args, &block)\n if (not sym.to_s =~ /\\?$/) and (args.length == 0)\n camel_case = Util.to_camel_case(sym.to_s)\n return self[camel_case] if sc_path_defined?(camel_case) \n end\n super\n end", "def method_missing(meth, *args)\n meth = meth.to_s\n meth.sub!(/^high_five:/, '')\n # if (!meth.match(/:/))\n # meth = \"high_five:#{meth}\"\n # end\n super meth, *args\n end", "def method_missing(meth, *args, &block)\n retrieve(meth.to_s)\n end", "def map_name(name)\n # HACK: get from zentest\n name = METHOD_MAP[name] if METHOD_MAP.has_key? name\n name.to_s.sub(/(.*)\\?$/, 'is_\\1').intern\n end", "def method_missing(meth, *args, &block)\n label = meth.to_s.gsub('_', ' ')\n label = label.singularize if is_plural = (label == label.pluralize)\n if label = (labels.find { |candidate| candidate.downcase == label }) || label.capitalize\n return is_plural ? results_for(label) : result_for(label)\n end\n super\n end", "def getter_method_names; end", "def method(name)\n component.method(name.to_sym)\n end", "def method_name\n\n end", "def method_name\n\n end", "def method_name\n\n end", "def method_missing(method, *args, &block)\n # Check string keys first, original and downcase\n string_method = method.to_s\n\n if raw_hash.key?(string_method)\n return self[string_method]\n elsif raw_hash.key?(string_method.downcase)\n return self[string_method.downcase]\n end\n\n if string_method =~ /[A-Z+]/\n string_method = string_method.snakecase\n end\n\n index = string_method.downcase.to_sym\n # Check symbol key and return local hash entry.\n return self[index] if raw_hash.has_key?(index)\n # Then delegate to hash object.\n if raw_hash.respond_to?(method)\n return raw_hash.send(method, *args)\n end\n # Finally return nil.\n nil\n end", "def method\n return @method if defined? @method\n @method = headers[METHOD_KEY]\n @method = @method.downcase.to_sym if @method\n @method\n end", "def getter\n @getter ||= @name.to_sym\n end", "def singularized_method_name method\n (method.predicate? ? method[0..-2] : method).singularize.to_sym\n end", "def method_symbol\r\nHTTP_METHOD_LOOKUP[method]\r\nend", "def method_name\n deface_hash = Deface::Override.digest(:virtual_path => @virtual_path)\n\n #we digest the whole method name as if it gets too long there's problems\n \"_#{Deface::Digest.hexdigest(\"#{deface_hash}_#{super}\")}\"\n end", "def lookup_method_to_call( default_value=nil )\n @_method ||= nil\n @_method.nil? ? default_value.to_s : @_method\n end", "def selectify(method_name)\n matches = method_name.to_s.match( /([\\w_]+)!$/)\n matches ? \"##{matches[1]}\" : \".#{method_name}\"\n end", "def selectify(method_name)\n matches = method_name.to_s.match( /([\\w_]+)!$/)\n matches ? \"##{matches[1]}\" : \".#{method_name}\"\n end", "def method\n @name\nend", "def method_missing(meth, *args, &blk)\n c.key?(meth.to_s) ? c[meth.to_s] : super\n end", "def method\n attributes.fetch(:method)\n end", "def method(method = nil)\n return @method if method.nil?\n\n @method = method.to_s.capitalize\n end", "def method\n @method\n end", "def method_missing(method_id, params = {})\n request(method_id.id2name.gsub(/_/, '.'), params)\n end", "def find_method method_name, klass\n return nil if sexp? method_name\n method_name = method_name.to_sym\n\n if method = @method_cache[method_name]\n return method\n end\n\n controller = @tracker.controllers[klass]\n controller ||= @tracker.libs[klass]\n\n if klass and controller\n method = controller[:public][method_name]\n method ||= controller[:private][method_name]\n method ||= controller[:protected][method_name]\n\n if method.nil?\n controller[:includes].each do |included|\n method = find_method method_name, included\n if method\n @method_cache[method_name] = method\n return method\n end\n end\n\n @method_cache[method_name] = find_method method_name, controller[:parent]\n else\n @method_cache[method_name] = { :controller => controller[:name], :method => method[:src] }\n end\n else\n nil\n end\n end", "def method_missing(sym, *args)\n ret_val = get_val(sym.to_s)\n if ret_val.nil? && @rally_rest.rally_rest_api_compat\n ret_val = get_val(camel_case_word(sym))\n end\n ret_val\n end", "def method\n return @method\n end", "def get_Method(initial)\n\tinitial.split(' ',3)[0]\nend", "def method_missing(method_name, *args, &block)\n # Quick check to see if changes or was are being called, this check\n # keeps us from needing to parse out the parts if we're not going\n # to use them.\n if method_name =~ /[_](changes|was)$/\n # Break apart the method call\n # TODO: no destructuring because of https://github.com/opal/opal/issues/663\n *parts = method_name.to_s.split('_')\n action = parts.pop\n key = parts.join('_').to_sym\n\n # Handle changes or was calls.\n case action\n when 'changes'\n return changes(key)\n when 'was'\n return was(key)\n end\n end\n\n # Otherwise, run super\n super\n end", "def name\n \"#{@method_name}(#{self.class.name})\"\n end", "def method_name\n double_injection.method_name\n end", "def method_symbol; end", "def method_missing(method, *args)\n self[method]\n end", "def method_missing(method_sym, *arguments, &block)\n method = method_sym.to_s\n\n #puts \"%s %s %s\" % [\"---- \", method, \" ----\"]\n #\n if method =~ /^[A-Z]\\d{2}(_\\d{2})?/\n Array(parse(get_spec(method))).join(', ') rescue ''\n elsif respond_to?((/(\\w+)/.match(method))[0])\n instance_eval(method) rescue ''\n # for testing:\n elsif %w(E_STRING E_MULTI_STRING E_NUMBER E_DATETIME E_DATE E_TIME E_YES_NO E_SINGLE E_MULTIPLE E_ALLOW_NEGATIVE E_LOOKUP).include?(method)\n Array(parse(get_spec(method))).join(', ') rescue ''\n else\n super\n end\n end", "def method_missing(method_name, *method_args)\n get(method_name) || super.method_missing(method_name, *method_args)\n end", "def method(name=nil) # :nodoc:\n return name ? super : @meth\n end", "def method_missing(method, *args, &block)\n if name?(method.to_sym)\n find(method.to_sym)\n else\n super\n end\n end", "def aliased_method_name(method_name)\r\n last_letter = method_name.to_s[method_name.to_s.size-1]\r\n if %w(? !).member? last_letter\r\n # remove ? and ! from the middle and put it to the end\r\n (method_name.to_s.chop!+\"_in_#{self.simple_name.to_snake_case}#{last_letter}\").to_sym\r\n else\r\n (method_name.to_s+\"_in_#{self.simple_name.to_snake_case}\").to_sym\r\n end\r\n end", "def context_name_for(method); end", "def parse_method(method)\n method.downcase.to_sym\n end", "def sanitize_method_name( name )\n name.to_s.camelize\n end", "def method\n @method\n end", "def method\n @method\n end", "def method_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 3]\n end", "def report_method_stuff(requested_method_name, methods)\n entries = methods.find_all {|m| m.name == requested_method_name and (\n !@onlyLoadedClasses or \n Object.class_eval \"defined? #{m.nameSpace.full_name}\" ) }\n case entries.size\n when 1\n method = @ri_reader.get_method(entries.first)\n @display.display_method_info(method)\n when 0\n puts \"No loaded methods matched your request\"\n else\n @display.display_method_list(entries)\n end\n end", "def get_custom_field_name_for_method(meth)\n if meth.to_s =~ /^(.+)=$/\n meth = $1\n end\n meth\n end", "def method_missing(method, *args, &block)\n if @hash.key?(method.to_s.to_sym)\n @hash[method.to_s.to_sym]\n else\n @hash.send(method, *args, &block)\n end\n end", "def method_missing(method_name, *args, &block)\n ignore_list = [:to_hash]\n return if ignore_list.include? method_name\n\n respond_to?(method_name) ? attribute(method_name.to_s.tr('_', '-')) : super\n end", "def method_Code\n method = \"method_Code\"\n end", "def lookup_method(recv, name)\n key = if recv\n [recv.class.name.to_sym, name]\n else\n [nil, name]\n end\n \n @methods[key]\n end", "def method_name?(key)\n key.is_a?(Symbol) && /^__(?<name>.+)__$/ =~ key ? name.to_sym : nil\n end", "def method_missing(method, *args) # {{{\n return @data[method.to_sym] if @data[method.to_sym]\n end", "def method_missing method, *args, &block\n if args.size > 1\n raise ArgumentError.new \"wrong number of arguments (#{args.size} for 0..1)\"\n end\n\n args.push({}) if args.size == 0\n\n method = method.to_s.split('_').inject([]){ |b,e| b.push(b.empty? ? e : e.capitalize) }.join\n\n call(method, args[0])\n end", "def fetch(key)\n methods.fetch(key)\n end", "def generic_getter(name)\n send(name)\n end", "def lookup_method name\n found = load_methods_matching name\n\n if found.empty?\n if check_did_you_mean\n methods = []\n _, _, method_name = parse_name name\n find_methods name do |store, klass, ancestor, types, method|\n methods.push(*store.class_methods[klass]) if [:class, :both].include? types\n methods.push(*store.instance_methods[klass]) if [:instance, :both].include? types\n end\n methods = methods.uniq\n suggestions = DidYouMean::SpellChecker.new(dictionary: methods).correct(method_name)\n raise NotFoundError.new(name, suggestions)\n else\n raise NotFoundError, name\n end\n end\n\n filter_methods found, name\n end", "def method_missing(meth, *args) = parameters.has_key?(meth) ? parameters[meth] : meth", "def method_missing(method_sym, *arguments, &block)\n if self[\"#{method_sym.to_s}\"] != nil\n self[\"#{method_sym.to_s}\"]\n else\n super\n end\n end", "def method_missing(method, *args) #:nodoc:\n self[method]\n end", "def method_for(action = nil, method = nil)\n @method_for ||= (superclass.respond_to?(:method_for) ? superclass.method_for : {})\n return @method_for if action.nil?\n\n action = action.to_s.downcase.to_sym\n\n return @method_for[action] if method.nil?\n @method_for[action] = method.to_s.downcase.to_sym\n end", "def method_for(action = nil, method = nil)\n @method_for ||= (superclass.respond_to?(:method_for) ? superclass.method_for : {})\n return @method_for if action.nil?\n\n action = action.to_s.downcase.to_sym\n\n return @method_for[action] if method.nil?\n @method_for[action] = method.to_s.downcase.to_sym\n end", "def method\n self.class.name.split('::').last || ''\n end", "def method_name=(_arg0); end", "def method_name=(_arg0); end", "def method_name\n return @method_name if defined? @method_name\n\n @method_name = protocol_name.downcase.sub(/::/, '_')\n end", "def method_missing(method_name, *args)\n return @raw_result.send(method_name) if @raw_result.respond_to?(method_name)\n return @raw_result[method_name.to_s] rescue \"brak\"\n end", "def getter_method_names\n @getter_method_names ||= instance_methods.map!(&:to_s).tap do |list|\n list.reject! { |item| item.end_with?(\"=\") }\n end\n end", "def test_Method_InstanceMethods_meth\n\t\tmethod = \"cat\".method(:upcase)\n\t\tassert_equal(\"upcase\", method.name.to_s)\n\tend", "def add_method_name(current_string)\n adjusted_method_name = if @method_name.present? && (@method_name[0] == '/' || @method_name[0] == '.')\n log_hint(BuilderHints::METHOD_NAME_LEADING)\n \"#{@method_name} \"\n else\n \"/#{@method_name} \"\n end\n add_if_present(@method_name, current_string, adjusted_method_name)\n end", "def human_name_for(instance, method)\n I18n.t(\"activerecord.attributes.#{instance}.#{method}\", :default => method.to_s.humanize)\n end" ]
[ "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.70926154", "0.7043137", "0.69305927", "0.6896975", "0.682905", "0.66783375", "0.6666171", "0.665963", "0.66383266", "0.65833724", "0.6516399", "0.6516399", "0.6513389", "0.6458467", "0.6442074", "0.64418113", "0.6436261", "0.6435098", "0.6425577", "0.64110357", "0.64071566", "0.6407127", "0.6395827", "0.63933295", "0.6378482", "0.6373309", "0.6373309", "0.6373309", "0.6372968", "0.6370027", "0.636715", "0.6366011", "0.63621753", "0.6347215", "0.6329147", "0.6324042", "0.6324042", "0.6320262", "0.63193846", "0.6308812", "0.6307411", "0.63068193", "0.6304238", "0.6302358", "0.6300004", "0.6297345", "0.6286393", "0.62791425", "0.6276455", "0.62631327", "0.62615275", "0.62612617", "0.62561345", "0.62544125", "0.62518895", "0.6251713", "0.62397814", "0.62374634", "0.62062055", "0.619562", "0.61945915", "0.61945915", "0.6185855", "0.6183305", "0.6178438", "0.6177547", "0.61513126", "0.61467534", "0.6145431", "0.6138563", "0.61348563", "0.613311", "0.6131049", "0.6125659", "0.612175", "0.61197466", "0.60963064", "0.6091173", "0.6087414", "0.6087414", "0.60779166", "0.6072234", "0.6072234", "0.6053012", "0.6049275", "0.6046311", "0.6041307", "0.60334337", "0.60055953" ]
0.6356226
44
generate a namespace (event, user, etc) from the current class name
def namespace @intf_namespace ||= self.class.name.split('::').last.downcase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def full_name\n \"#{namespace.name || namespace.inspect}::#{namespace.instances[ self ]}\"\n end", "def namespace\n @namestack.join(\"::\")\n end", "def name\n (@name ||= namespace).to_s.underscore.symbolize\n end", "def namespace\n return self.name ? self.name.downcase.gsub(/[^0-9A-Za-z ]/, '').gsub(' ', '-') : ''\n end", "def namespaced_class_name(name)\n class_name = \"#{name.split('/').map(&:camelize).join('::')}Controller\"\n if @namespaces.empty?\n class_name\n else\n @namespaces.map { |namespace| \"#{namespace.camelize}::\" }.join('') + class_name\n end\n end", "def underscorized_classname\n self.class.name.split(\"::\").last.\n gsub( /([A-Z]+)([A-Z][a-z])/, '\\1_\\2' ).\n gsub( /([a-z\\d])([A-Z])/, '\\1_\\2' ).downcase\n end", "def classname(name)\n [@lexer.namespace, name].join(\"::\").sub(/^::/, '')\n end", "def namespace\n @namespace ||= self.class.to_s.split('::').first.gsub('_', '').sub('Application', '')\n end", "def namespace_name\n @namespace_name ||= namespaces.join('::')\n end", "def ns (klass) #name symbol.\n\tklass.name.to_sym\nend", "def qualified_to_name; end", "def compute_event_class_name(event)\n # User::EventStore => User::CreatedEvent\n self.class.name.gsub(/::EventStore/, \"::#{event.to_s.camelize}Event\") \n end", "def class_name\n self.to_s.demodulize.underscore\n end", "def class_name\n self.class.name.split(\"::\").last.downcase\n end", "def ns_constantize\n to_s.gsub('__', '::').constantize\n end", "def class_name\n self.class.to_s.split('::').last\n end", "def namespace_module\n klass.name.to_s.split('::')[0..-4].join('::').constantize\n end", "def class_name\n self.class.name.split(\"::\").last\n end", "def name_from_object(class_name)\n class_name.split('::').last\n end", "def qualified_from_name; end", "def qualified_from_name; end", "def name\n camel = self.class.to_s.gsub(/.*::/, '')\n camel.gsub(/(\\S)([A-Z])/, '\\1_\\2').downcase\n end", "def class_name_for(module_name, name)\n \"#{module_name}::#{class_name(name)}\"\n end", "def name\n klass.name.split('::').last\n end", "def base_class_name\n split('::').last\n end", "def variable_name_to_class_name(name)\n name.to_s.\n gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.\n gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def variable_name_to_class_name(name)\n name.to_s.\n gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.\n gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def classname\n @classname ||= self.class.name.split(\"::\")[1..-1].join(\"::\")\n end", "def name\n map_to_namespace(@name)\n end", "def objective_class_name namespace_name\t\n\tif namespace_name.scan(/::/).count > 0\n\t\tnamespace_name.split(\"::\").map { |word|\n\t\t\tif word.scan(/[A-Z]/).count > 0\n\t\t\t\tword\n\t\t\telse\n\t\t\t\tword.capitalize\n\t\t\tend\n\t\t}.join\n\telsif namespace_name.scan(/_/).count > 0\n\t\tnamespace_name.split(\"_\").map { |w|\n\t\t\tw.capitalize\n\t\t}.join\n\telsif namespace_name[0].scan(/[A-Z]/).count > 0\n\t\tnamespace_name\n\telse\n\t\tnamespace_name.capitalize\n\tend\nend", "def base_filename; class_to_filename(name.gsub(/.*:/, '')); end", "def generate\n base_name = camel_case identifier.to_s\n decorate_klass_name base_name\n end", "def namespace\n \"#{database.name}.#{name}\"\n end", "def namespace\n \"#{database.name}.#{name}\"\n end", "def class_name_for(object)\n object.name.split('.').first.downcase.tr('_', '-')\n end", "def name\n n = self.class.name\n n.gsub!( /::/, '.' )\n n.gsub( /(\\w)\\w+\\./ ) { |m| $1.downcase + '.' }\n end", "def my_name \n @my_name ||= self.class.name.split(\"::\").last\n end", "def construct_klass(name)\n name.to_s.split('_').map{|i|i.capitalize}.join\n end", "def name\n self.class.name.split(\"::\").last.downcase\n end", "def format\n self.class.name.split('::').last.downcase.to_sym\n end", "def __name__\n ɴ = self.class.__instances__[ self ]\n namespace.name_get_hook.( ɴ ) if ɴ\n end", "def my_name\n @my_name ||= self.class.name.split(\"::\").last\n end", "def name\n self.class.name.split('::').last\n end", "def namespace\n self.class.new split(NAMESPACE_SEPARATOR).first\n end", "def tag(namespace = '')\n namespace + self.class.to_s.split(/::/).last\n end", "def class_name_to_variable_name(name)\n name.to_s.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end", "def class_name_to_variable_name(name)\n name.to_s.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end", "def full_class_name\n @class_names.join(\"::\")\n end", "def class_name(name)\n name, anchor = name.to_s.split(\"#\", 2)\n name = File.basename(name, \".json\")\n name = name + \"_\" + anchor if anchor.present?\n name.gsub(/[^\\w]/, \"_\").camelcase\n end", "def qualified_name_for(mod, name)\n mod_name = to_constant_name mod\n mod_name == \"Object\" ? name.to_s : \"#{mod_name}::#{name}\"\n end", "def name\n self.class.name.split('::').last\n end", "def name\n self.class.to_s.split('::').last\n end", "def to_class_name\n parts = downcase.split('/')\n parts.each(&:capitalize!)\n parts.join('').gsub(%r{-}, '')\n end", "def current_class_name\n @klass.to_s\n end", "def name\n has_module?(klass) ? klass[(klass.index(\"::\")+2)..-1] : klass\n end", "def app_name ; self.class.rootname.snake_case.to_sym ; end", "def namespace\n self.class.namespace\n end", "def class_name\n self.fullname[/\\A(.*)([\\.\\#])([^\\.\\#]+)\\z/, 1]\n end", "def name\n @name ||= Rails.application.class.parent_name.underscore\n end", "def to_type_name(name, namespace = '')\n return namespace + to_type_name(name) unless namespace.blank?\n name = name.to_s\n name = name.camelize(:upper) if Rails.config.camel_case\n name = name.gsub(/\\W/, '_')\n name\n end", "def json_class_name\n [self.class.domain_module, self.class.name.demodulize].join('::')\n end", "def class_name\r\n r = \"\"\r\n up = true\r\n each_byte do |c|\r\n if c == 95\r\n if up\r\n r << \"::\"\r\n else\r\n up = true\r\n end\r\n else\r\n m = up ? :upcase : :to_s\r\n r << (c.chr.send(m))\r\n up = false\r\n end\r\n end\r\n r\r\n end", "def full_name\n if namespace\n \"#{namespace}#{SEPARATOR}#{name}\"\n else\n \"#{name}\"\n end\n end", "def class_name object\n return object.class.to_s.split(/(?=[A-Z])/).join(' ')\n end", "def class_to_filename (c)\n c.split(/::/).map {|i| i.gsub(/([A-Z])/, '_\\1').sub(/_/, '').downcase}.\n join('/')\nend", "def _namespace_class(ns)\n return unless ns\n Ing::Util.decode_class(ns.gsub(/:$/,\": \"))\n end", "def name_and_class\n [name, self['class']].compact.join('.')\n end", "def fully_qualified_name\n return \".#{self.package}\"\n end", "def class_name method_name\n segments = method_name.split('::')\n return segments[0..-2].join('::') if segments.count > 1\n \"Object\"\nend", "def full_name\n klass.name\n end", "def full_name\n decorated_class_name = case self.klass_flags\n when 0x2\n \"<Class::#{klass_name}>\"\n when 0x4\n \"<Module::#{klass_name}>\"\n when 0x8\n \"<Object::#{klass_name}>\"\n else\n klass_name\n end\n\n \"#{decorated_class_name}##{method_name}\"\n end", "def class_name\n Jaspion::Kilza::Class.normalize(@original_name)\n end", "def inicial\n self.class.name.gsub(/#{Module.nesting.last}::/, '').chr\n end", "def ns_camelize\n to_s.gsub('__', '/').camelize\n end", "def name\n self.class.name.split(\"::\").last\n end", "def name\n self.class.name.split('::').last\n end", "def pretty_class_name\n return self.class.to_s.split(/(?=[A-Z])/).join(' ')\n end", "def class_name\n Heroics.camel_case(name)\n end", "def class_name(subj)\n nm = subj.respond_to?(:class_eval) ? subj.demodulize : subj.class.demodulize\n @class_name = \"#{nm}#{UUIDTools::UUID.random_create.to_s.gsub /-/, ''}\"\n @class_name\n end", "def template_namespace\n @controller.class.to_s.sub('Controller','').underscore.pluralize\n end", "def parse_classname(full_cname)\n names=full_cname.split(\"::\")\n return names[0..-2].join('::'), names[-1], names.join(\"/\") \n end", "def class_name\n @class_name ||= derive_class_name\n end", "def class_name\n name = @klass.name\n name.name\n end", "def klass\n name.gsub(module_name+\"::\",\"\")\n end", "def name\n return self.class.name.split('::').last\n end", "def naming_convention name=nil \n nc = name.present?? name.to_s : ref_name\n if namespace_prefix.present?\n \t nc.split(namespace_prefix).last.camelize\n else\n nc.camelize\n end\n\trescue\n\t\tnil\n end", "def name\n self.class.name.demodulize.underscore\n end", "def locale_klass_name\n @locale_klass_name ||= self.class.name.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr('-', '_').\n downcase\n end", "def _xml_name()\n if name = self.sfa_class\n return name\n end\n self.class.name.gsub('::', '_')\n end", "def prefixed_class_name(prefix)\n (class_path + [\"#{prefix}_#{file_name}\"]).map!(&:camelize).join(\"::\")\n end", "def name\n @name ||= self.to_s.demodulize.underscore\n end", "def event_name(event)\n \"#{self.class.name.underscore}_#{event}\"\n end", "def namespace\n # 2012.3.13 didn't work on Rails 3.0.7, cancan 1.6.7; looks promising, but needs some figuring out.\n #cns = @controller.class.to_s.split('::')\n #cns.size == 2 ? cns.shift.downcase : \"\"\n \n # I am sure there is a slicker way to capture the controller namespace\n # 2012.3.13 But it works!\n controller_name_segments = params[:controller].split('/')\n controller_name_segments.pop\n controller_namespace = controller_name_segments.join('/').camelize\n end", "def getBaseTypeName(var)\n nsPrefix = \"\"\n langType = @langProfile.getTypeName(var.getUType())\n\n if (var.utype != nil) # Only unformatted name needs styling\n baseTypeName = CodeNameStyling.getStyled(langType, @langProfile.classNameStyle)\n else\n baseTypeName = langType\n end\n\n if var.namespace.hasItems?()\n nsPrefix = var.namespace.get(\"::\") + \"::\"\n baseTypeName = nsPrefix + baseTypeName\n end\n\n return baseTypeName\n end", "def namespace\n @namespace ||= [request.args.namespace_name, request.args.application_name].compact.join('-')\n end", "def klass_name\n @klass_name ||= \n if guessed_name = name.scan(/(.*)Session/)[0]\n @klass_name = guessed_name[0]\n end\n end", "def to_s\n \"#{self.class}::#{name}\"\n end", "def make_queue_name(klass)\n name = klass.dup\n name.gsub!(/::/, '/')\n name.gsub!(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2')\n name.gsub!(/([a-z\\d])([A-Z])/,'\\1_\\2')\n name.tr!(\"-\", \"_\")\n name.downcase!\n name\n end", "def to_s\n \"#{self.class}::#{name}\"\n end", "def underscore\n class_name.to_s.underscore\n end" ]
[ "0.7267048", "0.69762367", "0.6961653", "0.69429386", "0.6935046", "0.68862617", "0.6853532", "0.6763192", "0.6729886", "0.67071444", "0.67048514", "0.6654826", "0.66539484", "0.66459274", "0.66385376", "0.6631225", "0.65990484", "0.6581359", "0.6569421", "0.6554335", "0.6554335", "0.65469813", "0.65377235", "0.65267795", "0.6523407", "0.6521396", "0.6521396", "0.6509336", "0.650887", "0.6506585", "0.64904517", "0.64805865", "0.64543235", "0.64543235", "0.6450449", "0.64492387", "0.6448171", "0.6445477", "0.64240503", "0.64029944", "0.63972056", "0.63919187", "0.63839316", "0.6382366", "0.6381535", "0.63739824", "0.63739824", "0.63626814", "0.63621527", "0.6345878", "0.63416624", "0.6341133", "0.63353235", "0.63200265", "0.63146204", "0.6310614", "0.62966263", "0.62818295", "0.6279012", "0.627569", "0.6275434", "0.6264365", "0.6245019", "0.6236959", "0.62353903", "0.62349916", "0.6224319", "0.62203026", "0.62195325", "0.6211673", "0.62108135", "0.620092", "0.61907494", "0.6184305", "0.6177109", "0.6177098", "0.6163008", "0.6158568", "0.6153614", "0.6153237", "0.61504406", "0.61503303", "0.61335945", "0.6130239", "0.6116284", "0.61136377", "0.6111307", "0.6110017", "0.61016583", "0.6099849", "0.6096507", "0.6091961", "0.6091543", "0.60853446", "0.60789716", "0.6078562", "0.6075226", "0.606572", "0.6057951", "0.60577875" ]
0.63125545
55
a convention to represent rising camel not activesupports camelize!
def toCamel(name) parts = name.to_s.split('_') first = parts.shift parts.map! { |part| part.capitalize } first + parts.join end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def camelize!\n self.titleize!\n self.replace(self[0, 1].downcase + self[1..-1])\n end", "def camelize\n # From activesupport/lib/active_support/inflector.rb:178\n gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def camelize\n gsub /(?:^|_)(.)/ do $1.upcase! end\n end", "def camelize\n return self if self !~ /_/ && self =~ /[A-Z]+.*/\n split('_').map{|e| e.capitalize}.join\n end", "def camelize\n self.split('_').collect{|mot| mot.capitalize}.join(\"\")\n end", "def camelize_methodname\n self.titleize.gsub(' ', '').camelize(:lower)\n end", "def camelize\n ActiveSupport::Inflector.camelize(self)\n end", "def camelize\n string = self.dup\n string = string.sub(/^[a-z\\d]*/) { $&.capitalize }\n string.gsub(/(?:_|(\\/))([a-z\\d]*)/) { \"#{$1}#{$2.capitalize}\" }.gsub('/', '::')\n end", "def camelize(lower_case_and_underscored_word)\r\n lower_case_and_underscored_word.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\r\n end", "def camelize(_uppercase_first_letter = true)\n self.dup.camelize!\n end", "def camelize(class_name)\n return class_name if class_name !~ /-/\n class_name.gsub(/(?:-|(\\/))([a-z\\d]*)/) { \"#{$1}#{$2.capitalize}\" }.strip\n end", "def camelize( option=nil )\n if option == :lower\n String.string_camelize(self, false)\n else\n String.string_camelize(self)\n end\n end", "def camelize\n str = dup\n str = str.sub(/^[a-z\\d]*/, &:capitalize)\n str.gsub!(%r{(?:_|(\\/))([a-z\\d]*)}i) do\n \"#{Regexp.last_match(1)}#{Regexp.last_match(2).capitalize}\"\n end\n str.gsub!('/'.freeze, '::'.freeze)\n str\n end", "def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)\n if first_letter_in_uppercase\n lower_case_and_underscored_word.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end\n end", "def camelize s\n s = s.to_s.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def to_camel_case\n return self if self !~ /_/ && self !~ /\\s/ && self =~ /^[A-Z]+.*/\n\n gsub(/[^a-zA-Z0-9ññÑáéíóúÁÉÍÓÚüÜ_]/, \"_\")\n .split(\"_\").map(&:capitalize).join\n end", "def camelizer\n OliveBranch::Transformations.method(:camelize)\n end", "def camel_case\n gsub /(?:^|_)(.)/ do $1.upcase end\n end", "def camelize(str)\n str.split('_').map(&:capitalize).join\n end", "def camelize(term); end", "def camel_case(str); end", "def camelize(first_letter_in_uppercase=true)\n word = self.dup\n if first_letter_in_uppercase\n word.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n else\n word.to_s[0].chr.downcase + word.camelize[1..-1]\n end\n end", "def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)\n if first_letter_in_uppercase\n lower_case_and_underscored_word.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n else\n lower_case_and_underscored_word[0..0].downcase + camelize(lower_case_and_underscored_word)[1..-1]\n end\n end", "def camelize!\n word_separators = /[^a-zA-Z0-9']/\n self.downcase!\n self.each_char.each_with_index do |c,i|\n if self[i-1].chr =~ word_separators or i.zero?\n self[i] = c.upcase if c =~ /[a-z]/\n end\n end\n self\n end", "def un_camelcase( s )\n s.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end", "def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)\n if first_letter_in_uppercase\n lower_case_and_underscored_word.to_s.gsub(/\\/(.?)/) { \"::\" + $1.upcase }.gsub(/(^|_)(.)/) { $2.upcase }\n else\n lower_case_and_underscored_word.first + camelize(lower_case_and_underscored_word)[1..-1]\n end\n end", "def camelize\n dup.tap(&:camelize!)\n end", "def camelize(string)\n string.replace(string.split(\"_\").each {|s| s.capitalize! }.join(\"\"))\nend", "def camelize(name, uc_first=true)\n parts = name.to_s.split('_')\n assemble = lambda { |head, tail| head + tail.capitalize }\n uc_first ? parts.inject('', &assemble) : parts.inject(&assemble)\n end", "def camel_case\n return self if self !~ /_/ && self =~ /[A-Z]+.*/\n split('_').map{|e| e.capitalize}.join\n end", "def camel_case\n return self if self !~ /_/ && self =~ /[A-Z]+.*/\n split('_').map{|e| e.capitalize}.join\n end", "def camelize(str)\n str.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def camelize(term)\n string = term.to_s\n string = string.sub(/^[a-z\\d]*/, &:capitalize)\n string.gsub!(%r{(?:_|(/))([a-z\\d]*)}) { \"#{Regexp.last_match(1)}#{Regexp.last_match(2).capitalize}\" }\n string.gsub!('/'.freeze, '::'.freeze)\n string\n end", "def name\n camel = self.class.to_s.gsub(/.*::/, '')\n camel.gsub(/(\\S)([A-Z])/, '\\1_\\2').downcase\n end", "def to_camel! # no one should change these unless they can benchmark and prove their way is faster. =)\n @cached_camel_strings ||= {}\n @cached_camel_strings[self] ||= (\n # new_string = self.dup # need to do this since sometimes the string is frozen\n while x = index(\"_\")\n y=x+1\n self[x..y] = self[y..y].capitalize # in my tests, it was faster than upcase\n end\n self\n )\n end", "def camelize(string)\n string.split('_').map!(&:capitalize).join\n end", "def camelize(lower_case_and_underscored_word, first_letter_in_uppercase = true)\n if first_letter_in_uppercase\n lower_case_and_underscored_word.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n else\n lower_case_and_underscored_word.first.downcase + camelize(lower_case_and_underscored_word)[1..-1]\n end\n end", "def camelize(term)\n term.to_s.capitalize\n .gsub(/(?:_|(\\/))([a-z\\d]*)/i) { \"#{$1}#{$2.capitalize}\" }\n .gsub('/'.freeze, '::'.freeze)\n end", "def CamelCasetoUnderscore(str)\n str.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end", "def camelize(str)\n str.split('_').inject([]){ |buffer,e| buffer.push(buffer.empty? ? e : e.capitalize) }.join\n end", "def camel_case\n return self if self !~ /_/ && self =~ /[A-Z]+.*/\n split('_').map{|e| e.capitalize}.join\n end", "def camelcase(s)\n\n\nend", "def variablize(original)\n return original.downcase if original =~ /[A-Z]+/ && original !~ /_/\n return original[0].downcase + original[1..-1] if original !~ /_/\n camelized = original.split('_').map { |e| e.capitalize }.join\n camelized[0].downcase + camelized[1..-1]\n end", "def camelize(str)\n str.split(' ').map {|w| w.capitalize}.join if str\nend", "def to_camel\n words = self.split('_')\n capitalized_words = words.map { |word| word.capitalize }\n capitalized_words.join('')\n end", "def camel(value)\n case value\n when Array then value.map { |item| camel(item) }\n when Hash then value.deep_transform_keys! { |key| camel(key) }\n when Symbol then camel(value.to_s).to_sym\n when String then value.underscore.camelize\n else value\n end\n end", "def camelize(term)\n string = term.to_s\n string = string.sub(/^[a-z\\d]*/) { $&.capitalize }\n string.gsub(/(?:_|(\\/))([a-z\\d]*)/) { \"#{$1}#{$2.capitalize}\" }.gsub('/', '::')\n end", "def camelize(term)\n string = term.to_s\n string = string.sub(/^[a-z\\d]*/) { $&.capitalize }\n string.gsub(/(?:_|(\\/))([a-z\\d]*)/i) { \"#{$1}#{$2.capitalize}\" }.gsub('/', '::')\n end", "def camel_case(preserve_prefixed_underscores: true)\n LuckyCase.camel_case self, preserve_prefixed_underscores: preserve_prefixed_underscores\n end", "def camelize\n self.camelize_path.camelize_name\n end", "def camelize(string)\n string\n .to_s\n .split(\"_\")\n .map(&:capitalize)\n .join\n end", "def snake_case_to_camel_case(value)\n pieces = value.to_s.split '_'\n\n (pieces[0] + pieces[1..-1].map(&:capitalize).join).to_sym\n end", "def underscorize!\n self.replace(self.scan(/[A-Z][a-z]*/).join(\"_\").downcase)\n end", "def camelize(string)\n string.to_s.gsub(/\\/(.?)/) { \"::#{$1.upcase}\" }.gsub(/(?:^|_)(.)/) { $1.upcase }\n end", "def ns_camelize\n to_s.gsub('__', '/').camelize\n end", "def underscorized_classname\n self.class.name.split(\"::\").last.\n gsub( /([A-Z]+)([A-Z][a-z])/, '\\1_\\2' ).\n gsub( /([a-z\\d])([A-Z])/, '\\1_\\2' ).downcase\n end", "def camel(value)\n case value\n when Hash then value.deep_transform_keys! { |key| camel(key) }\n when Symbol then camel(value.to_s).to_sym\n when String then StringSupport.camel(value)\n else value\n end\n end", "def camel_case\n split('_').map { |e| e.capitalize }.join\n end", "def camelize_and_normalize_name(snake_cased_name)\n result = Client.camelize_name(snake_cased_name.to_s)\n PARAM_NORMALIZATION.each {|k, v| result.gsub!(/#{k}/, v) }\n result\n end", "def auto_camelize(data)\n if Cody.settings[:auto_camelize]\n CfnCamelizer.transform(data)\n else\n data.deep_stringify_keys!\n end\n end", "def camelize_string(str)\n cameled_string = str.split(\"_\").map {|s| s.capitalize }.join\n return cameled_string\n end", "def studly_caps(delimiter = '_')\n ((self.start_with?(delimiter) ? '' : delimiter) + self).camel_case(delimiter)\n end", "def camel_case(name)\n if name.include? '_'\n name.split('_').map{|e| e.capitalize}.join\n else\n unless name =~ (/^[A-Z]/)\n name.capitalize\n else\n name\n end\n end\nend", "def naming_convention name=nil \n nc = name.present?? name.to_s : ref_name\n if namespace_prefix.present?\n \t nc.split(namespace_prefix).last.camelize\n else\n nc.camelize\n end\n\trescue\n\t\tnil\n end", "def underscore\n\t\tcamel_cased_word = self\n\t\tword = camel_cased_word.to_s.dup\n\t\tword.gsub!(/::/, '/')\n#\t\tword.gsub!(/(?:([A-Za-z\\d])|^)(#{inflections.acronym_regex})(?=\\b|[^a-z])/) { \"#{$1}#{$1 && '_'}#{$2.downcase}\" }\n\t\tword.gsub!(/([A-Z\\d]+)([A-Z][a-z])/,'\\1_\\2')\n\t\tword.gsub!(/([a-z\\d])([A-Z])/,'\\1_\\2')\n\t\tword.tr!(\"-\", \"_\")\n\t\tword.downcase!\n\t\tword\n\tend", "def name_case!\n self.gsub!(self, self.name_case)\n end", "def capitalize!() end", "def class_camel(text)\n text.split('::').map(&:capitalize).join('::')\n end", "def camelcase(name)\n name = name.to_s\n name.split('_').each do |n|\n # Numbers won't be recognized as a split point when going back to underscore, so need to\n # register this field beginning with a number as an acronym\n @required_acronyms << n if n =~ /^\\d/\n end\n name.camelcase\n end", "def camel_to_snake_case input\n input = input.to_s.dup\n\n # handle camel case like FooBar => Foo_Bar\n while input.gsub!(/([a-z]+)([A-Z])(\\w+)/) { $1 + '_' + $2 + $3 }\n end\n\n # handle abbreviations like XMLParser => XML_Parser\n while input.gsub!(/([A-Z]+)([A-Z])([a-z]+)/) { $1 + '_' + $2 + $3 }\n end\n\n input\n end", "def humanize\n\t\tself.gsub('_',' ').titlecase\n\tend", "def lower_camelcase\n str = dup\n str.gsub!(/\\/(.?)/) { \"::#{$1.upcase}\" }\n str.gsub!(/(?:_+|-+)([a-z])/) { $1.upcase }\n str.gsub!(/(\\A|\\s)([A-Z])/) { $1 + $2.downcase }\n str\n end", "def snake_to_camel(s)\n s.to_s.split('_').map(&:capitalize).join('')\n end", "def camelize(str)\n str = require_string! str\n\n inflector.camelize(str)\n end", "def to_camel_case(s)\n\t\t\ts.sub(/^[a-z\\d]*/) { |match| match.capitalize }.\n\t\t\t\tgsub(/(?:_|(\\/))([a-z\\d]*)/i) {\"#{$1}#{$2.capitalize}\"}.\n\t\t\t\tgsub(\"/\", \"::\")\n\t\tend", "def underscore(camel_cased_word)\n #2 replaces any double colons with a slash using gsub\n # string = \"SomeModule::SomeClass\".gsub(/::/, '/')\n string = camel_cased_word.gsub(/::/, '/') #=> \"SomeModule/SomeClass\"\n #3 inserts an underscore between any all-caps class prefixes (like acronyms) and other words\n string.gsub!(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2') #=> nil\n #4 inserts an underscore between any camelcased words\n string.gsub!(/([a-z\\d])([A-Z])/,'\\1_\\2') #=> \"Some_Module/Some_Class\"\n #5 replaces any - with _ by using tr method\n string.tr!(\"-\", \"_\") #=> nil\n #6 makes the string lowercase\n string.downcase #=> \"some_module/some_class\"\n end", "def sanitize_method_name( name )\n name.to_s.camelize\n end", "def camel_lower(value)\n case value\n when Hash then value.deep_transform_keys! { |key| camel_lower(key) }\n when Symbol then camel_lower(value.to_s).to_sym\n when String then StringSupport.camel_lower(value)\n else value\n end\n end", "def constantize(camel_cased_word)\n camel_cased_word = camel_cased_word.to_s\n\n if camel_cased_word.include?('-')\n camel_cased_word = classify(camel_cased_word)\n end\n\n names = camel_cased_word.split('::')\n names.shift if names.empty? || names.first.empty?\n\n constant = Object\n names.each do |name|\n constant = constant.const_get(name) || constant.const_missing(name)\n end\n constant\n end", "def camel_path\n @camel_path ||= original_path.gsub('schemas', 'schemas_camelized')\n end", "def capitalize() end", "def constantize(name)\n name.to_s.split('_').map(&:capitalize).join\n end", "def upcase\n (self.to_s.upcase! || self).to_sym\n end", "def camel_lower(value)\n case value\n when Array then value.map { |item| camel_lower(item) }\n when Hash then value.deep_transform_keys! { |key| camel_lower(key) }\n when Symbol then camel_lower(value.to_s).to_sym\n when String then value.underscore.camelize(:lower)\n else value\n end\n end", "def capitalize\n \"Foo\"\n end", "def upper_camel_to_lower_underscore(s)\n s = s.gsub(/([A-Z]+)([A-Z][a-z])/, '\\1_\\2')\n s = s.gsub(/([a-z\\d])([A-Z])/, '\\1_\\2')\n s = s.tr('-', '_')\n s = s.downcase\n s\n end", "def titleize\n self.class.new underscore.split(CLASSIFY_SEPARATOR).map(&:capitalize).join(TITLEIZE_SEPARATOR)\n end", "def snake_case(name); end", "def camelize(str)\n if (str.is_a? Array)\n str.map{|p| camelize(p.to_s) }.join('::')\n else\n str.to_s.gsub(/(?:\\A|_)(\\w)/) { $1.upcase }\n end\n end", "def capitalize(skip_prefixed_underscores: false)\n self.capital skip_prefixed_underscores: skip_prefixed_underscores\n end", "def camelise(a_word)\n return a_word.split('_').collect(&:capitalize).join\nend", "def constantize(s)\n s.to_s.split('_').map(&:capitalize).join.to_sym\n end", "def underscore(camel_cased_word)\n return camel_cased_word unless camel_cased_word =~ /[A-Z-]|::/\n word = camel_cased_word.to_s.gsub(/::/, '/')\n word.gsub!(/([A-Z\\d]+)([A-Z][a-z])/, '\\1_\\2')\n word.gsub!(/([a-z\\d])([A-Z])/, '\\1_\\2')\n word.tr!('-', '_')\n word.downcase!\n word.to_sym\n end", "def newrelic_riak_camelize(term)\n string = term.to_s.capitalize\n string.gsub(/[_-]([a-z]*)/) { \"#{$1.capitalize}\" }\n end", "def add_camelization(name, camelized)\n camelizations[name.to_s] = camelized.to_s\n end", "def underscore(const_name)\n const_name.gsub(/([^\\^])([A-Z])/,'\\1_\\2').downcase.to_sym\n end", "def camelize_key(key, first_upper = true)\n if key.is_a? Symbol\n camelize(key.to_s, first_upper).to_sym\n elsif key.is_a? String\n camelize(key, first_upper)\n else\n key\n end\n end", "def camelize_key(key, first_upper = true)\n if key.is_a? Symbol\n camelize(key.to_s, first_upper).to_sym\n elsif key.is_a? String\n camelize(key, first_upper)\n else\n key\n end\n end", "def underscore(class_name)\n class_name.gsub(/::/, '/').\n gsub(/([A-Z]+)([A-Z][a-z])/,'\\1_\\2').\n gsub(/([a-z\\d])([A-Z])/,'\\1_\\2').\n tr(\"-\", \"_\").\n downcase\n end", "def capitalize\n (self.to_s.capitalize! || self).to_sym\n end", "def camelize_key(key, first_upper: true)\n case key\n when Symbol\n Surrealist::StringUtils.camelize(key.to_s, first_upper: first_upper).to_sym\n when String\n Surrealist::StringUtils.camelize(key, first_upper: first_upper)\n else\n key\n end\n end" ]
[ "0.8226512", "0.8153958", "0.7974904", "0.79199505", "0.7825003", "0.7814171", "0.77695024", "0.77572227", "0.758923", "0.7560269", "0.7448349", "0.7446958", "0.7445759", "0.7402228", "0.7358273", "0.73501647", "0.7346693", "0.7329626", "0.7328764", "0.7298576", "0.7292509", "0.7285689", "0.7274434", "0.7244613", "0.7237988", "0.7232822", "0.723114", "0.72129035", "0.72038627", "0.72019106", "0.72019106", "0.7193588", "0.7177027", "0.71715426", "0.71615535", "0.7141225", "0.7129026", "0.71104085", "0.71049273", "0.7102877", "0.70859283", "0.7076917", "0.7073541", "0.7049989", "0.7039132", "0.70369637", "0.7020023", "0.7014008", "0.70029455", "0.69656396", "0.69593924", "0.69508415", "0.6949836", "0.69307005", "0.6928971", "0.6927311", "0.69108564", "0.689793", "0.68891823", "0.6886463", "0.6866931", "0.6866154", "0.6852785", "0.68154055", "0.6803761", "0.67947483", "0.67846656", "0.6779115", "0.676921", "0.6728658", "0.67273134", "0.6727045", "0.67204046", "0.671527", "0.67031294", "0.670151", "0.66761893", "0.66701645", "0.66495454", "0.66462326", "0.6642596", "0.66419524", "0.66386545", "0.66342694", "0.66310626", "0.66242725", "0.66154635", "0.6614784", "0.6605701", "0.6605128", "0.6597894", "0.6592042", "0.65900666", "0.6586225", "0.6576308", "0.6575472", "0.65734214", "0.65734214", "0.6572725", "0.6565683", "0.65632665" ]
0.0
-1
this method only removes the tags. Other desired tags, such as , are not removed because they are needed for the desired display effect
def remove_unittitle_tags(input_string) # fcd1: for now, explicit strings. Later, can regex it unless input_string.blank? input_string.gsub!('<unittitle>','') input_string.gsub!('</unittitle>','') end input_string end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove_html_tag(tag_name); end", "def strip_tags_delicately\n self.gsub(/<.[^<]*>/, ' ')\n end", "def destroy_tag(*tags)\n tags.each do |tag|\n gsub! Regexp.new(\"<\\s*#{tag}[^>]*>.*?<\\s*\\/#{tag}\\s*>\", Regexp::IGNORECASE + Regexp:: MULTILINE), ''\n end\n end", "def removeTag(text,tag)\n return 0 unless text\n text=text.to_s\n text=text.gsub(\"<\"+tag+\">\", \"\")\n text=text.gsub(\"</\"+tag+\">\", \"\")\n \n return text.to_s\nend", "def tags_to_remove\n return @tags_to_remove\n end", "def strip_html_tags!\n @raw.gsub!(/<[^>]+?>/, ' ')\n end", "def cleanup_image_tags\n self.tags = self.tags.strip\n unless self.tags.empty?\n tags = self.tags.split(\",\")\n tags_new = []\n tags.each do |item|\n tags_new.push(item.strip)\n end\n self.tags = tags_new.join(\",\")\n end\n end", "def strip_tag(*tags, &block)\n tags.each do |tag|\n gsub! Regexp.new(\"<\\s*#{tag}(?:\\s+[^>]*)*>(.*?)<\\s*\\/#{tag}\\s*>\", Regexp::IGNORECASE + Regexp:: MULTILINE) do\n if block\n \"#{$1}#{yield}\"\n else\n $1\n end\n end\n # check we don't have any malformed or nested instances left\n gsub! Regexp.new(\"<\\s*#{tag}(?:\\s+[^>]*)*>\", Regexp::IGNORECASE + Regexp:: MULTILINE), ''\n gsub! Regexp.new(\"<\\s*\\/#{tag}\\s*>\", Regexp::IGNORECASE + Regexp:: MULTILINE), ''\n end\n end", "def strip_tags(html); end", "def strip_tags(html); end", "def strip_tags(html); end", "def strip_tags\n %w(name description allowed_values).each do |a|\n next if send(a).blank?\n self.send \"#{a}=\", send(a).gsub(/\\<.*?\\>/, '')\n end\n true\n end", "def strip_tags\n %w(name description allowed_values).each do |a|\n next if send(a).blank?\n self.send \"#{a}=\", send(a).gsub(/\\<.*?\\>/, '')\n end\n true\n end", "def strip_tags\n %w(name description allowed_values).each do |a|\n next if send(a).blank?\n self.send \"#{a}=\", send(a).gsub(/\\<.*?\\>/, '')\n end\n true\n end", "def hide_custom_tags!\n hide_custom_tags.each do |full_pattern, value|\n paragraphs = document.css('w|p')\n while paragraph = paragraphs.shift do\n next unless paragraph.text =~ full_pattern\n run_nodes = paragraph.css('w|r')\n while run_node = run_nodes.shift\n next unless run_node.at_css('w|t')\n next unless run_node.text =~ full_pattern\n tag_contents = split_tag_content(run_node.text, full_pattern)\n replacement_nodes = []\n tag_contents[:content_list].each_with_index do |content, idx|\n remainder_run_node = run_node.clone\n replace_content(remainder_run_node, content)\n matched_tag = tag_contents[:matched_tags][idx]\n replacement_nodes << remainder_run_node\n if matched_tag\n run_node_with_match = run_node.clone\n replace_style(run_node_with_match)\n matched_content = matched_tag\n if value\n matched_content = value.is_a?(Proc) ?\n value.call(matched_tag) :\n value.to_s\n end\n replace_content(run_node_with_match, matched_content)\n replacement_nodes << run_node_with_match\n end\n end\n run_node.add_next_sibling(Nokogiri::XML::NodeSet.new(document, replacement_nodes))\n run_node.unlink\n end\n end\n end\n end", "def correct_unclosed_html_tags(element)\n [:i, :sup].each do |tag|\n strip_stray_close_tags(element,tag)\n append_missing_close_tags(element,tag)\n end\n end", "def cleaned_tags\n @product.tags.split(',').reject{ |c| c.empty? or c == \" \" }.uniq.join(',')\n end", "def html_remove\n gsub(/<\\/?[^>]+>/, '')\n end", "def untag(tag_class); end", "def tags_to_remove=(value)\n @tags_to_remove = value\n end", "def strip_tags(html)\n strip(Sanitize.clean(html, :elements => [], :attributes => []))\n end", "def no_tags label\n return label.gsub(/\\<.+\\/?\\>/,'')\n end", "def close_tags\n text = @modified_string\n\n open_tags = []\n text.scan(/<([a-zA-Z0-9]+?)(\\s[^>]*)?>/).each { |t| open_tags.unshift(t[0]) }\n text.scan(/<\\/\\s*?([a-zA-Z0-9]+)\\s*?>/).each { |t| open_tags.slice!(open_tags.index(t[0])) unless open_tags.index(t[0]).nil? }\n open_tags.each { |t| text += \"</#{t}>\" unless %w(img br hr).include?(t.to_s) }\n\n @modified_string = text\n return self\n end", "def clean_tags(tags)\r\n tags = sanitize_fully(tags)\r\n if tags.match(/,/)\r\n tagslist = tags.split(/,/)\r\n else\r\n tagslist = [tags]\r\n end\r\n newlist = []\r\n tagslist.each do |tag|\r\n tag.gsub!(/[\\*\\<\\>]/, '')\r\n if tag.length > ArchiveConfig.TAG_MAX\r\n tag = tag[0..(ArchiveConfig.TAG_MAX-2)]\r\n end\r\n newlist << tag\r\n end\r\n return newlist.join(',')\r\n end", "def clean_up_text\n text.gsub!(/<br/, \"\\n<br\")\n text.gsub!(/<p/, \"\\n<p\")\n text.gsub!(/<\\/?span(.*?)?>/, '')\n text.gsub!(/<\\/?div(.*?)?>/, '')\n end", "def strip_tags(html)\n html.gsub(/<\\/?[^>]*>/, \"\") if html\n end", "def delete_tag_if(&block); end", "def remove_tags_container(t, c)\n l, r = container_array(c)\n t.gsub!(l, '')\n t.gsub!(r, '')\n t\n end", "def tags_to_remove\n linked_tags - current_tags\n end", "def remove_tag_from_contact\n\t\t\t\t# unlike the remove method in account, this only removes the tag from one contact\n\t\t\t\t\n\t\t\tend", "def tags_to_remove\n aws_tags.reject { |t, v| local_tags.include?(t) and local_tags[t] == v }\n end", "def strip_tags_custom\n ActionController::Base.helpers.strip_tags(self)\n end", "def purge_custom_tags(options)\n options.reject{ |key,value| [:label, :html, :field, :field_type, :separator].include?(key.to_sym) }\n end", "def write_tags(tags)\n\n\t\treturn if tags.empty?\n\n\t\ttags.each do |f|\n \traw(\"<li><a href=\\\"#\\\">\")\n \tf[\"title\"] \n \traw(\"</a><div class=\\\"delcir\\\" onclick=\\\"delTag(this)\\\">x</div></li>\")\n end\n\n\t\t# <% @tags[0].each do |f| %>\n\t\t# <li>\n\t\t# <a href=\"#\"><%= f[\"title\"] %></a>\n\t\t# <div class=\"delcir\" onclick=\"delTag(this)\">x</div>\n\t\t# </li>\n\t\t# <% end %>\n\n\tend", "def delete_tags(name); end", "def delete_tags(post_num_input, tags_input)\n tags_to_delete = tags_input.split(\" \")\n tags_to_delete.each do |y|\n BLOG[post_num_input].tags.delete_if {|x| x == y}\n end\n puts ''\n puts 'Your tags have been deleted'\n puts BLOG[post_num_input].tags\n puts ''\n end", "def strip_tags(line)\n line.gsub(/<\\/?[^>]*>/, \"\")\n end", "def reset\n @tags.clear\n end", "def unlink!\n parse \n @tags.each do |tag|\n @doc.xpath(\"//a[ends_with(@href,'#{tag}')]\", EndsWithFilter.new).each do |element|\n element.swap(element.children)\n end\n end\n output = @doc.xpath(\"/#{@wrap_tag}/body/p\").inner_html\n output = @doc.xpath(\"/#{@wrap_tag}/body\").inner_html if output == \"\"\n output\n end", "def rm_single_tags(str)\n str.gsub(/<[^<>]*\\/>/, \"\")\n end", "def remove_tags(tags)\n\t\t\[email protected] do |u|\n\t\t\t\tu.delete(:tags => tags)\n\t\t\t\tu.add(:idenity => 1)\n\t\t\tend\n\t\t\treturn nil\n\t\tend", "def empty_tags\n ['area', 'base', 'br', 'col', 'frame', \n 'hr', 'img', 'input', 'link', 'meta']\n end", "def empty_tags\n ['area', 'base', 'br', 'hr', 'img', 'input', 'link', 'meta']\n end", "def remove_footnotes(elements); end", "def reverse_html_tags\n self.gsub('&lt;', \"<\").gsub('&gt;', \">\")\n end", "def parse_unpaired_tags(wiki_text)\n wiki_text.gsub!(%r{<[a-zA-Z]*/>}im, \"\")\n wiki_text\n end", "def clearing_span\n\t\tcontent_tag(:span, '', :class => 'clear')\n\tend", "def remove_paragraph_tags mytext\n mytext.sub!(/^<p>\\s*<\\/p>/,\"\")\n mytext.sub!(/(<br>)*<p>\\s*<\\/p>$/,\"\")\n mytext.sub!(/^<p>/,'')\n mytext.sub!(/<\\/p>?/,'')\n return mytext\n end", "def untag(txt)\n Sanitize.clean(txt).strip.gsub(/\\s+/, \" \")\n end", "def strip_html\n gsub(HTML_TAG_PATTERN, \"\")\n end", "def smooth_offtags( text )\n unless @pre_list.empty?\n ## replace <pre> content\n text.gsub!(/<redpre#(\\d+)>/) do\n content = @pre_list[$1.to_i]\n if content.match(/<code\\s+class=\"(\\w+)\">\\s?(.+)/m)\n content = \"<code class=\\\"#{$1} syntaxhl\\\">\" + \n Redmine::SyntaxHighlighting.highlight_by_language($2, $1)\n end\n content\n end\n end\n end", "def delete_tags\n @tags.delete_tags(@filename) unless @tags.nil?\n end", "def remove_whitespace_from_list_items!\n @document.tree.search('li span').each { |span| span.inner_html.strip! }\n end", "def clean_up_tags\n self.tags.each do |tag|\n if tag.todos.count == 1\n tag.destroy\n end\n end\n end", "def remove_search_tags(search_tags, resource_tags)\n tags_to_remove = search_tags.split()\n tags_to_response = resource_tags.split()-tags_to_remove\n tags_to_response = resource_tags.split()\n tag_list = Array.new\n tags_to_response.each do |tag|\n tag_list << tag if tag.size < 25\n end\n return tag_list.join(\" \")\n end", "def clear_tag(tag, direction = nil)\n if tag == :br\n \"<br class=\\\"clear#{direction}\\\" />\"\n else\n \"<#{tag} class=\\\"clear#{direction}\\\"></#{tag}>\"\n end\n end", "def destroy\n tag_ids.clone.each { |tag_id| destroy_tag(tag_id) }\n super\n end", "def keep_only_tags(passage, tags = %w(NNP NN VB))\n raise \"invalid tag/s supplied\" unless (tags.map(&:downcase) - EngTagger::TAGS.keys).empty?\n @tagger.get_hashed(passage).delete_if{|tag,tokens| !tags.include?(tag)}.values.join(' ')\n end", "def complete_tags\n\n end", "def sanitize_text(text)\n doc = Nokogiri::HTML.fragment(text)\n UNSUPPORTED_HTML_TAGS.each do |tag|\n doc.search(tag).each(&:remove)\n end\n doc.inner_html\n end", "def strip_whitespace\n self.tags = tags.gsub(/\\s+/, '')\n # self.tags = tags.strip\n self.title = title.strip\n self.description = description.strip\n # self.keywords = keywords.strip\n self.body = body.strip\n end", "def tag_clean_up\n all_tags = Tag.all\n all_modules = UniModule.all\n\n all_tags.each do |tag|\n is_used_somewhere = false\n all_modules.each do |uni_module|\n if uni_module.tags.include?(tag)\n is_used_somewhere = true\n end\n end\n if !is_used_somewhere\n logs = TagLog.all.where(:tag_id => tag.id)\n if logs.size >0\n logs.each do |log|\n log.destroy\n end\n end\n tag.destroy\n end\n end\n end", "def remove_extra_bars(contents)\n\t\t\tcontents = contents.gsub(/\\A\\|/, \"\")\n\t\t\tcontents = contents.gsub(/\\|\\Z/, \"\")\n\t\t\tcontents\n\t\tend", "def strip_html_tags(text)\n return text.gsub!(/(<[^>]*>)|\\n|\\t/s) {\" \"}\n end", "def remove_text_label\n\t\t$tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.p.className(create_ats_regex_string(\"ats-removetxtlbl\")), format_method(__method__))\n\tend", "def filter_tags(document)\n # Filter down and get the tags.\n @tags = document.css(TAG_CSS).map(&:children).map(&:text)\n end", "def clear\n @hash_tags.clear\n end", "def remove_tag(name)\n name = info.tag_name(name) if name.is_a?(Symbol)\n\n info.rawtags.each_key do |tag|\n info.raw.comment_del(tag.to_s) if tag.casecmp(name.to_s).zero?\n end\n end", "def strip_tags(html)\n return html if html.blank?\n if html.index(\"<\")\n text = \"\"\n tokenizer = ::HTML::Tokenizer.new(html)\n while token = tokenizer.next\n node = ::HTML::Node.parse(nil, 0, 0, token, false)\n # result is only the content of any Text nodes\n text << node.to_s if node.class == ::HTML::Text\n end\n # strip any comments, and if they have a newline at the end (ie. line with\n # only a comment) strip that too\n text.gsub(/<!--(.*?)-->[\\n]?/m, \"\")\n else\n html # already plain text\n end\n end", "def remove_preexisting_tagging\n user.taggings.find(:all, \n :conditions => { :tag_id => tag.id, :feed_item_id => feed_item.id, :classifier_tagging => classifier_tagging? }\n ).each(&:destroy)\n end", "def strip_tags(html)\n # First we need to get rid of any embedded code.\n html = strip_embedded(html)\n\n # Remove comments\n html = html.gsub(/<!--.*?--\\s*>/m, \"\\xEF\\xBF\\xBC\")\n\n # SGML Declarations\n html = html.gsub(/<!.*?>/m, \"\\xEF\\xBF\\xBC\")\n\n # Remove script and css blocks\n html = html.gsub(/<script.*?>.*?<\\/script>/m, \"\\xEF\\xBF\\xBC\")\n html = html.gsub(/<style.*?>.*?<\\/style>/m, \"\\xEF\\xBF\\xBC\")\n\n # Strip html tags\n html = html.gsub(/<\\/? # opening tag with optional slash\n (\n [^<>\"'] | # match anything unquoted\n \".*?\" | # match double quotes…\n '.*?' # and single ones\n )* # any combination of the three\n > # close tag\n /xm, \"\\xEF\\xBF\\xBC\") # placeholder\n\n # Handle placeholders\n html = html.gsub(/^[ \\t]*\\xEF\\xBF\\xBC[ \\t]*(\\n|\\r|\\r\\n)/xm, '') # Remove lines with only tags\n html = html.gsub(/\\xEF\\xBF\\xBC/xm, '') # Remove other placeholders\n return html\nend", "def render_noindex(tags)\n meta_tags.extract_noindex.each do |name, content|\n tags << Tag.new(:meta, :name => name, :content => content) if content.present?\n end\n end", "def delete_all_tags\n delete_tags(self.tags)\n nil\n end", "def handle_tag_as_text\n self[:is_tag] = false\n self[:closing_tag] = false\n self[:text] = self[:complete_match]\n end", "def strip(tags=TagLib::FLAC::File::AllTags)\n end", "def tag_list; []; end", "def remove_paragraphs_from_list_items!\n @document.tree.search('li p').each { |node| node.node_name = 'span' }\n end", "def _UNDO_setTags(iNewTags)\n # Remove Tags that are not part of the new list\n @Tags.delete_if do |iTag, iNil|\n !iNewTags.has_key?(iTag)\n end\n # Add Tags that are not part of the current list\n iNewTags.each do |iTag, iNil|\n @Tags[iTag] = nil\n end\n end", "def replace(node_or_tags); end", "def replace(node_or_tags); end", "def strip_tags(html)\n Sanitize.clean(html.strip).strip\n end", "def strip_tags(html)\n Sanitize.clean(html.strip).strip\n end", "def strip_tags string\n string.gsub(/<\\/?[^>]*>/, \"\")\nend", "def clean()\n #strip all illegal content here. (scripts, shit that will break layout, etc.)\n end", "def extractTags()\n line = @lines[@currentLine]\n re = /\\[([^\\[]+)\\]/m\n while line =~ re\n @currentBlock.addTag($~[1])\n line = line.sub(re, '')\n end\n end", "def remove( item)\n\t\titem.dtag( self.gettag)\n\tend", "def remove_filter_taggings(old_filter=nil)\n if old_filter\n potential_duplicate_filters = [old_filter] + old_filter.mergers - [self]\n self.works.each do |work|\n if (work.tags & potential_duplicate_filters).empty?\n filter_tagging = work.filter_taggings.find_by_filter_id(old_filter.id)\n filter_tagging.destroy if filter_tagging\n end\n end \n else\n self.filter_taggings.destroy_all\n end \n end", "def tag_removed_summary(tag=\"あとで\")\n hatena = HatenaOAuth.new\n summary = hatena.edit_get(self.eid)[:entry][:summary]\n # 正規表現メモ: summary.scan(/\\[.*?\\]/) # => [\"[大学]\", \"[anime]\"]\n summary.gsub(/\\[#{tag}\\]/, '') # NOTE: \"あとで\" を除外してbookmark.tagsに保存しているが, この設計も見直したい.\n end", "def tags_text\n\t\tself.tags.join(', ') #convertir el arreglo en una cadena de texto separado por ,\n\tend", "def restore_tags\n marc.by_tags(\"599\").each do |t|\n new_content = t.fetch_first_by_tag(\"a\").content\n if new_content =~ /=[0-9]{3}\\s{2}/\n tag, content = new_content.split(\" \")\n marc.parse_marc21(tag[1..4], content)\n t.destroy_yourself\n end\n end\n self.save\n end", "def relax\n form = self.mailbox\n form += @config[:tag_separator] + self.tag if self.tag\n form = form.gsub(/[ \\\"\\(\\),:<>@\\[\\]\\\\]/,'')\n form\n end", "def clear_tag(key)\n meta.delete(key)\n end", "def clean_content\n self.content = content.gsub('<p>&nbsp;</p>', '') if content\n end", "def close_tags(text)\n open_tags = []\n text.scan(/\\<([^\\>\\s\\/]+)[^\\>\\/]*?\\>/).each { |t| open_tags.unshift(t) }\n text.scan(/\\<\\/([^\\>\\s\\/]+)[^\\>]*?\\>/).each { |t| open_tags.slice!(open_tags.index(t)) }\n open_tags.each {|t| text += \"</#{t}>\" }\n text\n end", "def removeTags(document,tagList)\n tagList.each do |tag|\n document.search(tag).remove\n end \n end", "def untag(*tags)\n tags.each do |tag|\n run_context.node.tags.delete(tag)\n end\n end", "def untag(*tags)\n tags.each do |tag|\n run_context.node.tags.delete(tag)\n end\n end", "def text\n html.gsub(REGEX_TAGS, \"\")\n end", "def tags!\n @tags = nil\n tags\n end", "def tags() []; end", "def remove_request_tags(tags=[])\n if tags.any?\n tags.collect! { |tag|\n tag.slice!(0) if tag.first == '-' \n Tag.find_by_title(Rack::Utils::unescape(tag)) \n }\n self.requested_tags = (self.requested_tags - tags.compact).uniq\n end\n end" ]
[ "0.7309747", "0.7159982", "0.6965915", "0.67619985", "0.67282856", "0.6688525", "0.6681025", "0.6650941", "0.6649583", "0.6649583", "0.6649583", "0.6601133", "0.6601133", "0.6601133", "0.6592865", "0.6579444", "0.6512471", "0.6510283", "0.6442032", "0.6421931", "0.63539386", "0.6321921", "0.6293585", "0.62664986", "0.6264478", "0.62609375", "0.62511885", "0.6188096", "0.6178718", "0.617311", "0.6151269", "0.6144964", "0.6144742", "0.6140998", "0.61378694", "0.61171526", "0.6105345", "0.60835415", "0.6082474", "0.6069512", "0.6045243", "0.60373163", "0.6032792", "0.6030999", "0.602669", "0.6024027", "0.60060215", "0.5989075", "0.5979401", "0.59655213", "0.5964834", "0.59568495", "0.5954779", "0.59527415", "0.59523886", "0.59400314", "0.5931294", "0.5930141", "0.59261847", "0.5923471", "0.59123045", "0.59031415", "0.5892707", "0.5891645", "0.58853555", "0.58698446", "0.58696574", "0.58585805", "0.5844208", "0.5832585", "0.583087", "0.5826167", "0.5808459", "0.580496", "0.5794206", "0.57893527", "0.57770044", "0.5773105", "0.57721525", "0.57721525", "0.5771385", "0.5771385", "0.5764623", "0.5754649", "0.57464284", "0.57440954", "0.5740527", "0.5736988", "0.57352346", "0.572368", "0.57198596", "0.5718138", "0.5713582", "0.570777", "0.5703616", "0.5699984", "0.5699984", "0.56976175", "0.5695672", "0.5689259", "0.56859314" ]
0.0
-1
Returns the correct type class for attributes when loading an object from Solr Catches malformed dates that will not parse into DateTime, see 198
def adapt_single_attribute_value(value, attribute_name) AttributeValueAdapter.call(value, attribute_name) || super rescue ArgumentError "#{value} is not a valid date" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def subtype\n self.datetime_type\n end", "def datetime_classes\n [DateTime, Time, defined?(FmRest::StringDateTime) && FmRest::StringDateTime].compact.freeze\n end", "def date_class\n ::DateTime\n end", "def initialize_to_correct_date_type(field_info, field)\n initialize_integer(field_info, field)\n initialize_float(field_info, field)\n end", "def class_date_attributes_or_arguments\n @time_jawn_date_time_attributes || datetime_attributes\n end", "def date_classes\n [Date, defined?(FmRest::StringDate) && FmRest::StringDate].compact.freeze\n end", "def type\n 'Edm.DateTime'\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n split_vals = value.split('/')\n value = [split_vals[1], split_vals[0], split_vals[2..split_vals.length - 1]].join('/') + ' ' + RentCentric.configure.timezone_abbr\n DateTime.parse(value)\n when :Date\n split_vals = value.split('/')\n value = [split_vals[1], split_vals[0], split_vals[2..split_vals.length - 1]].join('/') + ' ' + RentCentric.configure.timezone_abbr\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = RentCentric.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n split_vals = value.split('/')\n value = [split_vals[1], split_vals[0], split_vals[2..split_vals.length - 1]].join('/') + ' ' + RentCentric.configure.timezone_abbr\n DateTime.parse(value)\n when :Date\n split_vals = value.split('/')\n value = [split_vals[1], split_vals[0], split_vals[2..split_vals.length - 1]].join('/') + ' ' + RentCentric.configure.timezone_abbr\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = RentCentric.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def parse_datetime_date(type, resource)\n year = resource[\"#{type}(1i)\"].to_i\n month = resource[\"#{type}(2i)\"].to_i\n day = resource[\"#{type}(3i)\"].to_i\n hour = resource[\"#{type}(4i)\"].to_i\n minute = resource[\"#{type}(5i)\"].to_i\n DateTime.new(year, month, day, hour, minute)\n end", "def parse_attribute_as(name, data, klass = NilClass)\n return if data.nil?\n value =\n case klass.name\n when 'NilClass' then data\n when 'DateTime' then klass.parse(data)\n else klass.new(data)\n end\n instance_variable_set(\"@#{name.to_s.underscore}\", value)\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Alfresco.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Alfresco.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DocSpring.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def coerce_value(key, value)\n return value unless value\n klass = self.class.attributes[key][:class]\n \n if value.is_a?(String) and !value.empty?\n # In-built types\n if klass.kind_of?(Videojuicer::Resource::Types::Base)\n return klass.new(value).dump\n end\n \n # Dates\n if klass.respond_to?(:parse)\n return klass.parse(value) rescue raise \"Invalid date: #{value.inspect}\"\n end\n elsif value.is_a? Hash and value.any?\n if klass == DateTime\n if value.is_a?(Hash)\n year = value[:year]\n month = value[:month]\n day = value[:day]\n hour = value[:hour] or \"00\"\n minute = value[:minute] or \"00\"\n value = klass.parse(\"#{year}-#{month}-#{day}T#{hour}:#{minute}:00+00:00\")\n else\n raise ArgumentError, \"Please supply a DateTime, Hash keyed w/ [:day, :month, :year, :hour, :minute] or a String that can be coerced into a date\"\n end\n end\n end\n return value\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Aimastering.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def validate_date_attribute(date_type)\n value = send(\"#{date_type}_before_type_cast\")\n self[date_type] = value.is_a?(Date) || value.is_a?(Time) ? value : Time.zone.parse(value)\n if self[date_type].nil?\n errors.add(date_type, I18n.t('error.invalid_date', key: date_type.capitalize))\n end\n rescue ArgumentError, TypeError\n errors.add(date_type, I18n.t('error.invalid_date', key: date_type.capitalize))\n end", "def klass\n case type\n when :integer, :long then Fixnum\n when :float then Float\n when :double then BigDecimal\n when :timestamp, :time, :datetime then Time\n when :date then Date\n when :text, :string, :binary, :ascii then String\n when :boolean then Object\n when :uuid then ::Cql::TimeUuid\n when :list then DatastaxRails::Types::DynamicList\n when :set then DatastaxRails::Types::DynamicSet\n when :map then DatastaxRails::Types::DynamicMap\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Dkron.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n #there is bug with ruby while searching for constraint which is under 2 modules\n temp_model = DocuSign_eSign.const_get('OAuth').const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def normalise_json_data(attribute_types, data)\n record_data = data.dup\n attribute_types.each_pair do |name, type|\n t = record_data[name.to_s]\n next unless t.is_a?(String) && :timestamp.eql?(type)\n begin\n record_data[name.to_s] = DateTime.parse(t)\n rescue ArgumentError\n record_data[name.to_s] = nil\n end\n end\n symbolize(record_data)\n end", "def normalise_json_data(attribute_types, data)\n record_data = data.dup\n attribute_types.each_pair do |name, type|\n t = record_data[name.to_s]\n next unless t.is_a?(String) && :timestamp.eql?(type)\n begin\n record_data[name.to_s] = DateTime.parse(t)\n rescue ArgumentError\n record_data[name.to_s] = nil\n end\n end\n symbolize(record_data)\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Cms::Performance.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = unwiredClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /^(true|t|yes|y|1)$/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = SimplyRetsClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = OryHydraClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def typecast_attributes\n @attributes.each_pair do |name,value|\n # skip primary key columns\n # ajay Singh --> skip the loop if attribute is null (!name.present?)\n next if (name == \"id\") or (!name.present?)\n attr_type = attr_type_for(name)\n \n # empty attributes should stay empty (e.g. an empty int field shouldn't be typecast as 0)\n if [:datetime, :datetimecombo, :int].include? attr_type && (value.nil? || value == '')\n @attributes[name] = nil\n next\n end\n \n case attr_type\n when :bool\n @attributes[name] = (value == \"1\")\n when :datetime, :datetimecombo\n begin\n @attributes[name] = DateTime.parse(value)\n rescue\n @attributes[name] = value\n end\n when :int\n @attributes[name] = value.to_i\n end\n end\n @attributes\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Fastly.const_get(type)\n klass.respond_to?(:fastly_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Plaid.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Plaid.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Plaid.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = CircleciOpenapi.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Hubspot::Marketing::Events.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TitleExpert.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TitleExpert.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = TitleExpert.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = FattureInCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = LaunchDarklyApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NSXT.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n ::DateTime.parse(value)\n when :Date\n ::Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Models.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n ::DateTime.parse(value)\n when :Date\n ::Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Models.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = ArtikCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = CloudmersiveOcrApiClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def typecast_to_primitive(value)\n if value.respond_to?(:to_date)\n value.to_date\n elsif value.is_a?(::Hash) || value.respond_to?(:to_mash)\n typecast_hash_to_date(value)\n else\n ::Date.parse(value.to_s)\n end\n rescue ArgumentError\n value\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Quandoo.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = Quandoo.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = CnsOpenapiRubyClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DocuSign_eSign.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DocuSign_eSign.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DocuSign_eSign.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DocuSign_eSign.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = AsposeThreeDCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Lob.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = AsposeImagingCloud.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n value\n when :Date\n value\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = NucleusApi.const_get(type).new\n temp_model.build_from_hash(value)\n end\nend", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DomainClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DomainClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DomainClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = DomainClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = OpsgenieClient.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = SwaggerAemOsgiClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = SwaggerAemOsgiClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = OryClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :DateTime\n DateTime.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :BOOLEAN\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n temp_model = QuickBase.const_get(type).new\n temp_model.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Marqeta.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Marqeta.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Marqeta.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Marqeta.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = IntersightClient.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Freeclimb.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end", "def _deserialize(type, value)\n case type.to_sym\n when :Time\n Time.parse(value)\n when :Date\n Date.parse(value)\n when :String\n value.to_s\n when :Integer\n value.to_i\n when :Float\n value.to_f\n when :Boolean\n if value.to_s =~ /\\A(true|t|yes|y|1)\\z/i\n true\n else\n false\n end\n when :Object\n # generic object (usually a Hash), return directly\n value\n when /\\AArray<(?<inner_type>.+)>\\z/\n inner_type = Regexp.last_match[:inner_type]\n value.map { |v| _deserialize(inner_type, v) }\n when /\\AHash<(?<k_type>.+?), (?<v_type>.+)>\\z/\n k_type = Regexp.last_match[:k_type]\n v_type = Regexp.last_match[:v_type]\n {}.tap do |hash|\n value.each do |k, v|\n hash[_deserialize(k_type, k)] = _deserialize(v_type, v)\n end\n end\n else # model\n # models (e.g. Pet) or oneOf\n klass = Freeclimb.const_get(type)\n klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)\n end\n end" ]
[ "0.6443332", "0.6438805", "0.63418806", "0.6202303", "0.6186884", "0.6171695", "0.6167017", "0.6141943", "0.6141943", "0.61230963", "0.6097015", "0.60705173", "0.60705173", "0.59868586", "0.59612453", "0.5900716", "0.5870122", "0.58305144", "0.5813819", "0.5812154", "0.5803608", "0.5803608", "0.580303", "0.57707006", "0.5763604", "0.57626474", "0.575387", "0.57509995", "0.57509995", "0.57509995", "0.57509995", "0.5748196", "0.5748196", "0.5748196", "0.57479316", "0.57466525", "0.5742354", "0.5742354", "0.5742354", "0.57335126", "0.5733419", "0.5731863", "0.5731863", "0.5731863", "0.5726506", "0.5726506", "0.57226837", "0.57225925", "0.572105", "0.5719867", "0.5719867", "0.57137185", "0.57131904", "0.57131904", "0.57131904", "0.57131904", "0.57056034", "0.57008034", "0.57008034", "0.57008034", "0.57008034", "0.57008034", "0.57008034", "0.57008034", "0.57008034", "0.5700639", "0.56981015", "0.5694314", "0.5694314", "0.5694314", "0.5694314", "0.5684086", "0.5683681", "0.5683681", "0.56803596", "0.5679579", "0.56793255", "0.56793255", "0.56793255", "0.56793255", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.567647", "0.56712717", "0.56712717" ]
0.0
-1
def show puts "youre in the show method" render text: "This is the show page" end
def show render json: User.find(params[:id]) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n render :text => \"hello\"\n end", "def show\n render 'show'\n end", "def show\n #render show\n end", "def show\n render:show\n end", "def show \n render :show\n end", "def show\n render :show\n end", "def show\n render :show\n end", "def show\n render :show\n end", "def show\n render\n end", "def show\n # show\n end", "def show\n # show\n end", "def show\n render(page_path)\n end", "def show\n render :text => \"\"\n end", "def show\n render :text => \"\"\n end", "def show\n puts \"******* show *******\"\n end", "def show\n \n # \n end", "def show\n \n end", "def show \n \n end", "def show \n end", "def show \n end", "def show \n end", "def show \n end", "def show \n end", "def show # will be default will generate show.html.erb\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end", "def show\r\n end" ]
[ "0.87506306", "0.85149854", "0.85148835", "0.84648776", "0.84031165", "0.83707637", "0.83707637", "0.83707637", "0.8303185", "0.8301614", "0.8301614", "0.8279566", "0.8256484", "0.8256484", "0.81957805", "0.8194934", "0.8170741", "0.81653905", "0.8146993", "0.8146993", "0.8146993", "0.8146993", "0.8146993", "0.8146277", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763", "0.81417763" ]
0.0
-1
PUBLIC METHODS ============================================================ GET TEXT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
def creation_title "Create Character" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_text\n raise NotImplementedError\n end", "def text\n @text\n end", "def getText\n @text\n end", "def getText\n @text\n end", "def get_text\n return self.text\n end", "def text\n @text\n end", "def as_text\n @text\n end", "def\n getText\n @text\n end", "def text\n attributes.fetch(:text)\n end", "def text\n attributes.fetch(:text)\n end", "def text\n attributes.fetch(:text)\n end", "def text\n @text.join('')\n end", "def text\n to_s\n end", "def text text\n end", "def to_s\n @text\n end", "def to_s\n @text\n end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def text; end", "def getText\n return getProperty('text').to_s\n end", "def text\n @attributes.fetch('text', nil)\n end", "def text\n @value[:text].to_s\n end", "def to_s\n text\n end", "def to_s\n text\n end", "def to_s\n @text\n end", "def description; @text; end", "def text(_content)\n raise NotImplementedError\n end", "def text\n return @text if defined? @text\n\n @text = Henkei.read :text, data\n end", "def text\n getvalue\n end", "def to_s\n @text\n end", "def to_s\n @text\n end", "def to_s\n return @text\n end", "def text\n @text || @report\n end", "def to_s\n text\n end", "def to_s\n text\n end", "def text\n result_hash['text']\n end", "def to_s\n text\n end", "def text\n @text_utf8 ||= read_attribute(:text).dup.force_encoding(Encoding::UTF_8)\n end", "def texts; end", "def text\n document.text\n end", "def text\n text = @tag_data[:text]\n # convert_newlines_to_br\n text.gsub!(\"\\r\\n\", \"\\n\")\n text.gsub!(\"\\n\", \"\\n\")\n text\n end", "def text\n text = \"\"\n\n if html_part\n text = html_part.decode_body.to_s\n @is_text_html = true\n end\n\n if !text.present? && text_part\n text = text_part.decode_body.to_s \n @is_text_html = false\n end\n\n if !text.present?\n text = body.decoded.to_s \n @is_text_html = false\n end\n\n text\n end", "def to_s\n text.to_s\n end", "def text\n @body\n end", "def text\n self.body\n end", "def text\n body.text\n end", "def text\n ignores = [\n :text, :to_solr, :contribs, :img_src, :media_srcs,\n :captions_src, :transcript_src, :rights_code,\n :access_level, :access_types, :title, :ci_ids, :display_ids,\n :instantiations, :outside_url,\n :reference_urls, :exhibits, :special_collection, :access_level_description,\n :img_height, :img_width, :player_aspect_ratio,\n :player_specs, :transcript_status, :transcript_content,\n :playlist_group, :playlist_order, :playlist_map,\n :playlist_next_id, :playlist_prev_id, :supplemental_content, :contributing_organization_names,\n :contributing_organizations_facet, :contributing_organization_names_display, :producing_organizations,\n :producing_organizations_facet, :build_display_title\n ]\n\n @text ||= (PBCore.instance_methods(false) - ignores)\n .reject { |method| method =~ /\\?$/ } # skip booleans\n .map { |method| send(method) } # method -> value\n .select { |x| x } # skip nils\n .flatten # flattens list accessors\n .map { |x| x.respond_to?(:to_a) ? x.to_a : x } # get elements of compounds\n .flatten.uniq.sort\n end", "def to_text\n return \"\" unless content\n content.to_text\n end", "def text\n [email protected]\n v == \"\" ? nil : v\n end", "def text\n [email protected]\n v == \"\" ? nil : v\n end", "def text\n # if the title is not present, show the code\n get_translation(self.text_translations, self.dataset.current_locale, self.dataset.default_language)\n end", "def text()\n return @driver.get_sc_core_query_element_text(@handle, @index)\n end", "def text\n return @edit_line.text\n end", "def text?; end", "def text?; end", "def text?; end", "def text\n options.fetch(:text, nil)\n end", "def display_text\n return @display_text\n end", "def content\n text\n end", "def text\n \"STRAT\"\n end", "def text\n self.title + \" -- \" + self.description\n end", "def text\n options[:text]\n end", "def raw_text\n text = ''\n\n objects = get_objects(get_data(@file))\n objects = decode_objects(objects)\n\n objects.each { |o| text += o[:data] if(o[:data] and is_text_header?(o[:header])) }\n\n text\n end", "def text\n res = \"\"\n @contents.each{|c|\n if c.is_a? XML\n res << c.text\n elsif c.is_a? String\n res << c\n end # Ignore XML_PI/XML_Comment\n }\n res\n end", "def get_text\n `#{@element}.textContent`\n end", "def get_text(path = T.unsafe(nil)); end", "def text\n @tag_data[:text]\n end", "def inner_text; end", "def inner_text; end", "def result_for_title\r\n result_for_txt.text\r\n end", "def text\n\tif @object_id != nil\n\t @text = @selenium.get_text(@object_id)\n\telse\n\t for wait in 1..20 do\n\t\tbegin\n\t\t @text = @selenium.get_text(@locator)\n\t\t break\n\t\trescue => e\n\t\t sleep(0.5)\n\t\tend\n\t end\n\tend\n\treturn @text\n end", "def text(t)\n\t\t\treturn t.text unless t.nil?\n\t\t\tt\n\t\tend", "def text\n return @text if @text\n\n @text = @node.inner_text\n\n # If there is no text, try to find an image and use it's alt text\n if (@text.nil? or @text.empty?) and imgs = @node.search('img') then\n @text = imgs.map do |e|\n e['alt']\n end.join\n end\n\n @text\n end", "def text\n self.children.each do |node|\n if node.node_type == TEXT_NODE\n if node.content && node.content.rstrip.length > 0\n return node.content\n end\n end\n end\n\n return nil\n end", "def to_s\n \"#{text}\"\n end", "def to_s\n \"#{text}\"\n end", "def special_text\n @special_text\n end", "def text\n text = [title, abstract].join(\"\\n\")\n\n Misc.fixutf8(text)\n end", "def descr\n return text_get(2, id)\n end", "def text(str); end", "def text(include_ocr: false)\n return @text if defined? @text\n\n @text = Henkei.read :text, data, include_ocr: include_ocr\n end", "def text\n platform.text\n end", "def text\n raise Exceptions::EducatorNotAuthorized unless is_authorization_override_enabled?\n\n workspace_id = params.require(:workspace_id)\n class_list = ClassList.latest_class_list_for_workspace(workspace_id)\n text = ClassListText.new(class_list).dangerously_render_as_text\n render plain: text\n end", "def text_content\n @_node.getTextContent\n end", "def output\n @text\n end", "def text\n txt = @text\n if @compressed\n txt = PngMethods::inflate(@text)\n end\n\n if @international\n txt.force_encoding(\"UTF-8\")\n else\n txt.force_encoding(\"ISO-8859-1\")\n end\n end", "def text\n @parts.join\n end", "def text\n @grpc.text\n end", "def get_text_only(doc)\n text = StringIO.new\n if doc.kind_of?(Hpricot::Text)\n text.printf(\"%s\\n\", doc.to_s.strip) unless doc.to_s.strip.empty?\n else\n if doc.respond_to?(:children)\n doc.children.each do |child|\n text.printf(\" %s\", get_text_only(child))\n end\n end\n end\n text.string.strip\n end", "def full_text\n return self.text[:full_text]\n end" ]
[ "0.84308934", "0.83332705", "0.8332116", "0.8332116", "0.8326171", "0.83171135", "0.8269036", "0.8093497", "0.7808185", "0.7808185", "0.7808185", "0.7754313", "0.7742476", "0.7683616", "0.7660921", "0.7660921", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.7656808", "0.76108855", "0.75885177", "0.7577538", "0.75465065", "0.75465065", "0.75417566", "0.7538936", "0.75335586", "0.75091934", "0.7506454", "0.7493811", "0.7493811", "0.7480251", "0.7475761", "0.7437803", "0.74174225", "0.74110323", "0.74031174", "0.7377648", "0.7361773", "0.7348396", "0.73468715", "0.7344949", "0.7319466", "0.7313263", "0.7312289", "0.7296828", "0.7289385", "0.7285691", "0.7285008", "0.7285008", "0.72334206", "0.7220061", "0.71976376", "0.7191065", "0.7191065", "0.7191065", "0.71854925", "0.71442777", "0.71398807", "0.71398264", "0.7122979", "0.71205664", "0.7110486", "0.71096", "0.71088547", "0.7108277", "0.7080699", "0.70731807", "0.70731807", "0.70567155", "0.70416486", "0.7038165", "0.7022213", "0.70203215", "0.7003035", "0.7003035", "0.69804645", "0.6975347", "0.69648266", "0.6956736", "0.6955678", "0.6944755", "0.6928409", "0.6921414", "0.6916064", "0.69132566", "0.6911239", "0.6902897", "0.6881162", "0.68780303" ]
0.0
-1
Looks for a picture on wikipedia. DEPRECATED!
def image return @wiki_img if @wiki_img logger.info "finding picture for #{name}" Wikipedia.Configure do domain "en.wikipedia.org" path "w/api.php" end p = page if p && p.image_urls && p.image_urls.count > 0 @wiki_img = p.image_urls.last # last one is the one on the right self.picture = @wiki_img self.save @wiki_img else nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_wikipedia_image_url(wikipedia_url)\n begin\n\n return nil if !wikipedia_url || wikipedia_url.empty?\n\n # Download the wikipedia page\n page = Nokogiri::HTML(open(wikipedia_url))\n\n # Get the image href:\n link = page.css( @settings.image_selector ).first\n return if !link\n image_href = link.attr('href')\n image_href = URI.unescape(image_href)\n # image_href => '/wiki/Archivo:Metallica_at_The_O2_Arena_London_2008.jpg'\n\n # Get the image \"id\":\n slash_idx = image_href.rindex('/')\n return if !slash_idx\n image_id = image_href[ slash_idx + 1 .. -1 ]\n # image_id => 'Archivo:Metallica_at_The_O2_Arena_London_2008.jpg'\n\n # Get the full URL:\n # /w/api.php?action=query&prop=imageinfo&format=json&iiprop=url&titles=Archivo%3AMetallica_at_The_O2_Arena_London_2008.jpg\n image_info = Wikipedia.client.request( {\n action: 'query',\n prop: 'imageinfo',\n iiprop: 'url',\n titles: image_id,\n format: 'json'\n } )\n # result => {\n # \"batchcomplete\": \"\",\n # \"query\": {\n # \"normalized\": [\n # {\n # \"from\": \"Archivo:Metallica_at_The_O2_Arena_London_2008.jpg\",\n # \"to\": \"Archivo:Metallica at The O2 Arena London 2008.jpg\"\n # }\n # ],\n # \"pages\": {\n # \"-1\": {\n # \"ns\": 6,\n # \"title\": \"Archivo:Metallica at The O2 Arena London 2008.jpg\",\n # \"missing\": \"\",\n # \"imagerepository\": \"shared\",\n # \"imageinfo\": [\n # {\n # \"url\": \"https://upload.wikimedia.org/wikipedia/commons/0/07/Metallica_at_The_O2_Arena_London_2008.jpg\",\n # \"descriptionurl\": \"https://commons.wikimedia.org/wiki/File:Metallica_at_The_O2_Arena_London_2008.jpg\"\n # }\n # ]\n # }\n # }\n # }\n # }\n image_info = search = JSON.parse(image_info)\n\n image_url = image_info['query']['pages']['-1']['imageinfo'][0]['url']\n return image_url\n rescue\n Log.log_last_exception\n return nil\n end\n end", "def ask_wikipedia(search)\n # what is passed in when following a link will be encoded\n search = CGI::unescape(search)\n \n # looks like the encoding we are receiving is not the same as what wikipedia will take in some cases \n # so we decode and then re-encode this so it goes to wikipedia correctly\n search = CGI::escape(search) unless search == \"::Home\"\n\n path = \"/wiki/#{search}\"\n puts \"path = #{path}\"\n \n # temporarily we hardcode these headers which are required by m.wikipedia.org\n headers = {\n # 'User-Agent' => 'Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28'\n 'User-Agent' => 'Rhosync'\n }\n \n response, data = fetch(path, headers)\n data = rewrite_urls(data)\n \n [data].pack(\"m\").gsub(\"\\n\", \"\")\n end", "def image_search(q)\n\tterm = q.gsub(/#/, '').gsub(/[\\W]/, '+')\n\topen(SEARCH + term) do |f|\n\t\treturn nil unless f.status[0] == '200'\n\t\th = Hpricot(f.read)\n\t\t# in the rare case there are no results...\n\t\tif (i = h.at('#ImgCont//img'))\n\t\t i['src']\n\t\telse\n 'http://tbn0.google.com/images?q=tbn:WgkIHy0O9DyKJM:http://www.kreiseder.at/wp-content/2008/07/lolcat404.png'\n\t\tend\n\tend\nend", "def hunt_for_wiki_image_in links, agent\n return\n links.each{|l| puts l.href}\n STDIN.gets\n if links = links.compact.select{|l| l.href =~ /(?!book)(.*)F.*jl.*(jpg|png|gif|JPG|PNG|GIF)/}\n unless links.empty?\n link = agent.get( \"#{WIKIPEDIA_MAIN}#{links[ rand(links.size) ]}\" ).links.select{|l| l.href =~ /.*\\.(jpg|png|gif|JPG|PNG|GIF).*/}.first.href\n\n push_to_freeblog(@@settings[:freeblog].first,@@settings[:freeblog].last,link)\n else\n puts 'nincs kép'\n end\n end\nend", "def wikipedia\n uri = nil\n @artist_data[\"relations\"].each do |rel|\n if rel[\"type\"] == \"wikipedia\"\n uri = rel[\"url\"][\"resource\"]\n end\n end\n return uri\n end", "def top_image(url)\n og_image = check_og_image(url)\n apple_image = check_apple_image(url)\n mechanize_search = mechanize_search(url)\n if og_image\n return og_image\n elsif apple_image\n return apple_image\n elsif mechanize_search\n mechanize_search \n # In case all else fails ...\n else\n \"../image-dne.jpg\"\n end\n end", "def search_for_first_image(doc)\n @first_image = doc.css('img')\n .map { |i| i.attribute('src') }\n .compact\n .map(&method(:absolutize_url))\n .first\n end", "def get_wiki_url(query)\n search_keywords = query.strip.gsub(/\\s+/,'+')\n url = \"http://www.google.com/search?q=#{search_keywords}+site%3Aen.wikipedia.org&safe=active\"\n begin\n doc = Hpricot(open(url, \"UserAgent\" => \"reader\"+rand(10000).to_s).read)\n result = doc.search(\"//div[@id='ires']\").search(\"//li[@class='g']\").first.search(\"//a\").first\n rescue\n return ''\n end\n if result\n return result.attributes[\"href\"]\n else\n return ''\n end\n end", "def download_wiki_image(artist)\n\n # Check if the artist image already exists\n return if artist.image_path(:medium)\n\n image_url = get_wikipedia_image_url(artist.wikilink)\n MetaGeneration::download_artist_image(artist, image_url)\n end", "def get_image_from_google_for(keywords)\n get_link_from_google_for keywords, :image\n rescue Exception\n ''\n end", "def find_image(data)\n tags = Nokogiri::HTML(data)\n imgs = tags.css('img').map { |i| i['src'] }\n imgs.each do |img|\n if (img.include?(\".jpg\") || img.include?(\".png\"))\n return img\n end\n end\n return nil\n end", "def get_img(coords, mid)\n url = URI(URI.encode(\"http://google.com/movies?near=#{coords[0]}, #{coords[1]}&mid=#{mid}\"))\n\n\n doc_str = Net::HTTP.get(url)\n doc = Nokogiri::HTML(doc_str)\n\n#working here\n str = nil\n if doc.css('.img img').empty?\n return nil\n else\n str = doc.css('.img img').attr('src').to_s\n if str.include?('tbn')\n return str\n end\n end\n return nil\n end", "def get_image(image_url)\n # Open webpage and obtain HTML\n url = \"https://www.mariowiki.com\" + image_url\n document = Nokogiri::HTML(open(url))\n\n image_element = document.css('div.fullImageLink a')\n image_path = image_element.attr('href').value\n image = \"https://www.mariowiki.com\" + image_path\n\n return image\nend", "def wiki_image_data(image)\n RestClient.get(image['image_url'], :accept => image['image_content_type'])\n end", "def wikipedia_link\n\t\tp = localized_page\n\t\tbase = \"https://#{langtag(I18n.locale)}.wikipedia.org\"\n\t\treturn base unless p && p.title\n\t\t\"#{base}/wiki/#{p.title}\"\n\tend", "def get_wikipedia_image\n respond_to do |format|\n format.js do\n meta = MetaGeneration.new(Setting.get_settings)\n wiki_url = URI.escape(params[:wikipedia_url])\n @wikipedia_image_url = meta.get_wikipedia_image_url(wiki_url)\n end\n end\n end", "def single_picture(foursq_id)\n foursq_hash = Instagram.location_search(foursq_id)\n if foursq_hash.empty?\n return \"http://media.npr.org/assets/news/2010/01/30/tianshan2-1a2a29b83bc7a670bf8210d9c6daefa3ba46f971-s6-c30.jpg\"\n else\n all_results = Instagram.location_recent_media(foursq_hash[0][\"id\"])\n if all_results.empty?\n return \"http://media.npr.org/assets/news/2010/01/30/tianshan2-1a2a29b83bc7a670bf8210d9c6daefa3ba46f971-s6-c30.jpg\"\n else\n all_results.sample[\"images\"][\"standard_resolution\"][\"url\"]\n end\n end\n end", "def wiki_images(project, on_page = nil)\n opts = {}\n opts[:page] = on_page if on_page\n fetch_all(\"projects/#{project}/features/wiki/images\", 'images', opts)\n end", "def getStockImage(link)\n dog_page = HTTParty.get(link, :verify => false)\n parsed_dog_page = Nokogiri::HTML(dog_page)\n\n info_table = parsed_dog_page.css(\".biota\")[0]\n \n image = info_table.css(\"img\")[0]\n pic = image != nil ? \"https:#{image['src']}\" : nil\nend", "def top_article_wikipedia(query)\n parsed_query = query.split.map { |word| URI.escape(word) }.join('+')\n url = \"https://en.wikipedia.org/w/api.php?action=opensearch&search=#{parsed_query}\"\n response = RestClient.get(url)\n if response.code != 200 # wikipedia's responses are almost always 200 (expect FATAL) but may contain errors or warnings\n nil\n else\n response_content = JSON.parse(response)\n if response_content[1] == [] # search didn't yield any result\n nil\n # search was successful\n else\n articles = response_content[1]\n urls = response_content[3]\n { title: articles.first, url: urls.first, source: \"wikipedia.com\" }\n end\n end\n end", "def get_wikipedia_articles\n Geonames::WebService.find_nearby_wikipedia :lat => @latitude, :long => @longitude\n end", "def get_google_img(query)\n img_search_keywords = query.strip.gsub(/\\s+/,'+')\n \n if img_search_keywords != ''\n url = \"http://ajax.googleapis.com/ajax/services/search/images?rsz=large&start=1&v=1.0&q=#{img_search_keywords}\"\n \n json_results = open(url) {|f| f.read };\n results = JSON.parse(json_results)\n image_array = results['responseData']['results']\n image = image_array[0] if image_array\n image = image['tbUrl']\n \n if image\n return image\n else\n return 'no image found'\n end\n end\n end", "def find_image_url(link)\n url = nil\n if !link.nil?\n url = image_url_instagram link if (link.index('instagr.am') || link.index('instagram.com'))\n url = image_url_picplz link if link.index 'picplz'\n url = image_url_twitpic link if link.index 'twitpic'\n url = image_url_yfrog link if link.index 'yfrog'\n url = image_url_imgly link if link.index 'img.ly'\n url = image_url_tco link if link.index 't.co'\n url = image_url_lockerz link if link.index 'lockerz.com'\n url = image_url_foursquare link if link.index '4sq.com'\n url = image_url_embedly link if url.nil? #just try embed.ly for anything else. could do all image url processing w/ embedly, but there's probably some kind of rate limit invovled.\n end\n url\n end", "def getImgURL(title, year)\n title = URI.escape(title + \" \" + year.to_s + \" movie poster\")\n req = \"https://www.googleapis.com/customsearch/v1?key=AIzaSyAyLoJQc-3aOYZLlHff3S4JPmeK88rL878&cx=015799936154194163641:2d_yj8n3fbm&q=\"+title+\"&searchType=image\"#&imgSize=medium\"\n img_results = JSON.parse(@shttp.call(req))\n if img_results && img_results[\"items\"]\n img_results[\"items\"].each do |img_result|\n link = img_result[\"link\"]\n\n begin\n # Return the first link that gives a 200\n if @shttp.head(link) == \"200\"\n return link\n else\n Rails.logger.warn \"Link inaccessible, skipping to next one...\"\n end\n rescue Exception => ex\n Rails.logger.error ex.message\n end\n end\n end\n\n # Return empty string if we don't find anything\n return \"\"\n end", "def get_images(hash)\n url = open(\"https://www.mariowiki.com/Super_Smash_Bros._Ultimate\")\n document = Nokogiri::HTML(url)\n\n veteran_table = document.css(\".gallery.mw-gallery-traditional\")[0]\n newcomers_table = document.css(\".gallery.mw-gallery-traditional\")[1]\n\n get_portraits_and_icons(hash, veteran_table)\n get_portraits_and_icons(hash, newcomers_table)\nend", "def findThumbnailImageURL\n unless @doc.present?\n Rails.logger.info \"RecipeParser.findThumbnailImageURL: document not initialized\"\n return nil\n end\n\n # meta tags to tell social media which image to use for links in order of importance\n # Reference: https://moz.com/blog/meta-data-templates-123\n metaTagsLookingFor = [\"meta[property='og:image:secure_url']\", \"meta[property='og:image']\", \"meta[itemprop='image']\", \"meta[name='twitter:image:src']\", \"link[rel='image_src']\", \"a[rel='image_src']\"]\n\n metaTagsLookingFor.each do |metaTag|\n node = @doc.at_css(metaTag)\n if node != nil\n imageURL = node.attribute('content') || note.attribute('href')\n Rails.logger.info \"RecipeParser.findThumbnailImageURL: found image thumbnail #{imageURL}\"\n return imageURL\n end\n end\n\n #TODO: Find image if page does not use social media meta.\n\n Rails.logger.info \"RecipeParser.findThumbnailImageURL: unable to find thumbnail image URL\"\n return nil\n end", "def get_info(w)\n\trequire 'open-uri'\n\tparagraph = []\n\tcontents = open('http://en.wikipedia.org/wiki/' + w) {|f| \n\t\tf.readlines.each {|x| \n\t\t\tif x =~ /<p>(.*)<\\/p>/\n\t\t\tparagraph.push($1)\n\t\t\tend\n\t}}\n\n\t# If a file name was passed in to be stored somewhere\n\t# Otherwise, Temp.doc will be created and modified\n\tif(ARGV[0] != nil)\n\t\tfile = File.open(ARGV[0], 'a')\n\telse\n\t\tfile = File.open(\"Temp.doc\", 'a')\n\tend\n\n\t# Writes to file what is being searched for\n\tfile.write(w.upcase + \":\\n\")\n\n\t# Uses regular expression to grab first two paragraph\n\tparagraph.each {|p| paragraph(p,file)}\n\t\n\tfile.write(\"\\n\")\n\tfile.close\nend", "def image(local=1)\n unless cururl.index(Internet_path)\n fail \"You can only do this on a Researchr wikipage\"\n end\n wiki = cururl[22..-1]\n w,dummy = wiki.split(\"?\")\n wikipage = w.gsubs({:all_with => \"_\"}, \":\", \"%3A\", \"%20\").downcase\n\n if local==1\n curfile = File.last_added(\"#{Home_path}/Desktop/Screen*.png\") # this might be different between different OSX versions\n else\n dir = File.last_added_dir(Photostream_path) # this might be different between different OSX versions\n curfile = File.last_added(dir+\"*.JPG\")\n end\n if curfile == nil\n growl(\"No screenshots available\")\n exit\n end\n\n newfilename, pagenum = filename_in_series(\"#{Wiki_path}/data/media/pages/#{wikipage}\",\".png\")\n p newfilename\n if File.exists?(newfilename)\n pbcopy(\"\")\n fail(\"File already exists, aborting!\")\n end\n puts %Q(mv \"#{curfile.strip}\" \"#{newfilename}\")\n `mv \"#{curfile.strip}\" \"#{newfilename}\"`\n if defined?(dir) # if from iCloud\n `rm -rf \"#{dir}\"`\n `sips --resampleWidth 487 #{newfilename}`\n end\n `touch \"#{newfilename}\"` # to make sure it comes up as newest next time we run filename_in_series\n\n pbcopy(\"{{pages:#{wikipage}#{pagenum}.png}}\")\nend", "def query(payload)\n\turi = URI('http://tindermon.ka0labs.org/avatar/' + payload)\n\tres = Net::HTTP.get(uri)\n\tif res.include? \"1.jpg\"\n\t\treturn true\n\tend\n\treturn false\nend", "def link_wikipedia(term, desc)\n # query = Rack::Utils.escape(\"site:wikipedia.org #{term}\")\n # href = \"http://google.com/?q=#{query}\"\n term = Rack::Utils.escape(term)\n tag(:a, desc, :href => \"http://en.wikipedia.org/w/#{term}\", :class => 'wiki-link-external')\n end", "def search_giphy_for query\n\n Giphy::Configuration.configure do |config|\n config.api_key = ENV[\"GIPHY_API_KEY\"]\n end\n\n results = Giphy.search(query, {limit: 20})\n\n unless results.empty?\n #puts results.to_yaml\n gif = results.sample.original_image.url\n return gif.to_s\n\n else\n return nil\n end\n\nend", "def get_image1(doc, image)\n x = doc.xpath(image).to_s\n end", "def get_images(tag)\n\tpageThumb = get_page(\"#{URL_MOTARU}/categories/view/name/#{tag}\")\n\treturn pageThumb.search(\"//div[@id='categoryWallpapersList']//img[@class='wallpaperThumb']\")\nend", "def wikipedia_summary(url)\n doc = Nokogiri::HTML(URI.parse(url).open)\n first_para_html = doc.search('//p').first.to_s # .gsub(/<\\/?[^>]*>/, \"\")\n Sanitize.clean(first_para_html)\n rescue Exception\n nil\n end", "def wikipedia_summary(url)\n doc = Nokogiri::HTML(open(url))\n first_para_html = doc.search('//p').first.to_s # .gsub(/<\\/?[^>]*>/, \"\")\n return Sanitize.clean(first_para_html)\n rescue Exception\n return nil\n end", "def find(phrase, limit=15, snippet=false, display=true)\n search = phrase.split.join(\"_\")\n if snippet\n endpoint = \"https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=#{search}&srlimit=#{limit}\"\n else\n endpoint = \"https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&srsearch=#{search}&srlimit=#{limit}&srprop\"\n end\n hash = get(endpoint)\n info = hash[\"query\"][\"searchinfo\"]\n results = hash[\"query\"][\"search\"]\n if display\n puts \"Total hits : #{ info[\"totalhits\"] }\"\n if info[\"suggestion\"]\n puts \"Suggestion : #{ info[\"suggestion\"] }\"\n end\n puts \"Displaying #{results.length} results:\"\n results.each do |result|\n # https://stackoverflow.com/a/1732454\n if snippet\n snip = result[\"snippet\"].gsub( /<.*?>/, \"\" ).gsub( /&\\w+;/, \"\" ).split.join(\" \")\n puts \"\\n'#{result[\"title\"]}' : #{snip}...\"\n else\n puts \"\\n'#{result[\"title\"]}'\"\n end\n end\n end\n return hash\n end", "def wiki(project, slug)\n get(\"/projects/#{url_encode project}/wikis/#{slug}\")\n end", "def imgurl\n picref.imgurl if picref\n end", "def get_wiki(search)\n return Wikipedia::article(search).first\n search = search.split(/\\s+/).map {|w| w.capitalize }.join(' ')\n page = Wikipedia.find(search)\n g = JSON.parse(page.json)\n content = g[\"query\"][\"pages\"].first.last[\"revisions\"].first\n\n\n content = content[\"*\"]\n\n\n wiki = WikiCloth::Parser.new({ data: content })\n\n html = wiki.to_html\n\n doc = Nokogiri::HTML(html)\n doc = doc.xpath(\"//p\").to_s\n doc = Nokogiri::HTML(doc)\n doc = doc.xpath(\"//text()\").to_s\n\n doc = doc.split(\"\\n\")\n\n plaintext = []\n\n doc.each do |d|\n unless d.empty?\n plaintext << d\n end\n end\n\n\n return plaintext\n end", "def imageNameFromUrl(url,idx)\n ImageFinder.nameForImageFromUrl(url,@start_idx,idx)\n end", "def wikipedia_link\n to_nil _response_entity.fetch(\"wikiLink\", nil)\n end", "def get_image\n blog_contents = Nokogiri::HTML(self.content)\n\n if blog_contents.xpath(\"//img\").blank?\n self.post_image = nil\n else\n image_link = blog_contents.xpath(\"//img\")[0]['src']\n\n if image_link.include?(\"http://\")\n self.post_image = File.open(image_link)\n else\n image_link = Dir.pwd.concat(\"/public\" + image_link)\n self.post_image = File.open(image_link)\n end\n end\n\nend", "def get_image_link(page) # someday use regex here\n\t\t\tsource = getHtml(page)\n\t\t\tsource = source.gsub(\"enlarge()\", \"º\")\n\t\t\tsource = source[source.index(\"º\"), source.length]\n\t\t\tsource = source.gsub(\"http://\", \"$\")\n\t\t\tsource = source[source.index(\"$\"), source.length]\n\t\t\treturn source[1, source.index(\"\\\"\") - 1]\n\t\tend", "def page_link(link, data)\n get_page_from_link(link, data, '//img[@id=\"image\"]')\n end", "def not_found_image\n scryfall.card_code_number('5dn', 52)['image_uris']['large']\n end", "def find_page(pname, verify = true)\n\t\tlogger.debug \"looking up page: #{pname}\"\n\t\tlogger.debug \"verify find: #{verify}\"\n\t\tr = Wikipedia.find(pname)\n\t\t\n\t\t# parse disambiguation meta data\n\t\tunless is_artist_page? r\n\t\t\tlogger.debug \"check for disambiguation meta data\"\n\t\t\n\t\t\t# check for {about|A|B|1|C|2...|Z|N} patterns\n\t\t\t# where we are intrested in B|1 - Z|N\n\t\t\tm = r.content.scan(/\\{about\\|[\\w\\s]*((\\|[^\\}\\{\\|]*\\|[^\\}\\{\\|]*)*)\\}/) if r.content\n\t\t\tunless m == nil || m.empty? || m.first.empty?\n\t\t\t\t# l = [\"B\", \"1\", \"C\", \"2\", ... , \"Z\", \"N\"]\n\t\t\t\tl = m.first.first[1..-1].split(\"|\")\n\t\t\t\t1.step(l.size-1,2).each do |i|\n\t\t\t\t\t# check pages \"1\", \"2\" .. \"N\"\n\t\t\t\t\tp = find_page(l[i])\n\t\t\t\t\tr = p if p\n\t\t\t\t\tbreak\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\t# parse links\n\t\tlogger.debug \"follow links (desperate!)\" if !is_artist_page?(r) && is_disambiguation_page?(r)\n\t\tr = follow_links(r) if !is_artist_page?(r) && is_disambiguation_page?(r)\n\t\t\n\t\t# verify category\n\t\t(!verify || is_artist_page?(r)) ? r : nil\n\tend", "def get_image2(doc, image)\n x = doc.xpath(image).first.to_s\n end", "def picurl\n picurl = object.imgurl\n (picurl.present? && sample_page) ? valid_url(picurl, sample_page) : picurl\n end", "def thumbnail_url document\n return document.thumbnail_path if document.try(:thumbnail_path).present?\n if document.id == document.thumbnail_id\n representative_document = document\n else\n representative_document = ::SolrDocument.find(document.thumbnail_id)\n end\n\n thumbnail_file_id = representative_document.original_file_id\n if thumbnail_file_id\n Hyrax.config.iiif_image_url_builder.call(thumbnail_file_id, nil, '250,')\n else\n raise 'thumbnail_file_id is nil'\n end\n\n rescue\n image_path 'default.png'\n end", "def get_thumb(register)\n begin\n thumb = SolrQuery.new.solr_query(\"id:#{register}\", 'thumbnail_url_tesim', 1)['response']['docs'][0]['thumbnail_url_tesim']\n if thumb.nil?\n #return a generic thumbnail\n 'register_default.jpg'\n else\n thumb[0]\n end\n rescue => error\n log_error(__method__, __FILE__, error)\n raise\n end\n\n end", "def image\n #images = Musicbrainz_db.get_cover_art(self.id)[\"images\"]\n\n images = SearchModule.get_cover_art(self.id)\n if images != nil\n return images[\"images\"].first[\"thumbnails\"][\"large\"]\n else\n return 'http://djpunjab.in/cover.jpg'\n end\n end", "def result_image_url\n safe_image_url( :searchresult )\n end", "def image(id, nsfw = false)\n img = get url: \"images/#{id}\", nsfw: nsfw\n img['image'] if img\n end", "def fulltext_image_format(search_str)\n image_formats = ImageFormat.where(\"lower(name) = ?\", search_str.downcase)\n ret = nil\n if image_formats.count == 1\n image_format = image_formats.first\n ret = []\n ret[0] = \", which is an image format.\"\n ret[1] = \"You'll get better results by searching by the input file format:<br />\"\n ret[1] += raw link_to(\"Search for #{image_format.name}\", programs_path(q: {read_format: image_format.id}))\n end\n return ret\n end", "def description_image\n parsed_description.css('img').first # there's only one\n end", "def search_image(file)\n Dir.glob(File.join(@default_dir_images, file) + '.{png,gif,jpg}').first\n end", "def extract_image_url(tweet)\n link = extract_link tweet\n find_image_url link\n end", "def images(article_or_pageid, imlimit = 200)\n form_data = {'action' => 'query', 'prop' => 'images', 'imlimit' => imlimit, 'redirects' => true}\n case article_or_pageid\n when Fixnum\n form_data['pageids'] = article_or_pageid\n else\n form_data['titles'] = article_or_pageid\n end\n xml, dummy = make_api_request(form_data)\n page = xml.elements[\"query/pages/page\"]\n if valid_page? page\n if xml.elements[\"query/redirects/r\"]\n # We're dealing with redirect here.\n images(page.attributes[\"pageid\"].to_i, imlimit)\n else\n imgs = REXML::XPath.match(page, \"images/im\").map { |x| x.attributes[\"title\"] }\n end\n else\n nil\n end\n end", "def url\n\t\t\"#{base}/wiki/#{page}\"\n\tend", "def check_og_image(url)\n begin \n og_image = Nokogiri::HTML(open(url)).css('meta[property=\"og:image\"]')\n og_image.first.attributes[\"content\"].value if og_image\n rescue\n nil\n end\n end", "def search(phrase, limit=5, description=true, display=true)\n search = phrase.split.join(\"_\")\n endpoint = \"https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=#{search}&limit=#{limit}\"\n hash = get(endpoint)\n results = hash[1]\n descriptions = hash[2]\n if display\n puts \"Displaying #{results.length} results:\"\n for i in 0...results.length\n if description\n if ! descriptions[i].empty?\n puts \"\\n'#{results[i]}' : #{descriptions[i]}\"\n else\n puts \"\\n'#{results[i]}' : No Immediate Description Available. Try `wik -d #{results[i]}`\"\n end\n else\n puts \"\\n'#{results[i]}'\"\n end\n end\n end\n return hash\n end", "def search_wikipedia\n respond_to do |format|\n format.html do\n @wikipedia_search_text = params[:artist_name]\n meta = MetaGeneration.new(Setting.get_settings)\n @wikipedia_search = meta.search_text(@wikipedia_search_text, 10)\n render 'search_wikipedia.html', layout: false\n end\n end\n end", "def google_image_search(query)\n google_results = JSON.parse(open(\"http://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q=#{query}\").read)\n google_results['responseData']['results'][rand(8).floor]['unescapedUrl']\n end", "def do_search(image_path)\n @driver.navigate.to \"http://www.google.co.uk/searchbyimage\"\n # show the upload dialog\n @driver.execute_script(\"google.qb.ti(true)\")\n\n # upload image and search\n upload = @driver.find_element(:name, 'encoded_image')\n upload.send_keys(File.expand_path image_path)\n\n # best result\n wait = Selenium::WebDriver::Wait.new(:timeout => 100)\n wait.until { @driver.find_element(:id => 'topstuff') }\n topstuff = @driver.find_element(:id => 'topstuff')\n best = topstuff.text.lines.to_a.last\n if not best.match /Best(.*)/\n result = \"Can't figure it out for the life of me, sorry!\"\n else\n best.gsub!(\"Best guess for this image:\", \"\")\n result = \"I believe this is a picture of: #{best}.\"\n end\n end", "def view(title=nil, id=nil)\n if title\n encoded = title.split.join(\"_\")\n endpoint = \"https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=wikitext&page=#{encoded}&redirects\"\n elsif id\n encoded = title.split.join(\"_\")\n endpoint = \"https://en.wikipedia.org/w/api.php?action=parse&format=json&prop=wikitext&pageid=#{encoded}\"\n end\n hash = get(endpoint)\n page = hash[\"parse\"][\"wikitext\"].to_s.gsub( '\\n', \"\\n\" )\n tmp = Tempfile.new(\"wik-#{encoded}-\")\n tmp.puts page\n system \"less #{tmp.path}\"\n tmp.close\n tmp.unlink\n return hash\n end", "def get_image_url (origin_url)\n begin\n html = open(origin_url).read\n urls = URI.extract(html)\n .select { |lnk| lnk[/\\.jpg$|\\.png$|\\.gif$|\\.jpeg/m] }\n return urls.empty? ? nil : urls[0]\n rescue Exception => e\n puts \"[ERROR] in 'DavidGetter#get_image': #{e}\"\n return nil\n end\n end", "def thumb_id\n regex_url = /pictures[\\/][\\d]+[\\/]/ \n string_url = self.content.scan(regex_url).to_s \n regex_id = /[\\d]+/ \n picture_id = string_url.scan(regex_id)[0]\n return picture_id\n end", "def thumb_id\n regex_url = /pictures[\\/][\\d]+[\\/]/ \n string_url = self.content.scan(regex_url).to_s \n regex_id = /[\\d]+/ \n picture_id = string_url.scan(regex_id)[0]\n return picture_id\n end", "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end", "def check_our_images!\n self.gsub!(/!image (\\w+\\/)?(\\d+)!/) do\n size, id = $1, $2\n size ||= 'thumb/'\n '\"!%s/%s%d.jpg!\":%s/image/show_image/%d' %\n [IMAGE_DOMAIN, size, id, HTTP_DOMAIN, id]\n end\n end", "def get_search_image(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :GET, 'File')\n end", "def gravatar_image(gravatar_response)\n (gravatar_response.to_s)[/http\\W*[\\w\\W]*\\?/]\n end", "def main(args)\n file, url = args\n if not url\n puts \"Missing URL\"\n return\n end\n\n\tlang, title = url =~ m{^https?://(\\w+)\\.wikipedia\\.org/wiki/(.*)$};\n\nend", "def random_image(query = 'safe, cute', nsfw = false)\n img = get(url: 'search/images', query: \"q=#{query.present? ? query : 'safe, cute'}&sf=random&per_page=1\", nsfw: nsfw)\n\n if img\n img_data = img['images'][0]\n image img_data.id, nsfw if img_data\n end\n end", "def get_player_image (page, index)\n photo_downloaded = false\n\n # Attempt to find div that contains image\n\n image_divs = page.css('div.ohio-staff--photo')\n\n # If found, continue\n\n if !image_divs.nil? && !image_divs[0].children.empty?\n\n # Get image text from returned object\n\n image_url = image_divs.to_s\n\n # We only want the url, scan with regex\n\n image_url = image_url.scan /https[a-zA-Z0-9\\-\\/\\.:]*.jpg/\n\n # Only continue at this point if we were able to parse a url\n\n unless image_url.empty?\n\n # Download image file\n\n open(image_url.first) do |image|\n File.open(\"lib/outputs/photos/PlayerPhoto#{index}.jpg\", \"wb\") do |file|\n file.write(image.read)\n end\n end\n photo_downloaded = true\n end\n end\n\n # If we couldn't find, return path to default image. Otherwise return local path\n\n unless photo_downloaded\n return \"photos/default.jpg\"\n end\n\n \"photos/PlayerPhoto#{index}.jpg\"\n\nend", "def get_image_url(page_doc)\n\timage_url = page_doc.css('body center:nth-child(1) a img')\n\n\tif image_url.nil? or image_url.length == 0\n\t\treturn nil\n\tend\n\n\treturn @base_url + image_url[0][\"src\"]\nend", "def show\n @wiki = Wiki.find(params[:id])\n end", "def get_imageinfo(files,props = :imageinfo)\n result=Array.new\n \n iiprop=CGI.escape(\"timestamp|user|url|dimensions|comment\")\n doc=Nokogiri::XML(open(\"http://commons.wikipedia.org/w/api.php?format=xml&action=query&prop=#{props.to_s}&titles=#{files}&iiprop=#{iiprop}\"))\n\n xp=\"//api/query/pages/page/imageinfo/ii\"\n xp=\"//api/query/pages/page/globalusage/gu\" if props==:globalusage\n\n ctr=0\n element=doc.xpath(xp).each do |element| \n img=Hash.new\n element.attributes.each do |a|\n img[a[0].to_sym]=element.get_attribute(a[0])\n end \n result << img\n \n @stockpile[\"#{@imagelist[ctr]}\"]=Hash.new unless @stockpile[\"#{@imagelist[ctr]}\"]\n @stockpile[\"#{@imagelist[ctr]}\"][props]=img\n ctr=ctr+1\n end\n result\n end", "def scrape_img( page, title )\n\t\t@desired_node=@img_url=nil\n\t\t@desired_nodes=[]\n\n\t\ttitle = scrape_title( page )\n\t\ttitle.slice!(title.rindex(\"|\")..title.length) unless title.rindex(\"|\").nil?\n\t\ttitle_words = title.downcase.strip.split(/ |-/).reject{|s| s=~/(\\|)|(with)|(recipe)|( [a-z]{1,3} )|\\d/}\n\n\t\t# for all 'img' tags, determine if it's title tag is \n\t\t# similar to the recipe title, or determine if the image filename\n\t\t# itself is similar to the title of the recipe. If so, hold on to the node\n\t\tpage.search(\"img\").each do |node|\n\t\t\tunless node.nil?\n\t\t\t\tunless node.attr(\"title\").nil?\n\t\t\t\t\ttitle_words.each do |word|\n\t\t\t\t\t\tif node.attr(\"title\").downcase =~ /(#{word})/\n\t\t\t\t\t\t\t@desired_nodes.push(node)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tunless node.attr(\"src\").nil?\n\t\t\t\t\ttitle_words.each do |word|\n\t\t\t\t\t\tif node.attr(\"src\").split(/\\//).last.downcase =~ /(#{word})/\n\t\t\t\t\t\t\t@desired_nodes.push(node)\n\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\t\n\t\t# Some sites strip out the host; add it, if necessary\n\t\t# Use default image if the algorithm couldn't find anything\n\t\t@img_url = @desired_nodes.first.attr(\"src\")\n\n\t\tif @img_url.nil?\n\t\t\treturn \"/assets/img_404.png\"\n\t\telse\n\t\t\t@img_url = ( \"http://\" << page.canonical_uri.host << @img_url ) unless uri?( @img_url )\n\t\t\treturn @img_url\n\t\tend\n\tend", "def search\n images = Google.instance.image_search(params[:text])\n if images.empty?\n render status: :not_found, body: t('controllers.giffy.search.no_results')\n return\n end\n\n num = [1.0/rand, images.size - 1].min\n image = images[num.to_i]\n\n Slack.instance.echo command\n Slack.instance.webhook_message command.channel_id, image, icon_url: view_context.image_url('giffy.png')\n\n head :ok\n end", "def find_inspire_image\n path = Dir[image_for('', 'mobile_inspire') + '*']\n path.first.split('/').last\n end", "def image_url_twitpic(link_url)\n image_url_redirect link_url, \"http://twitpic.com/show/full/\"\n end", "def image( name )\n @images[name]\n end", "def show\n #@picture = Picture.find(params[:id])\n @picture = @museum.pictures.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end", "def photo_from_url(url)\n end", "def process_contents\n @img_tags = @contents.xpath( '//img[@src]' )\n @img_tags.each do |tag|\n download_resource(File.join('http://wiki.dublincore.org', tag[:src]), File.join(@image_dir, File.basename(tag[:src])))\n end\n find_links\n end", "def find_photo_by_machinetag(plaque, flickr_user_id)\n# key = FLICKR_KEY # \"86c115028094a06ed5cd19cfe72e8f8b\"\n key = \"86c115028094a06ed5cd19cfe72e8f8b\"\n content_type = \"1\" # Photos only\n machine_tag_key = \"openplaques:id=\".to_s\n if (plaque)\n machine_tag_key += plaque.id.to_s\n end\n\n flickr_url = \"https://api.flickr.com/services/rest/\"\n method = \"flickr.photos.search\"\n license = \"1,2,3,4,5,6,7\" # All the CC licencses that allow commercial re-use\n\n 20.times do |page|\n\n url = flickr_url + \"?api_key=\" + key + \"&method=\" + method + \"&page=\" + page.to_s + \"&license=\" + license + \"&content_type=\" + content_type + \"&machine_tags=\" + machine_tag_key + \"&extras=date_taken,owner_name,license,geo,machine_tags\"\n\n if (flickr_user_id)\n url += \"&user_id=\" + flickr_user_id\n end\n puts url\n\n new_photos_count = 0\n response = open(url)\n doc = REXML::Document.new(response.read)\n doc.elements.each('//rsp/photos/photo') do |photo|\n print \".\"\n $stdout.flush\n\n @photo = nil\n\n file_url = \"http://farm\" + photo.attributes[\"farm\"] + \".staticflickr.com/\" + photo.attributes[\"server\"] + \"/\" + photo.attributes[\"id\"] + \"_\" + photo.attributes[\"secret\"] + \"_z.jpg\"\n photo_url = \"http://www.flickr.com/photos/\" + photo.attributes[\"owner\"] + \"/\" + photo.attributes[\"id\"] + \"/\"\n\n @photo = Photo.find_by_url(photo_url)\n\n if @photo\n else\n plaque_id = photo.attributes[\"machine_tags\"][/openplaques\\:id\\=(\\d+)/, 1]\n\n puts photo.attributes[\"title\"]\n\n @plaque = Plaque.find(:first, :conditions => {:id => plaque_id})\n if @plaque\n @photo = Photo.new\n @photo.plaque = @plaque\n @photo.file_url = file_url\n @photo.url = photo_url\n @photo.taken_at = photo.attributes[\"datetaken\"]\n @photo.photographer_url = photo_url = \"http://www.flickr.com/photos/\" + photo.attributes[\"owner\"] + \"/\"\n @photo.photographer = photo.attributes[\"ownername\"]\n if photo.attributes[\"license\"] == \"4\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by/2.0/\")\n elsif photo.attributes[\"license\"] == \"6\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nd/2.0/\")\n elsif photo.attributes[\"license\"] == \"3\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc-nd/2.0/\")\n elsif photo.attributes[\"license\"] == \"2\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc/2.0/\")\n elsif photo.attributes[\"license\"] == \"1\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-nc-sa/2.0/\")\n elsif photo.attributes[\"license\"] == \"5\"\n @photo.licence = Licence.find_by_url(\"http://creativecommons.org/licenses/by-sa/2.0/\")\n elsif photo.attributes[\"license\"] == \"7\"\n @photo.licence = Licence.find_by_url(\"http://www.flickr.com/commons/usage/\")\n elsif photo.attributes[\"license\"] == \"0\"\n @photo.licence = Licence.find_by_url(\"http://en.wikipedia.org/wiki/All_rights_reserved/\")\n else\n puts \"Couldn't find license\"\n end\n if @photo.save\n new_photos_count += 1\n puts \"New photo found and saved\"\n else\n# puts \"Error saving photo\" + @photo.errors.each_full{|msg| puts msg }\n end\n\n if photo.attributes[\"latitude\"] != \"0\" && photo.attributes[\"longitude\"] != \"0\" && [email protected]?\n puts \"New geolocation found\"\n @plaque.latitude = photo.attributes[\"latitude\"]\n @plaque.longitude = photo.attributes[\"longitude\"]\n if @plaque.save\n puts \"New geolocation added to photo\"\n else\n puts \"Error adding geolocation to photo\" + plaque.errors.full_messages.to_s #methods.join(\" \")\n end\n end\n else\n puts \"Photo's machine tag doesn't match a plaque.\"\n end\n end\n end\n end\n end", "def image_url_imgly(link_url)\n image_url_redirect link_url, \"http://img.ly/show/full/\", \"\\r\\n\"\n end", "def display_img_url(url)\n url.sub(/s90$/, 's360') \n # recipe_response = Faraday.get(\"http://api.yummly.com/v1/api/recipe/#{id}\",\n # _app_id: ENV['YUMMLY_APP_ID'],\n # _app_key: ENV['YUMMLY_APP_KEY'])\n # image = JSON.parse(recipe_response.body)['images'].try(:first)\n # image['hostedLargeUrl'].present? ? image['hostedLargeUrl'] : image['hostedMediumUrl'] if image.present?\n end", "def index\n if params.key?(:sq)\n search_params = {}\n search_params.merge!(original_search_params)\n @photos = Photo.search(search_params).result(distinct: true).page(params[:page])\n @page_h1 = '検索結果'\n elsif params[:tag]\n @photos = Photo.tagged_with(params[:tag]).page(params[:page])\n @page_h1 = \"タグ結果 - #{params[:tag]}\"\n else\n @photos = Photo.page(params[:page])\n @page_h1 = '写真一覧'\n end\n end", "def find_file(name)\n if name =~ /^\\//\n @wiki.file(name[1..-1], @version)\n else\n path = @dir == '.' ? name : ::File.join(@dir, name)\n @wiki.file(path, @version)\n end\n end", "def find_google_media(keyword, keyword_suffix, start = 0, klass = \"google_image\")\n final_keyword = \"#{keyword} #{keyword_suffix}\"\n puts \"Finding image for : #{final_keyword}, cursor_start=#{start}\"\n possible_media = GoogleImageSearch.new.search(final_keyword, start)\n return possible_media if possible_media.nil?\n\n index = 0\n possible_media.each { |media|\n if media[:width] >= 200 and check_hit?(klass, media[:url]) == false\n record_hit(klass, media[:url])\n return media\n end\n index += 1\n\n # No possible image was found... try going to next page\n if index >= possible_media.length\n return find_google_media(final_keyword, start+8, klass) # TODO : +8 is hardcoded for now, make it cursor based\n end\n }\n\n return nil\n end", "def find\n @@logger.debug(\"searching in #{@@root}\")\n sources = []\n \n begin\n doc = Hpricot(open(\"#{@@root}/indepth/inpictures/\"))\n doc.search(\"//table[@class='h89']\").each do |story|\n summary = story.search(\"//div[@class='indexSummaryText']:first\")\n source = story.search(\"//a[@target='_parent']\").first.attributes['href']\n sources << {\n :link => source,\n :summary => summary.inner_html.strip.downcase,\n :images => find_images(source),\n }\n end\n rescue Exception => ex\n @@logger.error(ex)\n end\n \n sources\n end", "def pic_one_url\n \tpic_one.url(:medium)\n end", "def count_images_of_one_page(page)\n perform_search_for_single_page('//img', [], page)\n end", "def image(size: T.unsafe(nil), search_terms: T.unsafe(nil), match_all: T.unsafe(nil)); end", "def index_item_thumb(document)\n if document.do_url\n link_to(\n thumbnail_image_tag(document),\n document.do_url\n )\n else\n link_to(\n thumbnail_image_tag(document),\n solr_document_path(document.id)\n )\n end\n end", "def htlal_wiki_url\n \"http://learnanylanguage.wikia.com/wiki/#{name.gsub(' ', '_')}\"\n end", "def get_image_desc(page_doc)\n\treturn page_doc.css('//body/p')[-2].inner_html\nend", "def photo(if_not_found = \"anonymous.jpg\" )\n photo_name.nil? ? if_not_found : photo_name\n end" ]
[ "0.753484", "0.67072594", "0.6664706", "0.61969364", "0.61592805", "0.6136746", "0.60186845", "0.59577787", "0.59326977", "0.5921311", "0.59144896", "0.5886908", "0.5886163", "0.5875616", "0.5860324", "0.5838341", "0.5806073", "0.5794669", "0.57904017", "0.57646304", "0.5745164", "0.5693672", "0.5692711", "0.5686063", "0.5656343", "0.5651188", "0.56281143", "0.5620381", "0.56037605", "0.5600166", "0.55967766", "0.55899906", "0.55837584", "0.5554192", "0.5549434", "0.5539234", "0.5537825", "0.5517875", "0.5515428", "0.55035627", "0.5501007", "0.5500919", "0.5494554", "0.5467518", "0.54424137", "0.54399997", "0.5439179", "0.5435324", "0.5431291", "0.5419937", "0.54199106", "0.54044425", "0.53788614", "0.53702146", "0.53680664", "0.5366044", "0.5358972", "0.53579944", "0.5356937", "0.5353831", "0.53523564", "0.534074", "0.53265876", "0.5326472", "0.5316722", "0.53133094", "0.53094923", "0.53094923", "0.5303733", "0.5303733", "0.53036994", "0.52960026", "0.5284393", "0.52837014", "0.52785516", "0.5278075", "0.5271889", "0.5268252", "0.52653664", "0.5258666", "0.5257262", "0.5254561", "0.52487314", "0.5242234", "0.5241585", "0.52402306", "0.5237255", "0.5235176", "0.5230543", "0.5228525", "0.5228477", "0.52283436", "0.5225995", "0.52249265", "0.52216053", "0.5219294", "0.5217837", "0.5217588", "0.52165395", "0.52151746" ]
0.7751928
0
Returns the picture of the artist. Will try to find a picture on Last.fm, if none is found then a default picture will be returned. The picture is saved to the database so searching will only occur the first time this method is called.
def picture s = super return s if s.to_s != "" # try to find image if name.to_s != "" pic = nil begin key = Stoffi::Application::OA_CRED[:lastfm][:id] q = CGI.escapeHTML(e(name)).gsub(/\s/, "%20") url_base = "ws.audioscrobbler.com" url_path = "/2.0?method=artist.info&format=json&api_key=#{key}&artist=#{q}" logger.info "fetching artist image for #{name} from http://#{url_base}#{url_path}" http = Net::HTTP.new(url_base) res, data = http.get(url_path, nil) feed = JSON.parse(data) logger.debug "searching for image of size: large" feed['artist']['image'].each do |img| pic = img['#text'] break if img['size'] == 'large' end pic = Artist.default_pic if pic.to_s == "" rescue => err logger.error "could not retrieve artist image: " + err.to_s pic = Artist.default_pic end if pic update_attribute(:picture, pic) return pic end end return Artist.default_pic end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def getimage\n if @artist.images.empty?\n @image = \"image1.jpg\"\n else\n @image = @artist.images.first[\"url\"]\n end\n end", "def photo\n\t\ts = picture\n\t\treturn s if s.to_s != \"\"\n\t\t\n\t\t#i = image\n\t\treturn Artist.default_pic\n\t\t\n\t\tupdate_attribute(:picture, i)\n\t\tsave\n\t\treturn i\n\tend", "def artist_avatar\n if self.avatar.attached?\n image_tag artist.avatar\n else\n image_tag 'default_avatar.jpg'\n end\n end", "def picture\n\t\tbegin\n\t\t\tcase provider\n\t\t\twhen \"facebook\"\n\t\t\t\tresponse = get(\"/me/picture?type=large&redirect=false\")\n\t\t\t\treturn response['data']['url']\n\t\t\t\t\n\t\t\twhen \"twitter\"\n\t\t\t\tresponse = get(\"/1.1/users/show.json?user_id=#{uid}\")\n\t\t\t\treturn response['profile_image_url_https']\n\t\t\t\t\n\t\t\twhen \"google_oauth2\"\n\t\t\t\tresponse = get(\"/oauth2/v1/userinfo\")\n\t\t\t\treturn response['picture'] if response['picture']\n\t\t\t\t\n\t\t\twhen \"myspace\"\n\t\t\t\tresponse = get(\"/v1.0/people/@me\")\n\t\t\t\treturn response['thumbnailUrl'] if response['thumbnailUrl']\n\t\t\t\t\n\t\t\twhen \"vimeo\"\n\t\t\t\tresponse = get(\"/api/v2/#{uid}/info.json\")\n\t\t\t\treturn response['portrait_medium']\n\t\t\t\t\n\t\t\twhen \"yahoo\"\n\t\t\t\tresponse = get(\"/v1/user/#{uid}/profile/tinyusercard\")\n\t\t\t\treturn response['profile']['image']['imageUrl']\n\t\t\t\t\n\t\t\twhen \"vkontakte\"\n\t\t\t\tresponse = get(\"api.php?method=getProfiles?uids=#{uid}&fields=photo_medium\")\n\t\t\t\treturn response['Response'][0]['Photo']\n\t\t\t\t\n\t\t\twhen \"lastfm\"\n\t\t\t\tresponse = get(\"/2.0/?method=user.getinfo&format=json&user=#{uid}&api_key=#{creds['id']}\")\n\t\t\t\treturn response['user']['image'][1]['#text']\n\t\t\t\t\n\t\t\twhen \"linkedin\"\n\t\t\t\tresponse = get(\"/v1/people/~\")\n\t\t\t\tlogger.debug response.inspect\n\t\t\t\t#return ???\n\t\t\t\t\n\t\t\twhen \"windowslive\"\n\t\t\t\tresponse = get(\"/v5.0/me/picture?access_token=#{access_token}\")\n\t\t\t\treturn response['person']['picture_url']\n\t\t\t\t\n\t\t\tend\n\t\trescue StandardError => e\n\t\t\tlogger.debug \"error fetching pictures from #{provider}\"\n\t\t\tlogger.debug e.to_yaml\n\t\tend\n\t\treturn nil\n\tend", "def image\n #images = Musicbrainz_db.get_cover_art(self.id)[\"images\"]\n\n images = SearchModule.get_cover_art(self.id)\n if images != nil\n return images[\"images\"].first[\"thumbnails\"][\"large\"]\n else\n return 'http://djpunjab.in/cover.jpg'\n end\n end", "def get_image_profile_pic\n last_pic = images.where(\"kind = ?\", \"profile_pic\").last\n\n if last_pic.nil?\n return \"/assets/octacat-resized.png\"\n else\n last_pic.url\n end\n end", "def image\n\t\treturn @wiki_img if @wiki_img\n\t\tlogger.info \"finding picture for #{name}\"\n\t\tWikipedia.Configure do\n\t\t\tdomain \"en.wikipedia.org\"\n\t\t\tpath \"w/api.php\"\n\t\tend\n\t\tp = page\n\t\tif p && p.image_urls && p.image_urls.count > 0\n\t\t\t@wiki_img = p.image_urls.last # last one is the one on the right\n\t\t\tself.picture = @wiki_img\n\t\t\tself.save\n\t\t\t@wiki_img\n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "def download_wiki_image(artist)\n\n # Check if the artist image already exists\n return if artist.image_path(:medium)\n\n image_url = get_wikipedia_image_url(artist.wikilink)\n MetaGeneration::download_artist_image(artist, image_url)\n end", "def artist\n artist = Spotify.album_artist!(pointer)\n Artist.new(artist) unless artist.null?\n end", "def picture\n if model.picture and File.file?(model.asset_path_for_image)\n model.picture\n else\n model.update_cache\n ''\n end\n end", "def images artist\n url = \"http://developer.echonest.com/api/v4/artist/images?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json&results=#{RESULTS}&start=0&license=unknown\"\n result = parseURL url\n result[\"response\"][\"images\"]\nend", "def avatar\n avatar_id.nil? ? Photo.last : Photo.find(avatar_id)\n end", "def album_thumb_by_artist_and_title(artist, title)\n yahoo_response = song_search_by_artist_and_title(artist, title)\n item_with_thumb=nil\n if yahoo_response['ResultSet'] and yahoo_response['ResultSet']['Result']\n item_with_thumb = yahoo_response['ResultSet']['Result'].detect{|item|item.has_key?('Thumbnail')}\n end\n item_with_thumb['Thumbnail']['Url'] if item_with_thumb\n end", "def images(artist, options={})\n get(:standard, {:method => \"artist.getImages\", :artist => artist}.merge(options))\n end", "def single_picture(foursq_id)\n foursq_hash = Instagram.location_search(foursq_id)\n if foursq_hash.empty?\n return \"http://media.npr.org/assets/news/2010/01/30/tianshan2-1a2a29b83bc7a670bf8210d9c6daefa3ba46f971-s6-c30.jpg\"\n else\n all_results = Instagram.location_recent_media(foursq_hash[0][\"id\"])\n if all_results.empty?\n return \"http://media.npr.org/assets/news/2010/01/30/tianshan2-1a2a29b83bc7a670bf8210d9c6daefa3ba46f971-s6-c30.jpg\"\n else\n all_results.sample[\"images\"][\"standard_resolution\"][\"url\"]\n end\n end\n end", "def get_pic_url\n\t if !self.pic_url\n\t\t twit_u = User.get_twitter_user_from_name(self.screen_name)\n\t\t\tputs twit_u\n\t\t\tself.pic_url = twit_u[\"profile_image_url\"]\n\t\t\tself.save!\n\t\tend\n\tend", "def picture\n if local_picture.nil?\n category.picture if category\n else\n local_picture\n end\n end", "def image\n\t\t@image ||= Image.joins(:album)\n .where(id: params[:id], :albums => {:user_id => user_id})\n .take || halt(404)\n\tend", "def artist_images\n ArtistImage.find_by_artist_id(self.id)\n end", "def picture\n if self.avatar?\n self.avatar.url\n elsif self.image_url != nil\n self.image_url\n else\n 'generic_avatar'\n end\n end", "def artist\n artists.first\n end", "def picture_url\n if avatar\n image_path(\"speakers/#{avatar}\")\n else\n image_path(\"default-avatar.png\")\n end\n end", "def profile_photo\n photos = self.profile_photos\n photos.empty? ? 'http://ragatzi.s3.amazonaws.com/uploads/profile_default_1.png' : photos.last.photo.url\n end", "def picture(size = :medium)\n\t\treturn \"https://img.youtube.com/vi/\" + youtube_id + \"/default.jpg\" if youtube?\n\t\treturn art_url if (art_url.to_s != \"\" and art_url.to_s.downcase != \"null\")\n\t\treturn \"http://beta.stoffiplayer.com/assets/media/disc.png\"\n\tend", "def update_artist(artist)\n begin\n # Handle unknown artist\n if artist.name == Artist::UNKNOWN_ARTIST_NAME\n artist.wikilink = ''\n artist.save\n return\n end\n\n # Result is like this:\n search = search_text(artist.name, 1)\n\n if search.length == 0\n artist.wikilink = ''\n else\n artist.wikilink = search[0][1]\n end\n\n download_wiki_image(artist)\n rescue\n Log.log_last_exception(\"Error updating #{artist.to_s}\")\n artist.wikilink = ''\n end\n artist.save\n end", "def picture(options = nil)\n\t\tsize = \"\"\n\t\tsize = options[:size] if options != nil\n\t\ts = image.to_s\n\t\t\n\t\t# no image source\n\t\treturn User.default_pic(size) unless s.present?\n\t\t\n\t\t# image source is gravatar\n\t\tif [:gravatar, :identicon, :monsterid, :wavatar, :retro].include? s.to_sym\n\t\t\ts = s == 'gravatar' ? :mm : s.to_sym\n\t\t\treturn gravatar(s)\n\t\t\t\n\t\t# image source is something else\n\t\telse\n\t\t\tl = self.links.find_by(provider: s)\n\t\t\treturn User.default_pic unless l\n\t\t\tpic = l.picture\n\t\t\treturn User.default_pic unless pic\n\t\t\treturn pic\n\t\tend\n\t\t\n\t\t# should we really ever reach this point?\n\t\treturn User.default_pic(size)\n\tend", "def getgenres(artist = \"\")\n @check = false\n @artist = RSpotify::Artist.search(artist).first\n unless @artist.nil? || @artist.genres.empty?\n session[:artist] = @artist.name\n session[:id] = @artist.id\n @check = true\n getimage\n end\nend", "def store_artist_image\n ArtistsController.store_image(self, @artist)\n end", "def display_picture_url\n\t\tdisplay_picture.url(:original)\n\tend", "def set_picture\n @picture = @album.pictures.find(params[:id])\n end", "def get_thumb(register)\n begin\n thumb = SolrQuery.new.solr_query(\"id:#{register}\", 'thumbnail_url_tesim', 1)['response']['docs'][0]['thumbnail_url_tesim']\n if thumb.nil?\n #return a generic thumbnail\n 'register_default.jpg'\n else\n thumb[0]\n end\n rescue => error\n log_error(__method__, __FILE__, error)\n raise\n end\n\n end", "def backside_picture\n return @backside_picture if @backside_picture\n if self.pictures.loaded?\n if cloth?\n _pictures = self.pictures.to_a.sort{ |a,b| a.display_on <=> b.display_on }\n picture = _pictures.to_a.size > 1 ? _pictures[1] : _pictures[0]\n else\n picture = self.pictures.to_a.find { |p| p.display_on == DisplayPictureOn::GALLERY_2 }\n end\n else\n if cloth?\n picture = self.pictures.order(:display_on).second\n else\n picture = self.pictures.where(:display_on => DisplayPictureOn::GALLERY_2).first\n end\n end\n @backside_picture = picture.try(:image_url, :catalog)\n end", "def show\n @picture = @album.pictures.find(params[:id])\n end", "def picture_url\n File.join(\"/\", PICTURE_DIR[1,3], picture_exists? ? code2filename(code) : \"coming_soon.png\")\n end", "def artist()\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql,values)\n artist_data = results[0]\n artist = Artist.new(artist_data)\n end", "def get_player_image (page, index)\n photo_downloaded = false\n\n # Attempt to find div that contains image\n\n image_divs = page.css('div.ohio-staff--photo')\n\n # If found, continue\n\n if !image_divs.nil? && !image_divs[0].children.empty?\n\n # Get image text from returned object\n\n image_url = image_divs.to_s\n\n # We only want the url, scan with regex\n\n image_url = image_url.scan /https[a-zA-Z0-9\\-\\/\\.:]*.jpg/\n\n # Only continue at this point if we were able to parse a url\n\n unless image_url.empty?\n\n # Download image file\n\n open(image_url.first) do |image|\n File.open(\"lib/outputs/photos/PlayerPhoto#{index}.jpg\", \"wb\") do |file|\n file.write(image.read)\n end\n end\n photo_downloaded = true\n end\n end\n\n # If we couldn't find, return path to default image. Otherwise return local path\n\n unless photo_downloaded\n return \"photos/default.jpg\"\n end\n\n \"photos/PlayerPhoto#{index}.jpg\"\n\nend", "def artist()\n sql = \"SELECT * FROM artists WHERE id = $1\"\n values = [@artist_id]\n result = SqlRunner.run(sql, values)[0]\n return Artist.new(result)\n end", "def avatar\n image = images.where(:thumbnail => true).first \n if image.present?\n { :original => image.url(\"original\"),\n :listing => image.url(\"listing\"),\n :mini => image.url(\"mini\"),\n :thumb => image.url(\"thumb\") }\n end\n end", "def author_picture_url\n @author_picture_url ||= begin\n if self.author_screenname\n \"http://twitter.com/api/users/profile_image/#{self.author_screenname}\"\n else\n image_path(\"default-avatar.png\")\n end\n end\n end", "def photo(if_not_found = \"anonymous.jpg\" )\n photo_name.nil? ? if_not_found : photo_name\n end", "def image\n # 1. TODO Advertisement's image if there is an active Spot play event and has image\n # 2. else Song's image if there is an active song and has image\n return event.try(:image).try(:file) if event.try(:image) != nil\n # 3. TODO else programs's image if there is an active program with image\n # 4. TODO else Station's image if present\n # 5. TODO else App logo\n end", "def find_photographs_by_artist(artist)\n artist_photos = []\n @photographs.each do |photograph|\n if photograph[:artist_id] == artist[:id]\n artist_photos << photograph\n end\n end\n artist_photos\n end", "def get_image_from_photo_info(photos)\n photos.map do |photo|\n \"https://live.staticflickr.com/#{photo['server']}/#{photo['id']}_#{photo['secret']}.jpg\"\n end\n end", "def full_picture\n if self.photo.file != nil\n self.photo_url\n elsif self.picture\n self.picture\n else\n \"http://res.cloudinary.com/geertkeularts/image/upload/v1467110899/defaultpicture_jj0nwa.jpg\"\n end\n end", "def find_thumbnail_file\n map_set = MapSet.find(geo_work.id)\n image_work = map_set.thumbnail\n return unless image_work\n image_work_presenter = ImageWorkShowPresenter.new(SolrDocument.new(image_work.to_solr), nil)\n file_set_id = image_work_presenter.solr_document.representative_id\n @file_set = image_work_presenter.geo_file_set_presenters.find { |presenter| presenter.id == file_set_id }\n end", "def artist\n\t\tartists == nil ? nil : artists.first\n\tend", "def thumb\n filename = params[:filename]\n @photo = @album.photos.find(:first, :conditions => [ \"image_file_name = ?\", filename ], :order => 'created_at DESC')\n end", "def lookup_artist_info(artist_mbid, artist_name)\r\n\t\tputs \"looking up info for \" + artist_mbid + \"|\" + artist_name\r\n\t begin\r\n\t artist = @lastfm.artist.get_info(:artist_mbid => artist_mbid, :artist => artist_name)\r\n\r\n\t stmt = @db.prepare( \"INSERT INTO artist( artist_mbid, artist_name, listeners, playcount, placeformed, yearformed, yearfrom, yearto, image ) VALUES (?,?,?,?,?,?,?,?,?)\")\r\n\t\t\tputs artist\r\n\t\t\tmbid = artist[\"mbid\"] if artist.has_key?(\"mbid\") && artist[\"mbid\"].kind_of?(String)\r\n\r\n\t\t\tstmt.bind_param 1, mbid\r\n\t\t\tstmt.bind_param 2, artist[\"name\"].kind_of?(String) ? artist[\"name\"] : nil\r\n\t\t\tstmt.bind_param 3, artist[\"stats\"][\"listeners\"].kind_of?(String) ? artist[\"stats\"][\"listeners\"] : nil\r\n\t\t\tstmt.bind_param 4, artist[\"stats\"][\"playcount\"].kind_of?(String) ? artist[\"stats\"][\"playcount\"] : nil\r\n\t\t\tstmt.bind_param 5, artist[\"bio\"][\"placeformed\"].kind_of?(String) ? artist[\"bio\"][\"placeformed\"] : nil\r\n\t\t\tstmt.bind_param 6, artist[\"bio\"][\"yearformed\"].kind_of?(String) ? artist[\"bio\"][\"yearformed\"] : nil\r\n\t\t\tyear_from = nil\r\n\t\t\tyear_from = artist[\"bio\"][\"formationlist\"][\"yearfrom\"] if artist.has_key?(\"bio\") && artist[\"bio\"].has_key?(\"formationlist\") && artist[\"bio\"][\"formationlist\"].has_key?(\"yearfrom\")\r\n\t\t\tstmt.bind_param 7, year_from\r\n\t\t\tyear_to = nil\r\n\t\t\tyear_to = artist[\"bio\"][\"formationlist\"][\"yearto\"] if artist.has_key?(\"bio\") && artist[\"bio\"].has_key?(\"formationlist\") && artist[\"bio\"][\"formationlist\"].has_key?(\"yearto\")\r\n\t\t\tstmt.bind_param 8, year_to\r\n\r\n\t\t\t# puts artist[\"image\"]\r\n\t\t img = artist[\"image\"].select { |img| img[\"size\"] == \"large\" }.first\r\n\r\n\t\t\tstmt.bind_param 9, !img.nil? && img[\"content\"].kind_of?(String) ? img[\"content\"] : nil\r\n\t\t\tstmt.execute\r\n\r\n\t\t\t# update the artist_mbid in the track history table if we need to\r\n\t\t\tif artist_mbid.nil? && !mbid.nil?\r\n\t\t\t\tputs \"Updating \" + artist_name + \" to id \" + mbid\r\n\t\t\t\[email protected] \"UPDATE track_history SET artist_mbid = ? WHERE artist_name = ? AND artist_mbid IS NULL\", mbid, artist_name\r\n\t\t\tend\r\n\r\n\t\t\tunless artist[\"tags\"][\"tag\"].nil?\r\n\t\t\t\tartist[\"tags\"][\"tag\"].each do |tag|\r\n\t\t \[email protected] \"INSERT INTO artist_tags (artist_mbid, artist_name, tag) VALUES (?,?,?)\", artist_mbid, artist_name, tag[\"name\"]\r\n\t\t end\r\n\t\t\tend\r\n\r\n\t\t\tunless artist[\"similar\"][\"artist\"].nil?\r\n\t\t artist[\"similar\"][\"artist\"].each do |a|\r\n\t\t \tbegin\r\n\t\t\t \[email protected] \"INSERT INTO similar_artists (artist_mbid, artist_name, similar_artist_name) VALUES (?,?,?)\", artist_mbid, artist_name, a[\"name\"]\r\n\t\t\t rescue\r\n\t\t\t end\r\n\t\t end\r\n\t \t\tend\r\n\r\n\t rescue\r\n\t puts \"error looking up tag for that artist :(\"\r\n\t \tputs @db.errmsg\r\n\t end\r\n\r\n\tend", "def search_file_name\n file_name = ''\n if @artist_id && @artist_id != 0\n artist_name = ARUtils.field( Artist , @artist_id , :name )\n file_name = artist_name if artist_name\n end\n if @album_id && @album_id != 0\n album_name = ARUtils.field( Album , @album_id , :name )\n file_name += ' - ' if ! file_name.empty?\n if album_name\n file_name += album_name\n end\n end\n file_name = 'songs' if file_name.empty?\n return ImagesModule.safe_file_name(file_name, true)\n end", "def main_picture\n @main_picture ||= object.pictures.first\n end", "def thumbnail_url\n album_cover ? album_cover.photo.photo_url_small : photos.size > 0 ? photos.first.photo_url_small : nil\n end", "def f_artist\n fname_bits[-3] || 'unknown_artist'\n end", "def search_artist(artist)\n PeopleSearch.search_artist(artist, @api_key, @https)\n end", "def artist\n if artists.nil?\n Artist.new :name => super\n elsif artists.size > 1\n artists\n else\n artists.first\n end\n end", "def get_avatar\n u = User.find_by_id(self.id)\n if u.role == 'user'\n return u.avatar.url unless u.avatar.nil?\n else\n info = Info.find_by_email(self.email)\n return info.info_avatar.image.url unless info.nil?\n end\n return nil\n end", "def get_picture(type='square')\n if self.social_sessions.first.social_network.username == 'facebook'\n return \"http://graph.facebook.com/#{self.id_on_social}/picture?type=#{type}\"\n end\n end", "def image_url\n album_cover ? album_cover.photo.photo_url_full : photos.size > 0 ? photos.first.photo_url_full : nil\n end", "def image_uri(size = :small)\n books.first.image_uri(size) if !books.empty?\n end", "def get_artist\n Artist.find(params[:id])\n end", "def artist\n\t\tArtist.find(artist_id)\n\tend", "def default_image\n \t @default_photo = PhotoUser.where('user_id = ? AND first_image = 1 AND image IS NOT NULL',self.id)\n \t if @default_photo.count > 0\n \t\t@mydefault_photo = PhotoUser.find(@default_photo[0].id)\n \t\treturn @mydefault_photo\n \t else\n \t\treturn nil\n \t end\n end", "def profile_pic_url\n result_hash['pic']\n end", "def cover\n pictures.find_by_cover(true) or pictures.first\n end", "def get_artist(artist_id)\n query_and_build \"artists/#{artist_id}\"\n end", "def cover_aphoto\n @cover_aphoto ||= (album_photos.find_by_cover_photo(true) || album_photos.first)\n end", "def image_path\n photo = album_cover ? album_cover.photo : photos.first\n if photo\n return \"/album/#{id}/photo/#{photo.id}\"\n else\n return nil\n end\n end", "def get_picture(object, args = {}, options = {})\n # Gets a picture object, returning the URL (which Facebook sends as a header)\n graph_call(\"#{object}/picture\", args, \"get\", options.merge(:http_component => :headers)) do |result|\n result[\"Location\"]\n end\n end", "def get_picture(object, args = {}, options = {}, &block)\n Koala::Utils.deprecate(\"API#get_picture will be removed in a future version. Please use API#get_picture_data, which returns a hash including the url.\")\n\n get_user_picture_data(object, args, options) do |result|\n # Try to extract the URL\n result = result.fetch('data', {})['url'] if result.respond_to?(:fetch)\n block ? block.call(result) : result\n end\n end", "def image_url\n if image.present?\n image\n else\n \"http://loremflickr.com/320/240/#{CGI.escape name}\"\n end\n end", "def getImage(type = nil)\n image = \"\"\n if !self.photo.blank?\n if !type.nil?\n image = self.photo.url(type)\n else\n image = self.photo.url\n end\n else\n image = \"person-woman-coffee-cup-large.jpg\"\n end # if !self.photo.blank? #\n end", "def profile_picture\n if facebook_authentication && facebook_authentication.profile_picture\n return facebook_authentication.profile_picture\n end\n return '/images/unknown_user.png'\n end", "def find_thumbnail(file_set:)\n find_exactly_one_file_by_use(\n file_set: file_set,\n use: Hyrax::FileMetadata::Use::THUMBNAIL\n )\n end", "def artist()\n sql = \"SELECT artist_name FROM artists WHERE id = $1\"\n values = [@artist_id]\n result = SqlRunner.run(sql, values)\n return result[0][\"artist_name\"]\n end", "def image\n TmdbImage.new(@imdb_id.gsub(/^tt/, ''), @api_key, @logger, @filespec) rescue nil\n end", "def image\n images.first\n end", "def art_file\n \"#{Digest::SHA1.hexdigest(\"#{artist_name}/#{album_name}\")}.png\"\n end", "def display_image\n return nil unless solr_document.image? && current_ability.can?(:read, solr_document)\n return nil unless latest_file_id\n\n # @see https://github.com/samvera-labs/iiif_manifest\n IIIFManifest::DisplayImage.new(display_image_url(request.base_url),\n format: image_format(alpha_channels),\n width: original_file.width.empty? ? 50000 : original_file.width.first,\n height: original_file.height.empty? ? 50000 : original_file.height.first,\n iiif_endpoint: iiif_endpoint(latest_file_id))\n end", "def get_small_avatar\n KAG.get \"/player/#@nick/avatar/s\"\n end", "def receiver_picture\n user = users.select { |user| !user.id.eql?(sent_by) }.first\n user.avatar_url\n end", "def display_image\n return nil unless solr_document.image? && current_ability.can?(:read, solr_document)\n return nil unless latest_file_id\n\n # @see https://github.com/samvera-labs/iiif_manifest\n IIIFManifest::DisplayImage.new(display_image_url(request.base_url),\n format: image_format(alpha_channels),\n width: width,\n height: height,\n iiif_endpoint: iiif_endpoint(latest_file_id))\n end", "def artist_name\n if self.artist == nil #findining artist of song\n nil\n else\n artist.name\n end\n end", "def display_profile_image\n if self.picture.present? && self.picture.url(:small).present?\n self.picture.url(:small)\n else\n ActionController::Base.helpers.asset_path('user.png')\n end\n end", "def get_summoner_image(name)\n begin\n query_string = \"SELECT id FROM summoners WHERE name = '#{name}'\"\n query = @@db.query(query_string)\n link = []\n img = query.first['id'].to_s + \".png\"\n return img\n end\n end", "def get_image_from_google_for(keywords)\n get_link_from_google_for keywords, :image\n rescue Exception\n ''\n end", "def get_google_img(query)\n img_search_keywords = query.strip.gsub(/\\s+/,'+')\n \n if img_search_keywords != ''\n url = \"http://ajax.googleapis.com/ajax/services/search/images?rsz=large&start=1&v=1.0&q=#{img_search_keywords}\"\n \n json_results = open(url) {|f| f.read };\n results = JSON.parse(json_results)\n image_array = results['responseData']['results']\n image = image_array[0] if image_array\n image = image['tbUrl']\n \n if image\n return image\n else\n return 'no image found'\n end\n end\n end", "def father_avatar\n\n Tweet.find(self.tweet_id).user.url_photo\n\n end", "def show\n @picture = @album.pictures.find(params[:id]) #JRD111115\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture}\n end\n end", "def artist_name\n if self.artist #if song has an artist aka TRUE\n self.artist.name #return the artist name\n else\n nil #if no artist name return nil\n end\n end", "def thumbnail_tiny_url\n album_cover ? album_cover.photo.photo_url_tiny : photos.size > 0 ? photos.first.photo_url_tiny : nil\n end", "def cover\n photos.first\n end", "def get_avatar\n KAG.get \"/player/#@nick/avatar\"\n end", "def display_picture(image_size = :c_very_small)\n if self.image\n self.image.public_filename(image_size)\n elsif facebook_uid.to_i > 0\n fb_image_size = case image_size\n when :very_small\n 'square'\n else\n 'large'\n end\n FacebookGraphApi::display_picture(facebook_uid, fb_image_size)\n else\n '/images/fresh/user.png'\n end\n end", "def image_url\n# Somehow the picture field returns false for 'nil?' regardless of wether it's set or not\n# So we'll have to check if the size of the url is 0 to see if it exists\n# There should be a better way to do this, probably?\nif self.picture.size == 0\n\tself.profile_picture.nil? ? 'image-unknown.jpg' : self.profile_picture\nelse \n\tself.picture.ava\nend\nend", "def small_photo_uri(photo)\n server = photo.attribute('server')\n id = photo.attribute('id')\n secret = photo.attribute('secret')\n return \"http://static.flickr.com/#{server}/#{id}_#{secret}_m.jpg\"\nend", "def get_image_or_placeholder\n return (self.image != \"\") && (self.image != nil) ? self.image : \"http://cdn.browshot.com/static/images/not-found.png\"\n end", "def get_image_or_placeholder\n return (self.image != \"\") && (self.image != nil) ? self.image : \"http://cdn.browshot.com/static/images/not-found.png\"\n end", "def set_picture\n @picture = Picture.with_attached_photo.find(params[:id])\n end", "def artist_name\n if self.artist\n self.artist.name\n else\n nil\n end\n end", "def choosephoto\n if self.photo.url\n photo.url(:standard)\n else\n gphoto\n end\n end", "def artist_name\n if artist\n self.artist.name\n else\n nil\n end\n end" ]
[ "0.72009856", "0.6701507", "0.6673577", "0.6354272", "0.6321607", "0.6314307", "0.61985624", "0.61710733", "0.61705285", "0.6152946", "0.61218643", "0.611136", "0.6041111", "0.60319763", "0.59998405", "0.59935224", "0.5972438", "0.5958812", "0.5931603", "0.59305495", "0.590657", "0.58818907", "0.5860777", "0.58525443", "0.5840974", "0.5839675", "0.58093935", "0.58078855", "0.5796651", "0.5788711", "0.57813317", "0.57793623", "0.57517844", "0.5748616", "0.5738902", "0.5729067", "0.5727765", "0.57200116", "0.57174504", "0.5695151", "0.56821394", "0.56795055", "0.5677699", "0.56682783", "0.56628656", "0.56621945", "0.56247866", "0.56148976", "0.5603739", "0.5580906", "0.5576792", "0.55592364", "0.5558242", "0.55540085", "0.55538", "0.55494916", "0.5543469", "0.5539508", "0.55390143", "0.55368495", "0.55294085", "0.552613", "0.5520206", "0.55164266", "0.5515103", "0.5508179", "0.54939926", "0.5492881", "0.54897755", "0.5486624", "0.5484667", "0.54734564", "0.54685616", "0.5463804", "0.5462073", "0.5453554", "0.5449537", "0.54440826", "0.5442066", "0.54369557", "0.5433964", "0.5414392", "0.54118", "0.54100657", "0.5404945", "0.5404176", "0.5393136", "0.5388469", "0.5384732", "0.5373447", "0.537089", "0.5364819", "0.53611356", "0.53607655", "0.5354275", "0.5354275", "0.5343154", "0.5342979", "0.5332858", "0.5326214" ]
0.8277047
0
Same as picture. DEPRECATED!
def photo s = picture return s if s.to_s != "" #i = image return Artist.default_pic update_attribute(:picture, i) save return i end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def image; end", "def image\n end", "def image\n end", "def image\n\n end", "def edit_real_picture\n end", "def image\n end", "def image\n end", "def images; end", "def photo_format; end", "def thumbnail_image\n end", "def add_picture(picture)\n end", "def picture_list\n end", "def default_image\n end", "def img(*) # :nodoc:\n raise \"no!\"\n end", "def images\n end", "def base_image\n self\n end", "def image()\n @image__\n end", "def set_img\n\n end", "def pic_one_url\n \tpic_one.url(:medium)\n end", "def imgurl\n picref.imgurl if picref\n end", "def image\n @path\n end", "def display_picture_url\n\t\tdisplay_picture.url(:original)\n\tend", "def type\n \"StillImage\"\n end", "def profile_photo\n\tend", "def image_url\n self.filename.url \n end", "def lnbPicture _obj, _args\n \"_obj lnbPicture _args;\" \n end", "def picture_url(size)\n \tself.picture.url(size)\n \tend", "def cover_image\n end", "def image\n 0\n end", "def cl_photo\n if photo?\n photo\n else\n 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcSb0kZ2CA6D46RXZVJ3dvJPusC66fBq1uENE8jN3q8golJ73Ayd'\n end\n end", "def picture_url\n picture.url(:featured_project)\n end", "def set_element pic\n controller_name == 'temp_listings' ? get_pixi_image(pic) : get_pixi_image(pic, 'large')\n end", "def pic_url\n {\n picture: self.object.pic.service_url\n }\n end", "def full_picture\n if self.photo.file != nil\n self.photo_url\n elsif self.picture\n self.picture\n else\n \"http://res.cloudinary.com/geertkeularts/image/upload/v1467110899/defaultpicture_jj0nwa.jpg\"\n end\n end", "def image\n return unless object.image.attached?\n\n # object.image.blob.attributes\n # .slice('filename', 'byte_size')\n # .merge(url: image_url)\n # .tap { |attrs| attrs['name'] = attrs.delete('filename') }\n object.image.service_url\n \n end", "def picdata\n object.imgdata\n end", "def image(criteria = T.unsafe(nil)); end", "def show_image\n if @wine.picture.attached?\n image_tag(@wine.picture.service_url, alt: \"your_image\", height: \"250\", style: \"border: 1px solid #220F24\")\n end\n end", "def cur_image\n self\n end", "def image\n 'gh.png'\n end", "def image_url\n image.url\n end", "def image_path\n thumbnail_url\n end", "def picture\n if model.picture and File.file?(model.asset_path_for_image)\n model.picture\n else\n model.update_cache\n ''\n end\n end", "def photo_src\n self.photo.present? ? self.photo.picture_url : Prize::DEFAULT_IMG\n end", "def image_url\n image_uri\n end", "def thumbnail\n \tobject.file.url(:thumb)\n end", "def afficher\n @image.display\n end", "def png\n self.to_s\n end", "def image\n object.send(attribute_name.to_sym)\n end", "def simple_picture_tag(asset_object, version = :medium, options = {})\n picture_tag([\n {:media => \"(min-width: 521px)\", :srcset => asset_object.mounted_file.send(version).url},\n {:media => \"(max-width: 520px)\", :srcset => \"#{asset_object.mounted_file.grid.url} 1x, #{asset_object.mounted_file.medium.url} 2x\"},\n {:srcset => \"#{asset_object.mounted_file.grid.url}\"}\n ], asset_object.mounted_file.grid.url, options)\n end", "def picture\n if local_picture.nil?\n category.picture if category\n else\n local_picture\n end\n end", "def square_url\n thumb_url\n end", "def display_profile_image\n if self.picture.present? && self.picture.url(:small).present?\n self.picture.url(:small)\n else\n ActionController::Base.helpers.asset_path('user.png')\n end\n end", "def to_s\n image\n end", "def image_url\n# Somehow the picture field returns false for 'nil?' regardless of wether it's set or not\n# So we'll have to check if the size of the url is 0 to see if it exists\n# There should be a better way to do this, probably?\nif self.picture.size == 0\n\tself.profile_picture.nil? ? 'image-unknown.jpg' : self.profile_picture\nelse \n\tself.picture.ava\nend\nend", "def image\n (object.image_url.nil? || object.image_url.empty?) ? h.content_tag(:span,\"\",class: \"glyphicon glyphicon-picture\") : h.image_tag(object.image_url)\n end", "def image_hash; end", "def no_link_picture(instance)\n if instance.picture.present?\n image_tag(instance.picture.image.url, class: 'img-responsive')\n elsif instance.class == User\n image_tag('/images/default.png', class: 'img-responsive')\n else\n image_tag('/images/default2.jpg', class: 'img-responsive')\n end\n end", "def image_location\n src || ''\n end", "def show\n\n #render plain: @myimage\n end", "def base_photo_url\n \"#{URL}#{self.photo.url}/\".gsub('/original/','/large/')\n end", "def picture_options\n {purpose: nil, variant: nil}\n end", "def has_image?\n false\n end", "def image(arg=nil)\n set_or_return(:image, arg, :kind_of => String)\n end", "def initialize(picture)\r\n #@picture is a instance variable. You make it live long. so picture gets stored longer than just initialize.\r\n @picture = picture\r\n end", "def profile_picture\n\t\timage_tag(\"ruby.svg.png\", alt: \"Profile Picture\")\n\tend", "def non_html_attribute_options\n super.push(:image, :src)\n end", "def image_url\n url_for(object.profile_pic)\n end", "def picture\n if self.avatar?\n self.avatar.url\n elsif self.image_url != nil\n self.image_url\n else\n 'generic_avatar'\n end\n end", "def uploading_pictures\n end", "def photo_from_url(url)\n end", "def image_url\n image.url(:medium)\n end", "def display_image \r\n self.image.variant(resize_to_limit: [1000, 1000]) \r\n end", "def picture?\n ThriveSmart::Helpers::AssetHelper::asset?(asset_type, asset_urn)\n end", "def to_jpg\n load_image\n end", "def choosephoto\n if self.photo.url\n photo.url(:standard)\n else\n gphoto\n end\n end", "def image url, alt=url\n \"![#{alt}](#{url})\"\n end", "def image( name )\n @images[name]\n end", "def software_image\n super\n end", "def image_url\n object.image_url\n end", "def thumb_link\n \"/images/pictures/#{self.id}.jpg\"\n end", "def image\n options.fetch(:image, nil)\n end", "def default_url\n \"http://placehold.it/330&text=pic\"\n end", "def images\n []\n end", "def imagemagick?; end", "def new\n @picture = Picture.new(hidden: 1)\n end", "def image\n if formatted_image.present?\n formatted_image\n else\n original_image\n end\n end", "def tvPicture _args\n \"tvPicture _args;\" \n end", "def image(type = \"square\")\n \"https://graph.facebook.com/\" + uid + \"/picture?type=\" + type\n end", "def image?\n self.type == \"Image\"\n end", "def images\n @images = super || []\n end", "def lbSetPicture _obj, _args\n \"_obj lbSetPicture _args;\" \n end", "def lbSetPicture _obj, _args\n \"_obj lbSetPicture _args;\" \n end", "def path_to_image(source, options = T.unsafe(nil)); end", "def to_s\r\n assert_exists\r\n super({\"src\" => \"src\",\"width\" => \"width\",\"height\" => \"height\",\"alt\" => \"alt\"})\r\n end", "def image\n self['image'] || self['image_src']\n end", "def create_image_object(obj)\n return content_tag(:div, tag(:img, :src => obj.link), :style => \"position:absolute; top: #{obj.y}px; left: #{obj.x}px;\")\n end", "def display id\n get_image(id).display\n end", "def images\n @picturesandmeta = Pictureandmeta.all\n @kind = Kind.find(params[:kind_id])\n Rails.logger.info(\"Kind: #{@kind.inspect}\")\n end", "def render_image\n render_image_iterm2\n end", "def get_thumbnail_url\n nil\n end" ]
[ "0.7845124", "0.75073165", "0.75073165", "0.75027025", "0.74182576", "0.7282804", "0.7282804", "0.71828026", "0.7148916", "0.70810246", "0.70332307", "0.7020206", "0.69046867", "0.6881222", "0.68536514", "0.6759911", "0.6749912", "0.67240894", "0.6690387", "0.6671684", "0.6632432", "0.6583541", "0.65809435", "0.65761054", "0.65690345", "0.65689284", "0.655473", "0.6534663", "0.6512603", "0.6505986", "0.6494965", "0.6493186", "0.6485407", "0.645885", "0.64559317", "0.64518505", "0.64319664", "0.64190763", "0.64177746", "0.6409116", "0.6401237", "0.6396159", "0.6386067", "0.63831764", "0.6379568", "0.6375414", "0.6365738", "0.6361961", "0.6346982", "0.63392574", "0.6335472", "0.6328571", "0.6325468", "0.6321643", "0.63111013", "0.63089937", "0.63041806", "0.63019216", "0.628105", "0.62642395", "0.62599826", "0.6259405", "0.6255518", "0.6244682", "0.6244458", "0.62429297", "0.6237339", "0.6225702", "0.621396", "0.62074655", "0.62009734", "0.61924654", "0.61923033", "0.6184244", "0.6182068", "0.61677426", "0.6166349", "0.6157995", "0.6153557", "0.6153543", "0.6152712", "0.61497515", "0.61445135", "0.61433035", "0.61401236", "0.61347234", "0.6131992", "0.6130712", "0.6130381", "0.6129665", "0.6114963", "0.6114925", "0.6114925", "0.61103517", "0.61091965", "0.60992527", "0.6087478", "0.608469", "0.6084094", "0.60781854", "0.60757303" ]
0.0
-1
Whether or not the artist has a Twitter account.
def twitter?; twitter.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def twitter?\n provider_name == 'Twitter'\n end", "def twitter?\n self.twitter_token && self.twitter_secret\n end", "def connected_to_twitter?\n twitter_token && twitter_secret\n end", "def twitter?\n self.provider == 'twitter'\n end", "def twitter?\n false\n end", "def twitter_login?\n\t\tself.uid ? true : false\n\tend", "def twitter_profile?\n @network = current_user.network ||= Network.new\n !(@network.twitter.nil? || @network.twitter.blank?)\n end", "def twitter_register_enabled?\n Figaro.env.respond_to?(:twitter_key) && Figaro.env.respond_to?(:twitter_secret)\n end", "def twitter_user?\n return true if is_logged_in? && (session[:request_token] && session[:request_token_secret] && session[:twitter_id])\n end", "def share_to_twitter?\n self.tweet_id == TWSharing::Underway\n end", "def authenticated_with_twitter_list?\n twitter_client.authorized? && list_members(twitter_client).include?(twitter_client.info['screen_name'])\n end", "def tw_authorized?\n self.tw_access_token.present? & self.tw_access_token_secret.present?\n end", "def isTwitter?\n self.category =~ /(tweet|twitter|suggested)/i\n end", "def twitter_check\n begin\n unless twitter.blank?\n RestClient.get \"twitter.com/#{twitter}\"\n end\n rescue\n errors.add :base, \"Invalid Twitter account.\"\n end\n end", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def is_tweet?\n type == 'TweetMessage'\n end", "def can_follow?(username)\n @config['twitter']['follows?'] == 'all' || @owner.nil? || username == @owner || twitter.friendship?(username, @owner)\n end", "def isFollowable?\n isTwitter? || isCompany?\n end", "def following?(tw_user)\n following.include?(tw_user)\n end", "def email_required?\n provider != 'twitter'\n end", "def apply_twitter(omniauth)\n if (extra = omniauth['extra']['user_hash'] rescue false)\n end\n end", "def twitter\n if twitter?\n return self.twitter_client if self.twitter_client\n self.twitter_client = TwitterOAuth::Client.new(\n :consumer_key => TWITTER_CONSUMER_KEY,\n :consumer_secret => TWITTER_CONSUMER_SECRET,\n :token => self.twitter_token,\n :secret => self.twitter_secret\n )\n else\n false\n end\n end", "def favorited_tweet?(tweet)\n favorite_tweets.include? tweet\n end", "def save_tweet?(tweet)\n if (tweet.user.followers_count + tweet.retweet_count) > MegaUltraTweet::Application::TWEET_RELEVANCE_MINIMUM\n return true\n end\n return false\n end", "def can_follow?(username)\n @original.nil? || username == @original || twitter.friendship?(username, @original)\n true\n end", "def status_follow?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_FOLLOW)\n return false\n end", "def synced_with_lastfm?\n lastfm_username.present?\n end", "def is_twitter_taken(db, twitter)\n\n # Return true if twitter is on database\n if db.execute('SELECT 1 FROM users WHERE twitter=?', twitter).length > 0 then\n return true\n else\n return false\n end\nend", "def can_follow?(username)\n @original.nil? || username.casecmp(@original) == 0 || twitter.friendship?(username, @original)\n end", "def can_follow?(username)\n @original.nil? || username.casecmp(@original) == 0 || twitter.friendship?(username, @original)\n end", "def can_follow?(username)\n @original.nil? || username == @original || twitter.friendship?(username, @original)\n end", "def takendown?\n author_linked_account_id && Takedown.linked_account_id_has_takedown?(author_linked_account_id)\n end", "def before_save\n if self.access_token.blank?\n self.authenticated = Twitter::Client.new.authenticate?(self.username, self.password)\n end\n \n return true\n end", "def omniauth?\n !!@omniauth\n end", "def facebook_url_exists?\n return false if facebook == \"\" || twitter == nil\n return true\n end", "def followers?\n following?\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def verify_credentials\n return false unless has_credentials? # make sure we actually have an api token set\n begin\n if defined?(@api)\n valid = twitter_api.client.authorized?\n else\n twitter_api # just fetching it the first time does an authorized check\n valid = true\n end\n rescue InvalidToken => ex\n valid = false\n rescue Exception => ex\n valid = true # non twitter validation error assume ok since could be network issue\n end\n valid\n end", "def has_followers?\n\t self.followers_count > 0\n\tend", "def github_account?\n !github_user.nil? and !github_token.nil?\n end", "def can_button?\n\t\tprovider.in? [\"twitter\", \"google_oauth2\"]\n\tend", "def is?(url)\n return true if url.match('https?://twitter\\.com.*status/(\\d+)')\n end", "def teaser_celebrity?\n true if twitter_followers && twitter_followers > 1000 || youtube_subscribers && youtube_subscribers > 1000 || instagram_followers && instagram_followers > 1000\n end", "def oauth?\n oauth_consumer_key && oauth_consumer_secret\n end", "def omniauth?\n provider? && uid?\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def oauth2_connected?\n self.send(:\"#{self.class.oauth2_uid_field}\").present?\n end", "def yahoo?\n provider_name == 'Yahoo!'\n end", "def check_twitter_credentials\n if session['twitter_token'].blank? || session['twitter_secret'].blank?\n redirect_to new_user_registration_path, :error => \"Debes linkear tu cuenta de twitter antes de continuar\" and return\n end\n end", "def lastfm_user?(user)\n lastfm_users.any? { |lastfm| lastfm.user_id == user.try(:id) }\n end", "def email_required?\n super && twitter_uid.blank? || (!twitter_uid.blank? && persisted?)\n end", "def tumblr_authorized?\n !!(session[:tumblr_oauth_token] && session[:tumblr_oauth_token_secret])\n end", "def auth?\n me != nil\n end", "def bot_user?\n [email protected]?\n end", "def is_following?(username)\n @followed_users.include?(username)\n end", "def authenticated?\n !account.nil?\n end", "def valid_twitter_response?(response)\n (response.is_a? Array and response.first and response.first.is_a? ::Twitter::Status)\n end", "def twitter\n unless @twitter_user\n provider = self.authentications.find_by_provider('twitter')\n @twitter_user = Twitter::Client.new(:oauth_token => provider.token, :oauth_token_secret => provider.secret )rescue nil\n end\n @twitter_user\n end", "def status_follow?()\n return true if (@status == TAC_PLUS_ACCT_STATUS_FOLLOW)\n return false\n end", "def tumblr_authorized?\n self.tumblr_access_token.present? & self.tumblr_access_token_secret.present?\n end", "def youtube_profile?\n @network = current_user.network ||= Network.new\n !(@network.youtube.nil? || @network.youtube.blank?)\n end", "def artist?\n end", "def oauth?\n type == 'OAuth'\n end", "def from_omniauth?\n uid.present? && provider.present?\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 likes?(tweet)\n \ttweet.likes.where(user_id: id).any?\n end", "def valid_tweet(tweet)\n\t\t@url = tweet.text\n\n\t\tif @url.include? \"#radio\"\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "def twitter\n default_oauth_callback do |auth|\n # username may already be taken, user will have to enter another one\n if User.exists? username: auth.info.nickname\n redirect_to controller: '/registrations', action: 'twitter_screen_name_clash'\n else\n default_oauth_fail\n end\n end\n end", "def update\n\t\t\tconfig = {\n\t\t\t consumer_key: ENV[\"TWITTER_CONSUMER_KEY\"],\n\t\t\t consumer_secret: ENV[\"TWITTER_CONSUMER_SECRET\"]\n\t\t\t}\n\n\t\t\tvalid_config = !(config[:consumer_key].nil? || config[:consumer_secret].nil?)\n\n\t\t\tif valid_config\n\t\t\t\tclient = Twitter::REST::Client.new config\n\t\t\t\t\n\t\t\t\taccount_exists = client.user? @twitter_account.screenname\n\n\t\t\t\tif account_exists\n\t\t\t\t\tupdate_twitter_user(client, @twitter_account)\n\t\t\t\t\tupdate_tweets(client, @twitter_account)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tlogger.info \"Twitter consumer key or secret not set in environment!\"\n\t\t\tend\n\n\t\t\treturn valid_config && account_exists\n\tend", "def twitter\n\t\thandle_omniauth_callback(request.env['omniauth.auth'])\n\tend", "def using_oauth?\n oauth_request? || oauth_response? || stored_oauth_token_and_secret?\n end", "def twitter_user\n @twitter_user ||= prepare_access_token(self.token, self.secret)\n end", "def exists?\n username && api_key\n end", "def twitter_profile\n @network = current_user.network ||= Network.new\n (@network.twitter.nil?) ? \"\" : @network.twitter\n end", "def followed_by?(user)\n followers.exists?(user.id)\n end", "def added_fb_account?\n !self.external_user_id.nil?\n end", "def has_blog?\n account.present? && account.name\n end", "def third_party_connect\n if tw_user_id.nil? && fb_user_id.nil?\n errors.add(\"Either twitter or facebook connect required\") \n end\n end", "def followed_by?(user)\n followers.include?(user)\n end", "def twitter\n auth = request.env['omniauth.auth']\n current_user.company.create_or_update_twitter_account(auth)\n\n flash.notice = 'Authorized Twitter account successfully.'\n redirect_to twitter_accounts_path\n end", "def oauth_login?\n github_id.present? || facebook_id.present?\n end", "def linked_github_account?\n accounts.for(\"github\").any?\n end", "def can_share?\n\t\tprovider.in? [\"facebook\", \"twitter\", \"lastfm\"]\n\tend", "def connected_to_facebook?\n fb_uid && fb_access_token\n end", "def team_account?\n account_type == 'team'\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def following?(friends)\n friends.find { |f| f[\"screen_name\"].casecmp(tname) == 0 }\n end", "def have_account?\n false\n end", "def following?\n user.present?\n end", "def followed_by?(user)\n extension_followers.where(user: user).any?\n end", "def can_follow?(m = nil)\n #logged_in? and ((current_member.has_role_or_above?(:staff) || current_member.in_group?(:betatest))\n logged_in? && @local_site.nil? # No follows for guests or on local sites (yet)\n end", "def twitter\n @data['social']['twitter']\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n self.twitter_name = user_info['name']\n self.twitter_screen_name = user_info['screen_name']\n self.login = 'twitter_' + user_info['screen_name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def select_twitter_account(&callback)\n account_type = @store.accountTypeWithAccountTypeIdentifier(ACAccountTypeIdentifierTwitter)\n\n @store.requestAccessToAccountsWithType(account_type, options: nil, completion: -> (granted, error) do\n if granted\n @accounts = @store.accountsWithAccountType(account_type)\n if @accounts.length > 0\n Dispatch::Queue.main.async do\n next_step = -> (account, &firebase_handler) do\n self.authenticate_account(account, &firebase_handler)\n end\n callback.call(nil, @accounts, next_step)\n end if callback\n else\n error = NSError.alloc.initWithDomain('TwitterAuthHelper',\n code: AuthHelperErrorAccountAccessDenied,\n userInfo: { NSLocalizedDescriptionKey => 'No Twitter accounts detected on phone. Please add one in the settings first.' })\n Dispatch::Queue.main.async do\n callback.call(error, nil, nil)\n end if callback\n end\n else\n error = NSError.alloc.initWithDomain('TwitterAuthHelper',\n code: AuthHelperErrorAccountAccessDenied,\n userInfo: { NSLocalizedDescriptionKey => 'Access to twitter accounts denied.' })\n Dispatch::Queue.main.async do\n callback.call(error, nil, nil)\n end if callback\n end\n end)\n end", "def get_twitter_status\n logger.info 'Getting twitter'\n begin\n c = Grackle::Client.new\n twitter = c.statuses.user_timeline?(:screen_name => 'paulcarlile', :count => 2)\n rescue Grackle::TwitterError\n twitter = Grackle::TwitterError\n end\n end", "def passwordy?\n # puts \"*****************----------------> Handling user as PASSWORDY.\"\n !self.has_oauth?\n end", "def followed_by?(user)\n followers.include?(user)\n end", "def load_twitter_account\n # FIXME would this be better placed in the models?\n @twitter_account = @workspace ? @workspace.twitter_account || @workspace.create_twitter_account :\n @user.twitter_account || @user.create_twitter_account\n end", "def record_has_two_factor_auth_required_and_uncompleted?\n record&.get_two_factor_auth_enabled && !two_factor_auth_completed?\n end" ]
[ "0.82345706", "0.81928027", "0.8162784", "0.79879415", "0.78655124", "0.77469885", "0.7708659", "0.7660502", "0.76420337", "0.73533493", "0.7204052", "0.70858", "0.70653516", "0.70464224", "0.687312", "0.6819952", "0.6815421", "0.6772624", "0.6765938", "0.6765408", "0.67458254", "0.67113775", "0.6586471", "0.6545182", "0.64893234", "0.64581966", "0.6449016", "0.64299065", "0.6386429", "0.6386429", "0.6363917", "0.63472736", "0.62956333", "0.6294806", "0.62922263", "0.6279924", "0.6278881", "0.62692374", "0.6238376", "0.6228681", "0.6222386", "0.62078625", "0.618771", "0.6187326", "0.6174364", "0.6173765", "0.6169618", "0.61679476", "0.6165802", "0.61584437", "0.6152755", "0.61433315", "0.61334413", "0.6116518", "0.6111348", "0.6101868", "0.6096056", "0.60941404", "0.60437995", "0.60311055", "0.60147434", "0.5978921", "0.5977506", "0.5976871", "0.5974347", "0.5962511", "0.5957686", "0.59530765", "0.59525925", "0.5932483", "0.5927517", "0.59270763", "0.5925195", "0.59164464", "0.5908771", "0.5884907", "0.5884325", "0.58741325", "0.5868138", "0.58673185", "0.5865375", "0.5859233", "0.58576345", "0.5854701", "0.5845186", "0.58440745", "0.58440745", "0.58405495", "0.5831404", "0.5825175", "0.58226556", "0.5819898", "0.5819715", "0.58190334", "0.5812535", "0.5810772", "0.5809229", "0.5808062", "0.57978845", "0.579593" ]
0.70900244
11
Whether or not the artist has a Facebook page or account.
def facebook?; facebook.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook?\n type == 'Facebook'\n end", "def facebook?\n self.kind == 'facebook'\n end", "def has_facebook_profile?\n fb_userid.present?\n end", "def facebook?\n provider_name == 'Facebook'\n end", "def facebook_profile?\n @network = current_user.network ||= Network.new\n !(@network.facebook.nil? || @network.facebook.blank?)\n end", "def connected_to_facebook?\n fb_uid && fb_access_token\n end", "def facebook?\n self.provider == 'facebook'\n end", "def fb_connected?\n fb_user_id.present?\n end", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def connected_to_facebook?\n !self.facebook_id.blank?\n end", "def source_facebook?\n omniauth_access? && identities.collect{|i| i.provider}.include?('facebook')\n end", "def fb_authorized?\n self.access_token.present? \n end", "def added_fb_account?\n !self.external_user_id.nil?\n end", "def facebook_connectable?\n return false unless options.facebook\n options.facebook && ENV['WARS_FB_APP_ID'] && ENV['WARS_FB_SECRET']\n end", "def checked_in_facebook?\n if user_signed_in?\n identity = Identity.where(user_id: current_user.id)\n return true if identity.count == 1\n end\n false\n end", "def facebook_url_exists?\n return false if facebook == \"\" || twitter == nil\n return true\n end", "def authenticating_with_facebook?\n !authenticating_with_unauthorized_record? && self.facebook_api_keys_provided? && self.raw_cookie\n end", "def authenticating_with_facebook?\n !skip_facebook_authentication && !authenticating_with_unauthorized_record? && attempted_record.nil? && facebook_session?\n end", "def omniauth?\n provider? && uid?\n end", "def has_fb_page_permission\n get_fb_permissions.detect { |e| \"manage_pages\" == e[\"permission\"] } ? true : false\n end", "def social?\n @data['social'] != {}\n end", "def isFollowable?\n isTwitter? || isCompany?\n end", "def omniauth?\n !!@omniauth\n end", "def followers?\n following?\n end", "def authenticating_with_facebook?\n !authenticating_with_unauthorized_record? &&\n !self.class.facebook_api_key.blank? &&\n !self.class.facebook_secret_key.blank?\n end", "def from_omniauth?\n uid.present? && provider.present?\n end", "def has_followers?\n\t self.followers_count > 0\n\tend", "def facebook_register_enabled?\n Figaro.env.respond_to?(:facebook_key) && Figaro.env.respond_to?(:facebook_secret)\n end", "def facebook_connect_user?\n facebook_user? and password.blank?\n end", "def has_blog?\n account.present? && account.name\n end", "def is_owner?(account)\n attachable == account.profile\n end", "def is_displayed_on_site?\n feed.feed_type.name == \"Article\"\n end", "def following_profile?(profile)\n return favorites.streams.where(favable_id: profile.stream_ids).count > 0\n end", "def other_user_profile?\n !is_owner\n end", "def can_share?\n\t\tprovider.in? [\"facebook\", \"twitter\", \"lastfm\"]\n\tend", "def has_fb_permission\n get_fb_permissions.detect { |e| \"publish_actions\" == e[\"permission\"] } ? true : false\n end", "def has_profile?\n return self.profile.present?\n end", "def logged_in?\n current_profile != nil\n end", "def auth?\n me != nil\n end", "def status_follow?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_FOLLOW)\n return false\n end", "def takendown?\n author_linked_account_id && Takedown.linked_account_id_has_takedown?(author_linked_account_id)\n end", "def likely_facebook_account\n facebook_accounts.first.andand.first\n end", "def authenticating_with_facebook?\n if controller.respond_to?(:controller) && controller.controller.respond_to?(:set_facebook_session)\n controller.set_facebook_session\n !authenticating_with_unauthorized_record? && controller.facebook_session?\n end\n end", "def is_of_page_owner\n\t\treturn @is_of_page_owner \n\tend", "def verify_fb_auth(auth)\n !(auth.blank? || auth[\"uid\"].blank? ||\n !auth[\"uid\"].to_s.match(/\\A\\d+\\Z/) ||\n auth[\"info\"][\"first_name\"].blank? ||\n auth[\"info\"][\"last_name\"].blank?)\n end", "def log_in_with_facebook?\n return false if %w[all facebook].include? ENV[\"DISABLE_LOG_INS\"]\n return true unless params[:log_in_with]\n return %w[any facebook].include? params[:log_in_with]\n end", "def personal_page?\n return false unless current_user\n return true if params[:owner_id].to_i == current_user.id\n return true if @user && current_user == @user\n return true if @quest && current_user.owns?(@quest)\n return true if @offer && current_user.owns?(@offer)\n \n false\n end", "def has_social_and_not_persisted\n !self.social_sessions.empty? && self.id.nil?\n end", "def picture?\n\t\tprovider.in? [\"twitter\", \"facebook\", \"google_oauth2\", \"lastfm\", \"vimeo\"]\n\tend", "def request_like_fan_page?\n Rails.logger.info(\"TOKEN : #{self.f_token}\")\n oauth = Koala::Facebook::OAuth.new(ENV['FACEBOOK_APP_ID'], ENV['FACEBOOK_APP_SECRET'])\n graph = Koala::Facebook::API.new(self.f_token)\n data = graph.get_connections(self.f_id, \"likes/#{ENV['FACEBOOK_PAGE_ID']}\")\n\n found = false\n data.each do |like|\n found = true if like['id'] == \"#{ENV['FACEBOOK_PAGE_ID']}\"\n end\n return found\n end", "def pro_page?\n (session[:user_type] && session[:user_type] == USER_TYPES[:pro])\n end", "def is_artist_page?(p)\n\t\treturn false unless p && p.content && p.categories && p.title\n\t\tbelongs_to_categories? p, [\n\t\t\t\"musicians\",\n\t\t\t\"artists\",\n\t\t\t\"duos\",\n\t\t\t\"groups\",\n\t\t\t\"singers\",\n\t\t\t\"guitarists\",\n\t\t\t\"gitarrister\",\n\t\t\t\"sångare\",\n\t\t\t\"grupper\",\n\t\t\t\"musiker\"\n\t\t], true\n\tend", "def identity_page?\n active_page? 'accounts' => ['show']\n end", "def twitter_profile?\n @network = current_user.network ||= Network.new\n !(@network.twitter.nil? || @network.twitter.blank?)\n end", "def email_required?\n !fb_user?\n end", "def share_to_fb_timeline?\n self.fb_action_id == FBSharing::Underway\n end", "def media_company?\n \tperson.profile.type == 'MediaCompany' \t\n end", "def have_account?\n false\n end", "def has_public_profile?\n is_visible? && (show_profile == Visibility::PUBLIC)\n end", "def affiliates_enabled?\n affiliate_account_types.present?\n end", "def linkedin_profile?\n @network = current_user.network ||= Network.new\n !(@network.linkedin.nil? || @network.linkedin.blank?)\n end", "def is_me?\n return self.user.email == session[:email]\n end", "def friend_signed_in?\n user_signed_in? && (current_user.type==\"Friend\") \n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def can_create_playlist?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def native?\n self.fb_object_id.nil?\n end", "def is_follow_this_profile?(profile)\n # return current_user.profile.follows?(profile)\n\n @current_profile = current_user.profile\n return @current_profile.follows?(profile)\n# return profile.id == @current_profile.id\n\n end", "def lastfm_user?(user)\n lastfm_users.any? { |lastfm| lastfm.user_id == user.try(:id) }\n end", "def can_accept_showing?\n profile.valid? && valid_bank_token? && !blocked?\n end", "def has_avatar?\n avatar.present? or read_attribute(:fb_avatar)\n end", "def signed_in?\n !!@me\n end", "def shared?\n !self.native? & (self.fb_object_id != FBSharing::Underway) \n end", "def linked_github_account?\n accounts.for(\"github\").any?\n end", "def oauth_login?\n github_id.present? || facebook_id.present?\n end", "def is_blogger_logged_in?\n !!current_blogger \n end", "def profile_show_page?\n controller_name == \"profiles\"\n end", "def profile_show_page?\n controller_name == \"profiles\"\n end", "def in_iframe?\n !!env[\"facebook.in_iframe\"]\n end", "def has_profilepic?\n profile_pic != nil\n end", "def logged_in?\n !!link_to_account_detail_page\n end", "def teaser_celebrity?\n true if twitter_followers && twitter_followers > 1000 || youtube_subscribers && youtube_subscribers > 1000 || instagram_followers && instagram_followers > 1000\n end", "def should_fetch?\n last_fetched_at.nil? or !fetched_directly? or facebook_api_error.present?\n end", "def followed_by?(user)\n extension_followers.where(user: user).any?\n end", "def has_valid_wepay_access_token?\n\t if self.wepay_access_token.nil?\n\t return false\n\t end\n\t response = WEPAY.call(\"/user\", self.wepay_access_token)\n\t response && response[\"user_id\"] ? true : false\n\tend", "def following?\n user.present?\n end", "def logged_in?\n !current_baby.nil?\n end", "def synced_with_lastfm?\n lastfm_username.present?\n end", "def personal_account?\n account_type == 'personal'\n end", "def needs_followup?\n followup_note_count && followup_note_count > 0\n end", "def status_follow?()\n return true if (@status == TAC_PLUS_ACCT_STATUS_FOLLOW)\n return false\n end", "def logged_in?\n hubssolib_logged_in?\n end", "def show?\n if user.type == 'ReferralAgency'\n user.tenants.include?(app.tenant)\n else\n user.properties.each do |property|\n return true if property.applications.include?(app)\n end\n false\n end\n end", "def github_account?\n !github_user.nil? and !github_token.nil?\n end", "def has_basic_profile_info?\n return false if name.blank? || email.blank?\n return true\n end", "def has_auth?\n !current_person.nil?\n end", "def user_is_pro?\n @user_is_pro ||= (user_is_store_owner? || pro_page?)\n end", "def logged_in?\n\t\t!current_account.nil?\n\tend", "def followed_by?(user)\n followers.include?(user)\n end", "def logged_in?\n account_signed_in?\n end", "def has_userinfo?\n ImpURI.has_userinfo?(@uri)\n end" ]
[ "0.7816081", "0.76158774", "0.75706494", "0.7467802", "0.7382725", "0.7331456", "0.72570485", "0.7246724", "0.7241436", "0.7119931", "0.7053106", "0.695168", "0.6920767", "0.6907983", "0.6857834", "0.6851738", "0.68331015", "0.6802571", "0.6790064", "0.6769842", "0.6755371", "0.6719199", "0.6715625", "0.67055225", "0.66925824", "0.66310894", "0.66143227", "0.66059124", "0.6603506", "0.6511851", "0.6505603", "0.6459433", "0.6459347", "0.6445687", "0.6412438", "0.63991106", "0.6385164", "0.6378535", "0.63467443", "0.6328305", "0.63146496", "0.6310739", "0.6306425", "0.63054574", "0.6294582", "0.62931883", "0.6284235", "0.62819576", "0.62762666", "0.62555623", "0.6254882", "0.62409353", "0.6230818", "0.62249446", "0.62226766", "0.6216322", "0.6214476", "0.62055296", "0.6204652", "0.620433", "0.6198488", "0.61981106", "0.61942303", "0.61788905", "0.6178806", "0.61698186", "0.61605155", "0.6150632", "0.6149382", "0.6131588", "0.613003", "0.61151314", "0.6112103", "0.6111249", "0.61029583", "0.6097477", "0.6097268", "0.60959804", "0.6084827", "0.60717213", "0.60638267", "0.60502046", "0.60462993", "0.60420424", "0.604193", "0.60412455", "0.60405755", "0.60313034", "0.6025059", "0.60189575", "0.601036", "0.60075724", "0.599373", "0.5985863", "0.59796745", "0.5965245", "0.5961814", "0.5957401", "0.5956843", "0.59562725" ]
0.6400498
35
Whether or not the artist has a Google+ account.
def googleplus?; googleplus.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def google?\n @domain.include?(:Google)\n end", "def google?\n provider_name == 'Google'\n end", "def google_signed_in?\n\t\t!access_token.nil? and !access_token_expired?\n\tend", "def google?\n ['google_oauth2', 'google'].include?(self.provider)\n end", "def omniauth?\n provider? && uid?\n end", "def google_oauth_enabled?\n ENV.has_key?('GOOGLE_CLIENT_ID') and ENV.has_key?('GOOGLE_CLIENT_SECRET')\nend", "def added_fb_account?\n !self.external_user_id.nil?\n end", "def omniauth?\n !!@omniauth\n end", "def from_omniauth?\n uid.present? && provider.present?\n end", "def linked_github_account?\n accounts.for(\"github\").any?\n end", "def available?\n begin\n head(\"v1/account/#{@email}\")\n return false\n rescue JustGiving::NotFound\n return true\n end\n end", "def have_account?\n false\n end", "def googlemerchant?\n Object.const_defined?('TradoGooglemerchantModule') ? true : false\n end", "def facebook_register_enabled?\n Figaro.env.respond_to?(:facebook_key) && Figaro.env.respond_to?(:facebook_secret)\n end", "def can_donate?\n\t\tprovider.in? [\"facebook\", \"twitter\"]\n\tend", "def github_account?\n !github_user.nil? and !github_token.nil?\n end", "def fb_connected?\n fb_user_id.present?\n end", "def facebook?\n provider_name == 'Facebook'\n end", "def connected_to_facebook?\n fb_uid && fb_access_token\n end", "def auth?\n me != nil\n end", "def can_create_playlist?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def facebook?\n self.provider == 'facebook'\n end", "def requested_account_authorized?\n session[:_bookingsync_account_id].blank? ||\n session[:_bookingsync_account_id] == session[:account_id]\n end", "def has_own_providers?\n if is_reseller?\n common_use_provider_count > 0\n else\n raise \"User is not reseller, he cannot have providers\"\n end\n end", "def has_facebook_profile?\n fb_userid.present?\n end", "def yahoo?\n provider_name == 'Yahoo!'\n end", "def has_positive_auth_criteria?\n\t\t\treturn !self.positive_auth_criteria.empty?\n\t\tend", "def linkedin_register_enabled?\n Figaro.env.respond_to?(:linkedin_key) && Figaro.env.respond_to?(:linkedin_secret)\n end", "def security_require_google_play_services\n return @security_require_google_play_services\n end", "def att_register_enabled?\n Figaro.env.respond_to?(:att_client_id) && Figaro.env.respond_to?(:att_client_secret)\n end", "def oauth2_connected?\n self.send(:\"#{self.class.oauth2_uid_field}\").present?\n end", "def should_register_google_analytic_hits(the_login)\n result = true\n if !the_login.blank?\n if the_login.is_superuser?\n result = false\n else\n member_type_names = the_login.memberships.map{|m|m.member_type}.map{|t|t.member_type_desc}\n for name in member_type_names\n if name.downcase.include?(\"administrator\")\n result = false\n break\n end\n end\n end\n end\n result\n end", "def email_required?\n !fb_user?\n end", "def affiliates_enabled?\n affiliate_account_types.present?\n end", "def email_required?\n provider != 'twitter'\n end", "def has_valid_wepay_access_token?\n if self.wepay_access_token.nil?\n return false\n end\n response = GemsUsage::Application::WEPAY.call(\"/user\", self.wepay_access_token)\n response && response[\"user_id\"] ? true : false\nend", "def can_listen?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def allow_sign_up?\n @allow_sign_up\n end", "def can_button?\n\t\tprovider.in? [\"twitter\", \"google_oauth2\"]\n\tend", "def has_auth?\n !current_person.nil?\n end", "def account_used\n\n\t\tif Booking.where(location_id: Location.where(company_id: self.id).pluck(:id)).where('created_at > ?', DateTime.now - 1.weeks).count > 0\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\n\tend", "def oauth_login?\n github_id.present? || facebook_id.present?\n end", "def source_facebook?\n omniauth_access? && identities.collect{|i| i.provider}.include?('facebook')\n end", "def github_register_enabled?\n Figaro.env.respond_to?(:github_key) && Figaro.env.respond_to?(:github_secret)\n end", "def ga_tracker?\n @ga_tracker.nil? ? ga_tracker() : @ga_tracker\n end", "def any_oauth_register_enabled?\n facebook_register_enabled? ||\n github_register_enabled? ||\n linkedin_register_enabled? ||\n twitter_register_enabled? ||\n att_register_enabled?\n end", "def status_getuser?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_GETUSER)\n return false\n end", "def fb_authorized?\n self.access_token.present? \n end", "def exists?\n # Always true if we have a gapi object\n return true unless @gapi.nil?\n # If we have a value, return it\n return @exists unless @exists.nil?\n ensure_gapi!\n @exists = [email protected]?\n end", "def has_valid_wepay_access_token?\n\t if self.wepay_access_token.nil?\n\t return false\n\t end\n\t response = WEPAY.call(\"/user\", self.wepay_access_token)\n\t response && response[\"user_id\"] ? true : false\n\tend", "def has_github?\n github_identity.present?\n end", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def status_follow?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_FOLLOW)\n return false\n end", "def registered?\n begin\n self.get_registration\n true\n rescue => e\n # any error should be treated as the user not being registered\n false\n end\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def has_account_merged_with?(provider)\n self.o_auth_credentials.where(provider: provider).any?\n end", "def registration_required?\n not hosted?\nend", "def registration_required?\n not hosted?\nend", "def check_fields_google_domain?\n return true if @fields[:share] == \"Google\" # File Listing\n return true if @fields[:src_sharename] == \"Google\" && @fields[:dst_sharename] == \"Google\" # File Copy/Move\n return true if @fields[:sharename] == \"Google\" # File Deletion\n return false\n end", "def oauth2_auto_create_account?\n self.oauth2_auto_create_account\n end", "def google_plus(word)\n if /\\Z+/.match(word) != nil && /google/i.match(word) != nil\n true\n else\n false\n end\n end", "def exists?\n username && api_key\n end", "def youtube_profile?\n @network = current_user.network ||= Network.new\n !(@network.youtube.nil? || @network.youtube.blank?)\n end", "def has_appstore?\n !appstore_url.blank?\n end", "def current_user_signed_up?\n logged_in? && !current_user_is_host? && @game.players.include?(current_user)\n end", "def facebook_url_exists?\n return false if facebook == \"\" || twitter == nil\n return true\n end", "def connect_gplus\n\t auth = request.env[\"omniauth.auth\"]\n\t current_member.gplus_id = auth[\"uid\"]\n current_member.gplus_token = auth.credentials.token\n if auth.info.image.present?\n current_member.username = auth.info.name\n current_member.img_url = auth.info.image\n end\n current_member.gplus_refresh_token = auth.credentials.refresh_token\n current_member.gplus_token_expires_at = auth.credentials.expires_at\n\t current_member.save\n\t GoogleModel.store_urls(current_member)\n\t redirect_to members_social_sign_up_path\t\n end", "def facebook_connectable?\n return false unless options.facebook\n options.facebook && ENV['WARS_FB_APP_ID'] && ENV['WARS_FB_SECRET']\n end", "def facebook_profile?\n @network = current_user.network ||= Network.new\n !(@network.facebook.nil? || @network.facebook.blank?)\n end", "def has_valid_wepay_access_token?\n if self.wepay_access_token.nil?\n return false\n end\n response = WEPAY.call(\"/user\", self.wepay_access_token)\n response && response[\"user_id\"] ? true : false\nend", "def has_valid_wepay_access_token?\n if self.wepay_access_token.nil?\n return false\n end\n response = WEPAY.call(\"/user\", self.wepay_access_token)\n response && response[\"user_id\"] ? true : false\nend", "def website_required?\n !using_open_id?\n end", "def type_authentication?()\n return(true) if(@type == TAC_PLUS_AUTHEN)\n return(false)\n end", "def user_registered? user\n return nil if user.nil?\n return nil if user.person.nil?\n\n if self.registrations.where(:person_id => user.person.id).count == 0\n logger.debug(\"User #{user.email} isn't registered to self.title\")\n return false\n else\n return true\n end\n end", "def user_registered? user\n return nil if user.nil?\n return nil if user.person.nil?\n\n if self.registrations.where(:person_id => user.person.id).count == 0\n logger.debug(\"User #{user.email} isn't registered to self.title\")\n return false\n else\n return true\n end\n end", "def ballot_registered?\n @ballot_registered\n end", "def authorized_for_github?\n !github.nil?\n end", "def personal_account?\n account_type == 'personal'\n end", "def has_valid_wepay_access_token?\n\t\tif self.wepay_access_token.nil?\n\t\t\treturn false\n\t\tend\n\t\tresponse = Wefarm::Application::WEPAY.call(\"/user\", self.wepay_access_token)\n\t\tresponse && response[\"user_id\"] ? true : false\n\tend", "def can_share?\n\t\tprovider.in? [\"facebook\", \"twitter\", \"lastfm\"]\n\tend", "def check_accounts\n\t\t( @participant.facebook_account != nil && @participant.facebook_account != \"\" ) ||\n\t\t( @participant.twitter_account != nil && @participant.twitter_account != \"\" ) ||\n\t\t( @participant.github_account != nil && @participant.github_account != \"\" ) ||\n\t\t( @participant.google_plus_account != nil && @participant.google_plus_account != \"\" )\n\tend", "def global?(account_type)\n global_account_types.include?(account_type.to_s.classify)\n end", "def can_subscribe?()\n \treturn !(self.phoneNumber.nil?)\n\tend", "def authenticating_with_facebook?\n !authenticating_with_unauthorized_record? && self.facebook_api_keys_provided? && self.raw_cookie\n end", "def using_oauth?\n oauth_request? || oauth_response? || stored_oauth_token_and_secret?\n end", "def facebook?\n type == 'Facebook'\n end", "def oauth?\n oauth_consumer_key && oauth_consumer_secret\n end", "def has_scope?(scope)\n access_token && access_token.scopes.include?(scope)\n end", "def oauth10?\n\t\t(defined? OAUTH_10_SUPPORT) && OAUTH_10_SUPPORT && self.callback_url.blank?\n\tend", "def has_social_and_not_persisted\n !self.social_sessions.empty? && self.id.nil?\n end", "def can_close_signup?\n @signup_closecross.visible?\n end", "def checked_in_facebook?\n if user_signed_in?\n identity = Identity.where(user_id: current_user.id)\n return true if identity.count == 1\n end\n false\n end", "def available?\n Spotify.album_is_available(pointer)\n end", "def organisation?\n session[:organisation] and session[:organisation].size > 0\n end", "def bot_user?\n [email protected]?\n end", "def recording_consent_required?\n @settings.get_value(\"Require Recording Consent\") == \"true\"\n end", "def force_authn?\n force_authn == true\n end", "def social?\n @data['social'] != {}\n end", "def in_active_directory?\n\t\t\t\t\t!guid.blank?\n\t\t\t\tend" ]
[ "0.69267607", "0.68586606", "0.68016315", "0.6693224", "0.66651857", "0.6491516", "0.6469338", "0.63785905", "0.6259904", "0.625609", "0.6246889", "0.61783224", "0.61536753", "0.6108226", "0.6099364", "0.6013839", "0.59991777", "0.5962692", "0.59493005", "0.59474915", "0.59467757", "0.59148836", "0.59041053", "0.58905417", "0.5874047", "0.5873948", "0.5857707", "0.58413684", "0.58218926", "0.5819396", "0.5814192", "0.58095425", "0.5785284", "0.5784579", "0.57776177", "0.5761365", "0.5749131", "0.5745946", "0.57440627", "0.5738332", "0.573279", "0.5728718", "0.57157505", "0.5714474", "0.5703604", "0.57001626", "0.5693275", "0.56924486", "0.5688161", "0.5682835", "0.56634015", "0.56632996", "0.5658507", "0.5657477", "0.5657022", "0.5657022", "0.5652656", "0.56391025", "0.56391025", "0.5634543", "0.5628185", "0.5624546", "0.56151676", "0.5599233", "0.55970556", "0.5596401", "0.5591432", "0.5587783", "0.5587001", "0.55858994", "0.55855095", "0.55855095", "0.55812806", "0.5576924", "0.55756694", "0.55756694", "0.55741215", "0.5573326", "0.55684716", "0.5563408", "0.555727", "0.5556938", "0.5550841", "0.55443007", "0.55428046", "0.5538419", "0.55334085", "0.5528502", "0.5520653", "0.5516453", "0.55140144", "0.55012745", "0.5500294", "0.54901683", "0.54865754", "0.5483756", "0.54797095", "0.54795545", "0.5478942", "0.54785585" ]
0.67202014
3
Whether or not the artist has a MySpace account.
def myspace?; myspace.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def have_account?\n false\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def logged_in?\n\t\t!current_account.nil?\n\tend", "def personal_account?\n account_type == 'personal'\n end", "def current_account?(account)\n\t\taccount == current_account\n\tend", "def current_account_has_username?\n logged_in? && current_account.username.present?\n end", "def logged_in?\n !current_account.nil?\n end", "def logged_in?\n !current_account.nil?\n end", "def logged_in?\n !current_account.nil?\n end", "def is_owner?(account)\n attachable == account.profile\n end", "def authenticated?\n !account.nil?\n end", "def current_account?(account)\n account == current_account\n end", "def current_account?(account)\n account == current_account\n end", "def team_account?\n account_type == 'team'\n end", "def requested_account_authorized?\n session[:_bookingsync_account_id].blank? ||\n session[:_bookingsync_account_id] == session[:account_id]\n end", "def auth?\n me != nil\n end", "def github_account?\n !github_user.nil? and !github_token.nil?\n end", "def synced_with_lastfm?\n lastfm_username.present?\n end", "def logged_in?\n current_account != :false && current_account.active?\n end", "def member_logged_in?\n !current_library_member.nil?\n end", "def signed_in?\n !!@me\n end", "def logged_in?\n\t !current_merchant.nil?\n\tend", "def logged_in?\n !!current_ma_user\n end", "def logged_in?\n !current_company.nil?\n end", "def registered_on_mxit_money?(connection = MxitMoneyApi.connect(ENV['MXIT_MONEY_API_KEY']))\n begin\n if connection\n result = connection.user_info(:id => uid)\n result[:is_registered]\n end\n rescue => e\n Airbrake.notify_or_ignore(e,:parameters => {:user => self, :connection => connection})\n false\n end\n end", "def exists?\n username && api_key\n end", "def member?\n client.organization_member? org_id, user.login\n end", "def available?\n begin\n head(\"v1/account/#{@email}\")\n return false\n rescue JustGiving::NotFound\n return true\n end\n end", "def omniauth?\n provider? && uid?\n end", "def is_owner?(xaccount:)\n # DRAFT and creator means owner\n return true if publication.is_draft? && publication.current_version.is_creator?(xaccount: xaccount)\n\n # Author means owner\n return true if publication.current_version.is_author?(xaccount: xaccount)\n\n # All others are not owners\n false\n end", "def refactorial_account?\n # Search for this account name\n !get_account.nil?\n end", "def affiliates_enabled?\n affiliate_account_types.present?\n end", "def me?\n nick_canon == @connection.canonize(@connection.nick)\n end", "def twitter_login?\n\t\tself.uid ? true : false\n\tend", "def is_account_holder?\n roles.any? { |r| r.title == 'account_holder' }\n end", "def has_userinfo?\n ImpURI.has_userinfo?(@uri)\n end", "def member?\n client.organization_member? org_id, github_user.login\n end", "def key_based?\n @username && [email protected]? && @api_key && !@api_key.empty?\n end", "def user_is_store_owner?\n (user_signed_in? && current_user.is_store_owner?)\n end", "def manager_logged_in?\n !session[:manager_id].nil?\n end", "def logged_in?\n current_profile != nil\n end", "def artist?\n end", "def hasuser? username\n\t\[email protected]? username\t\t\n\tend", "def added_fb_account?\n !self.external_user_id.nil?\n end", "def shadow_user?\n return !session[:shadow_user_id].blank?\n end", "def missing_nickname?\n !current_user.nickname\n end", "def has_auth?\n !current_person.nil?\n end", "def account_customer_info?\n !current_customer.nil?\n end", "def account_has_service?(service)\n account = Account.find(current_user)\n account.service?(service)\n end", "def logged_in?\n !current_player.nil?\n end", "def logged_in?\n !current_player.nil?\n end", "def logged_in?\n !current_coordinator.nil?\n end", "def is_me?\n return self.user.email == session[:email]\n end", "def remember_me?\n return (self.remember_me == \"1\")\n end", "def logged_in?\n !current_muser.nil?\n end", "def logged_in?\n !!current_employee\n end", "def mine?\n user && user.username == Codeplane.username\n end", "def logged_in?\n !current_baby.nil?\n end", "def isAuthorized? account\n return true if current_user.admin?\n house = House.where(:account => account)\n return false if (house.nil || current_user.tenantOnly?)\n end", "def is_owner?\n Account.current ? Account.current.has_owner?(self) : false\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 token_based?\n @userId && @authToken && [email protected]?\n end", "def logged_in?\n !!current_donor\n end", "def account_has_no_service?\n account = Account.find(current_user)\n account.no_services?\n end", "def logged_in?\n\t !current_staff.nil?\n\t end", "def authorized?\n if Vermonster::Client.connection.get(\"me\").status == 200\n true\n else\n false\n end\n end", "def twitter_profile?\n @network = current_user.network ||= Network.new\n !(@network.twitter.nil? || @network.twitter.blank?)\n end", "def logged_in?\n\t\t !!current_user\n end", "def lastfm_user?(user)\n lastfm_users.any? { |lastfm| lastfm.user_id == user.try(:id) }\n end", "def customer_logged_in?\n !current_customer.nil?\n end", "def is_logged_in_manager?\n @is_logged_in_manager == 1\n end", "def logged_in?\n\t\t!current_member.nil?\n\tend", "def is_current_user?\n current_account.id.eql?(object.user.id)\n end", "def has_account\n @attributes[:has_account]\n end", "def logged_in?\n account_signed_in?\n end", "def twitter_user?\n return true if is_logged_in? && (session[:request_token] && session[:request_token_secret] && session[:twitter_id])\n end", "def logged_in?\n \t\t!current_tenant.nil?\n \tend", "def share_cases?(account)\n if [AppConstants::PRIVILEGE[:super_user],AppConstants::PRIVILEGE[:admin],AppConstants::PRIVILEGE[:user_manager]].include?(portal_privilege) and account == company\n true\n else\n false\n end\n end", "def remember_me?\n remember_me == \"1\"\n end", "def remember_me?\n remember_me == \"1\"\n end", "def other_entry?\n principle == \"EVERYONE\"\n end", "def signed_in?\n\t\t!current_customer.nil?\n\tend", "def sauce?\n !!(sauce_user && sauce_key)\nend", "def logged_in?\r\n current_user != :false\r\n end", "def logged_in?\n !!(cookie && (cookie =~ /reddit_session/) != nil)\n end", "def person_logged_in?\n !session[:person_id].nil?\n end", "def has_valid_wepay_access_token?\n\t if self.wepay_access_token.nil?\n\t return false\n\t end\n\t response = WEPAY.call(\"/user\", self.wepay_access_token)\n\t response && response[\"user_id\"] ? true : false\n\tend", "def linked_github_account?\n accounts.for(\"github\").any?\n end", "def logged_in?\n !current_person.nil?\n end", "def logged_in?\n !current_person.nil?\n end", "def logged_in?\n session[:uid] != nil\n end", "def logged_in?\n session[:uid] != nil\n end", "def user_is_guild_owner?\n @guild = Guild.find(User.find(session[:user_id])[:guild_id])\n return (@guild[:owner_id] == session[:user_id]) ? true : false\n end", "def logged_in?\n hubssolib_logged_in?\n end", "def logged_in?\n !current_receiver.nil?\n end", "def logged_in?\n !current_ballonfahrer.nil?\n end", "def owned?\n user.present?\n end", "def logged_in?\n\t !current_member.nil?\n\tend", "def status_getuser?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_GETUSER)\n return false\n end", "def type_authentication?()\n return(true) if(@type == TAC_PLUS_AUTHEN)\n return(false)\n end", "def secretary?\n ASF::Service.find('asf-secretary').members.include? self\n end" ]
[ "0.67976964", "0.65869355", "0.6425016", "0.64203155", "0.6399306", "0.6378119", "0.6352559", "0.6352559", "0.6352559", "0.6346407", "0.63049984", "0.6292797", "0.6292797", "0.62825245", "0.62496865", "0.6227121", "0.6224383", "0.6218546", "0.6198762", "0.6196197", "0.6167344", "0.6149075", "0.61320204", "0.61077654", "0.60887295", "0.6087057", "0.60559523", "0.6053563", "0.60465866", "0.603916", "0.6035698", "0.6028098", "0.6025043", "0.60180175", "0.6012978", "0.6009561", "0.6003851", "0.5995928", "0.59726053", "0.5969946", "0.59612083", "0.59536344", "0.5953529", "0.59489924", "0.59364915", "0.59328467", "0.59309", "0.5923842", "0.59055346", "0.5901268", "0.5901268", "0.58971375", "0.58962685", "0.58923393", "0.5884379", "0.5883956", "0.58792764", "0.58718556", "0.5868833", "0.58671814", "0.58662057", "0.58413804", "0.5839956", "0.58397704", "0.58309525", "0.5812313", "0.5809563", "0.5807377", "0.5805535", "0.58032835", "0.5801703", "0.5800452", "0.5799216", "0.579384", "0.5793605", "0.5792517", "0.5790491", "0.5787643", "0.5783767", "0.5783767", "0.5782131", "0.5780316", "0.577988", "0.5777059", "0.57758546", "0.5771848", "0.57714415", "0.5771421", "0.5771417", "0.5771417", "0.5766595", "0.5766595", "0.5765771", "0.57648414", "0.5764708", "0.57626253", "0.5760727", "0.5759037", "0.5759006", "0.57578677", "0.5756933" ]
0.0
-1
Whether or not the artist has a YouTube channel or account.
def youtube?; youtube.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube_profile?\n @network = current_user.network ||= Network.new\n !(@network.youtube.nil? || @network.youtube.blank?)\n end", "def channel?\n self.channel_referent_id > 0\n end", "def can_create_playlist?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def is_channel_page?\n (channel && !category && !article)\n end", "def saisoku?\n !!title.first_channel.match(channel_name)\n end", "def is_subscribed?(user)\n fan_channel_id_youtube = self.channel_id_youtube\n subscriber = user.subscribers.find_by(channel_id_youtube: fan_channel_id_youtube)\n sub_status = subscriber.nil? ? false : subscriber.is_subscribed # if subscriber exists in db, we show his status, else it's false anyway\n return sub_status\n end", "def youtube?\n\t\treturn path && path.starts_with?(\"stoffi:track:youtube:\")\n\tend", "def channel?\n not query?\n end", "def teamchat?\n return @teamchat\n end", "def synced_with_lastfm?\n lastfm_username.present?\n end", "def is_subscribed_to?(channel)\n Subscription.where(:subscriber_id => self.id, :channel_id => channel.id).exists?\n end", "def isFollowable?\n isTwitter? || isCompany?\n end", "def can_publish?\n !user.discourse_username.empty?\n end", "def connected_to_twitter?\n twitter_token && twitter_secret\n end", "def playing?\n !current_category.nil?\n end", "def can_button?\n\t\tprovider.in? [\"twitter\", \"google_oauth2\"]\n\tend", "def tw_authorized?\n self.tw_access_token.present? & self.tw_access_token_secret.present?\n end", "def twitter?\n self.twitter_token && self.twitter_secret\n end", "def teaser_celebrity?\n true if twitter_followers && twitter_followers > 1000 || youtube_subscribers && youtube_subscribers > 1000 || instagram_followers && instagram_followers > 1000\n end", "def user_is_producer_of_channel?(channel_id)\n logged_in? && current_user.login == THUMBWEBS_AUTHORIZED_USER\nend", "def artist?\n end", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def twitter?\n self.provider == 'twitter'\n end", "def can_listen?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def course_owner?(course)\n tutor? && current_user?(course.tutor)\n end", "def twitter?\n provider_name == 'Twitter'\n end", "def peer_auditor_checked?\n !(self.auditor_result == 'None' || self.auditor_result == 'Comment')\n end", "def can_watch?(song)\n song.open? ||\n song.closed? && authenticated? ||\n authenticated? && @current_user.played?(song)\n end", "def yahoo?\n provider_name == 'Yahoo!'\n end", "def in_use?\n published? || has_answers? || has_choices?\n end", "def bot_user?\n [email protected]?\n end", "def slack_ok?\n ENV['SLACK_API_TOKEN'] && ENV['SLACK_FIXITY_CHANNEL']\n end", "def is_subscribable?\n is_partner_subscription? || is_premium_subscription?\n end", "def is_playlist\n return @play_list != nil\n end", "def logged_in?\n !current_player.nil?\n end", "def logged_in?\n !current_player.nil?\n end", "def auth?\n me != nil\n end", "def team_account?\n account_type == 'team'\n end", "def omniauth?\n provider? && uid?\n end", "def twitter?\n false\n end", "def twitter_profile?\n @network = current_user.network ||= Network.new\n !(@network.twitter.nil? || @network.twitter.blank?)\n end", "def course_activity?\n self.strategy.class.name == \"CourseStrategy\"\n end", "def discussions?\n !!user && user.admin?\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def isTwitter?\n self.category =~ /(tweet|twitter|suggested)/i\n end", "def github_account?\n !github_user.nil? and !github_token.nil?\n end", "def has_played?\n stats != nil\n end", "def is_attending? course\n exams.for_course(course).attending.present?\n end", "def user_can_access_channel\n return @channel.is_accessible_by(current_user) if @channel\n return @video.channel.is_accessible_by(current_user) if @video\n end", "def consent_activity?\n @activity_type.to_s.include? \"Consent\"\n end", "def track?\n type == \"track\"\n end", "def twitter_register_enabled?\n Figaro.env.respond_to?(:twitter_key) && Figaro.env.respond_to?(:twitter_secret)\n end", "def email_required?\n provider != 'twitter'\n end", "def oauth2_connected?\n self.send(:\"#{self.class.oauth2_uid_field}\").present?\n end", "def available?\n online? and (presence.show == nil or presence.show == :chat)\n end", "def peer_auditor_issue?\n self.auditor_result == 'Comment'\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 CA_only?\n course_assistant? && (not instructor?)\n end", "def channel?(str)\n prefixes = Regexp.escape(server_type.channel_prefix.keys.join)\n str.match(\"[#{prefixes}]#{CHANNEL_REGEX}\") != nil\n end", "def trackable?\n published?\n end", "def can_follow?(username)\n @config['twitter']['follows?'] == 'all' || @owner.nil? || username == @owner || twitter.friendship?(username, @owner)\n end", "def CA_only?\n course_assistant? && !instructor?\n end", "def can_donate?\n\t\tprovider.in? [\"facebook\", \"twitter\"]\n\tend", "def can_share?\n\t\tprovider.in? [\"facebook\", \"twitter\", \"lastfm\"]\n\tend", "def sauce?\n !!(sauce_user && sauce_key)\nend", "def twitter_login?\n\t\tself.uid ? true : false\n\tend", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def active_subscription?\n managers.map(&:subscribed?).include?(true) || managers.map(&:active_trial?).include?(true) ? true : false\n end", "def participates?(user)\n author == user || receiver == user\n end", "def subscribed_on_comments? user\n s = subscription_on_comments user\n if s\n return s.subscribed?\n else\n false\n end\n end", "def logged_in?\n @current_player.is_a?(Player)\n end", "def fb_connected?\n fb_user_id.present?\n end", "def lastfm_user?(user)\n lastfm_users.any? { |lastfm| lastfm.user_id == user.try(:id) }\n end", "def about_knowhow?\n category == \"knowhow\"\n end", "def can_talk?\n muted = !!redis(\"get\", \"chat:mute:#{@name}\")\n banned = !!redis(\"get\", \"ban:#{@id}\")\n\n !(muted || banned || @id == 0)\n end", "def mailchimp?\n Object.const_defined?('TradoMailchimpModule') ? true : false\n end", "def omniauth?\n !!@omniauth\n end", "def tutor?\n return logged_in? && (current_user.class == Tutor)\n end", "def create_playlist?\n\t\t!Rails.env.development? and do_create_playlist && can_create_playlist?\n\tend", "def bot?\n bot.bot?\n end", "def following? subject\n has_event? 'follow', subject\n end", "def subscribed?\n self.subscription == :subscribed\n end", "def is_author?\n Response.joins(question: :poll).where(\"polls.user_id = ?\", self.user_id).exists?\n end", "def check_accounts\n\t\t( @participant.facebook_account != nil && @participant.facebook_account != \"\" ) ||\n\t\t( @participant.twitter_account != nil && @participant.twitter_account != \"\" ) ||\n\t\t( @participant.github_account != nil && @participant.github_account != \"\" ) ||\n\t\t( @participant.google_plus_account != nil && @participant.google_plus_account != \"\" )\n\tend", "def check_subscription\n !subscribed || subscription_present?\n end", "def twitter_user?\n return true if is_logged_in? && (session[:request_token] && session[:request_token_secret] && session[:twitter_id])\n end", "def can_follow?(m = nil)\n #logged_in? and ((current_member.has_role_or_above?(:staff) || current_member.in_group?(:betatest))\n logged_in? && @local_site.nil? # No follows for guests or on local sites (yet)\n end", "def certified?\n @data['certifiedBot']\n end", "def subscribed?\n self.type == :subscribed\n end", "def has_embed_permission?\n return get_bot_profile.permission?(:embed_links, command.event.channel)\n end", "def logged_in?\n !current_teacher.nil?\n end", "def logged_in?\n !current_teacher.nil?\n end", "def media_company?\n \tperson.profile.type == 'MediaCompany' \t\n end", "def valid_credentials?\n return false unless api_key?\n !activities.all.nil?\n rescue Rescuetime::Errors::InvalidCredentialsError\n false\n end", "def connected?\n !!@access_token\n end", "def private?\n !@data[:channel]\n end", "def has_blog?\n account.present? && account.name\n end", "def following?(tw_user)\n following.include?(tw_user)\n end", "def have_account?\n false\n end" ]
[ "0.7261143", "0.6680515", "0.6515102", "0.6475191", "0.64641774", "0.6455055", "0.6426753", "0.6401424", "0.63345796", "0.62370646", "0.6187834", "0.6182416", "0.6173086", "0.6169877", "0.6149597", "0.61388993", "0.61136377", "0.61076677", "0.60579914", "0.6057299", "0.6053143", "0.6043388", "0.601514", "0.60115147", "0.60066134", "0.5999157", "0.5997011", "0.5987479", "0.59822404", "0.5974785", "0.5966306", "0.5961367", "0.59542614", "0.5951105", "0.5940475", "0.5940475", "0.5939686", "0.59346926", "0.59319514", "0.5929535", "0.5903931", "0.58981603", "0.5890563", "0.5887314", "0.5882685", "0.58787614", "0.5846361", "0.5842326", "0.58374286", "0.58314055", "0.58307886", "0.5827722", "0.5827457", "0.5814241", "0.5808573", "0.5800942", "0.5789353", "0.57838804", "0.5782571", "0.578158", "0.57764983", "0.5762042", "0.5743318", "0.57422525", "0.574064", "0.5736824", "0.57334346", "0.57334346", "0.57265645", "0.57238615", "0.571917", "0.5705819", "0.57051104", "0.570124", "0.5685764", "0.5679802", "0.56743485", "0.56736076", "0.5668322", "0.5666942", "0.5663808", "0.56516814", "0.56309736", "0.5629218", "0.5627621", "0.5627187", "0.5625751", "0.56228524", "0.5620012", "0.5613237", "0.5609012", "0.5605201", "0.5605201", "0.56022054", "0.55999523", "0.5598266", "0.5595896", "0.5591292", "0.5588177", "0.5585468" ]
0.6320596
9
Whether or not the artist has a SoundCloud account.
def soundcloud?; soundcloud.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticated?\n !account.nil?\n end", "def have_account?\n false\n end", "def exists?\n username && api_key\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def requested_account_authorized?\n session[:_bookingsync_account_id].blank? ||\n session[:_bookingsync_account_id] == session[:account_id]\n end", "def soundcloud?\n\t\treturn path && path.starts_with?(\"stoffi:track:soundcloud:\")\n\tend", "def is_owner?(account)\n attachable == account.profile\n end", "def omniauth?\n provider? && uid?\n end", "def authenticable?\n Chimps.config[:catalog][:key] && Chimps.config[:catalog][:secret]\n end", "def signed_in?\n !!@me\n end", "def added_fb_account?\n !self.external_user_id.nil?\n end", "def github_account?\n !github_user.nil? and !github_token.nil?\n end", "def signed_in?\n\t\t!current_customer.nil?\n\tend", "def synced_with_lastfm?\n lastfm_username.present?\n end", "def logged_in?\n\t\t!current_account.nil?\n\tend", "def sauce?\n !!(sauce_user && sauce_key)\nend", "def affiliates_enabled?\n affiliate_account_types.present?\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 authenticating_with_facebook?\n !authenticating_with_unauthorized_record? && self.facebook_api_keys_provided? && self.raw_cookie\n end", "def isAuthorized? account\n return true if current_user.admin?\n house = House.where(:account => account)\n return false if (house.nil || current_user.tenantOnly?)\n end", "def available?\n begin\n head(\"v1/account/#{@email}\")\n return false\n rescue JustGiving::NotFound\n return true\n end\n end", "def logged_in?\n !current_account.nil?\n end", "def logged_in?\n !current_account.nil?\n end", "def logged_in?\n !current_account.nil?\n end", "def current_account_has_username?\n logged_in? && current_account.username.present?\n end", "def exists_on_cloud?(name)\n ret_val = @connection.query_azure(\"storageservices/#{name}\")\n error_code, error_message = error_from_response_xml(ret_val) if ret_val\n if ret_val.nil? || error_code.length > 0\n Chef::Log.warn 'Unable to find storage account:' + error_message + ' : ' + error_message if ret_val\n false\n else\n true\n end\n end", "def current_account?(account)\n\t\taccount == current_account\n\tend", "def auth?\n me != nil\n end", "def subscribed?(u)\n @clients.has_key?(u.signature)\n end", "def account_exists?(email)\n dealer_dao.account_exists?(email)\n end", "def exists?(name)\n return @azure_storage_accounts.key?(name) if @azure_storage_accounts\n self.exists_on_cloud?(name)\n end", "def logged_in?\n\t !current_merchant.nil?\n\tend", "def linked_github_account?\n accounts.for(\"github\").any?\n end", "def personal_account?\n account_type == 'personal'\n end", "def is_owner?(xaccount:)\n # DRAFT and creator means owner\n return true if publication.is_draft? && publication.current_version.is_creator?(xaccount: xaccount)\n\n # Author means owner\n return true if publication.current_version.is_author?(xaccount: xaccount)\n\n # All others are not owners\n false\n end", "def artist?\n end", "def secretary?\n ASF::Service.find('asf-secretary').members.include? self\n end", "def ftp_account_exists?(username)\n ftp_account = ::Proftpd::FtpAccount.find_by_username(username)\n !ftp_account.nil?\n end", "def has_blog?\n account.present? && account.name\n end", "def logged_in?\n current_account != :false && current_account.active?\n end", "def in_aws_account?(*accts)\n return false if self.quiescent?\n return false unless self['ec2']\n\n accts.flatten!\n accts.include?(self['ec2']['account_id'])\n end", "def authenticated?\n !!(session['cas'] && session['cas']['user'])\n end", "def current_account?(account)\n account == current_account\n end", "def current_account?(account)\n account == current_account\n end", "def signed_in?\n !!@modhash and !!@cookie\n end", "def authorized?\n user_account.authorized?(app_keypair)\n end", "def authenticated_with_twitter_list?\n twitter_client.authorized? && list_members(twitter_client).include?(twitter_client.info['screen_name'])\n end", "def member_logged_in?\n !current_library_member.nil?\n end", "def refactorial_account?\n # Search for this account name\n !get_account.nil?\n end", "def account_customer_info?\n !current_customer.nil?\n end", "def logged_in?\n !current_company.nil?\n end", "def user_is_store_owner?\n (user_signed_in? && current_user.is_store_owner?)\n end", "def omniauth?\n !!@omniauth\n end", "def oauth2_connected?\n self.send(:\"#{self.class.oauth2_uid_field}\").present?\n end", "def authorisation?\n event_code == AUTHORISATION\n end", "def already_exists?(irc_authname)\n Player.filter(:irc_authname => irc_authname).select(:irc_authname).any?\n end", "def already_exists?(irc_authname)\n Player.filter(:irc_authname => irc_authname).select(:irc_authname).any?\n end", "def can_create_playlist?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def ready?\n self.class.ready?(@cloud_id, credentials: @credentials)\n end", "def from_omniauth?\n uid.present? && provider.present?\n end", "def twitter_login?\n\t\tself.uid ? true : false\n\tend", "def account_has_service?(service)\n account = Account.find(current_user)\n account.service?(service)\n end", "def logged_in?\n account_signed_in?\n end", "def authorized?\n if Vermonster::Client.connection.get(\"me\").status == 200\n true\n else\n false\n end\n end", "def pubmed_available?\n !ENV['NCBI_API_KEY'].nil?\n end", "def logged_in?\n hubssolib_logged_in?\n end", "def koala_auto_create_account?\n self.koala_auto_create_account\n end", "def user_signed_in?\n api_current_user.present?\n end", "def application_credentials?\n !!application_credentials\n end", "def authenticated?\n not @access_token.nil?\n end", "def logged_in?\n current_profile != nil\n end", "def vendor_user?\n \treturn self.user_category == \"vendor\"\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def has_connection_with(provider)\n auth = self.authorizations.where(provider: provider).first\n if auth.present?\n auth.token.present?\n else\n false\n end\n end", "def available?\n Spotify.album_is_available(pointer)\n end", "def cas_authed?\n !session[:cas_user].blank?\n end", "def managed?\n stripe_account_type == 'managed'\n end", "def sauce?\n !!(@user && @key && @host && @port)\n end", "def tw_authorized?\n self.tw_access_token.present? & self.tw_access_token_secret.present?\n end", "def logged_in?\n \t\t!current_tenant.nil?\n \tend", "def has_auth?\n !current_person.nil?\n end", "def cloud?(node = __getnode)\n # cloud is always present, but nil if not on a cloud\n !node[\"cloud\"].nil?\n end", "def checked_in_facebook?\n if user_signed_in?\n identity = Identity.where(user_id: current_user.id)\n return true if identity.count == 1\n end\n false\n end", "def has_oauth_credentials?\n return false if @configuration.nil?\n RightSignature2013::Connection.oauth_keys.each do |key| \n return false if @configuration[key].nil? || @configuration[key].match(/^\\s*$/)\n end\n\n return true\n end", "def can_share?\n\t\tprovider.in? [\"facebook\", \"twitter\", \"lastfm\"]\n\tend", "def customer_logged_in?\n !current_customer.nil?\n end", "def fb_connected?\n fb_user_id.present?\n end", "def user_signed_in?\n current_auth0_user.present?\n end", "def authenticated?\n session['cas'] && session['cas']['user']\n end", "def team_account?\n account_type == 'team'\n end", "def signed_in?\n %W( Client expiry uid access-token ).each do |header|\n return false unless response.headers.include?(header)\n end\n return true\n end", "def logged_in?\n current_user.is_a? Socio\n end", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def has_public_profile?\n is_visible? && (show_profile == Visibility::PUBLIC)\n end", "def takendown?\n author_linked_account_id && Takedown.linked_account_id_has_takedown?(author_linked_account_id)\n end", "def can_view_account\n if @account\n if !current_contact.share_cases?(@account)\n render :text => \"You are not authorized to view this account.\"\n return true\n end\n end\n end", "def is_account_holder?\n roles.any? { |r| r.title == 'account_holder' }\n end", "def logged_in?\n !current_player.nil?\n end", "def logged_in?\n !current_player.nil?\n end", "def application_authenticated?\n !!(@client_id && @client_secret)\n end" ]
[ "0.6580212", "0.6580122", "0.6562841", "0.64347655", "0.6365917", "0.6338749", "0.6310865", "0.62977666", "0.6275363", "0.62323636", "0.6208647", "0.62073606", "0.6184435", "0.61780274", "0.61722827", "0.6164392", "0.6163724", "0.61619776", "0.6153361", "0.61397606", "0.6125472", "0.6121872", "0.6121872", "0.6121872", "0.60772854", "0.607313", "0.60606056", "0.6057423", "0.60409683", "0.6039892", "0.6026326", "0.60039204", "0.6000791", "0.5998216", "0.59978175", "0.599555", "0.59904945", "0.5990318", "0.59817296", "0.5981721", "0.5975853", "0.5971946", "0.5969527", "0.5969527", "0.5964576", "0.59582275", "0.59580266", "0.59563756", "0.5955107", "0.5950361", "0.59391826", "0.5938078", "0.5936963", "0.5933766", "0.59177595", "0.5916255", "0.5916255", "0.5915619", "0.59034544", "0.58991545", "0.5897972", "0.58976334", "0.5894714", "0.58933246", "0.58911556", "0.589112", "0.5883584", "0.5878933", "0.58779585", "0.5875673", "0.58693093", "0.5868539", "0.5867652", "0.5867652", "0.58642477", "0.5861137", "0.5853385", "0.58455265", "0.5841598", "0.58400905", "0.5839501", "0.5839405", "0.5836085", "0.5835089", "0.58260345", "0.5816959", "0.5815043", "0.5802076", "0.5790072", "0.578854", "0.57851917", "0.57804734", "0.5772599", "0.57670015", "0.575987", "0.57536125", "0.57527155", "0.57515794", "0.57515794", "0.575141" ]
0.59287435
54
Whether or not the artist has a Spotify presence.
def spotify?; spotify.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def artist?\n end", "def has_track_with_id(spotify_id)\n self.tracks.exists?(spotify_id: spotify_id)\n end", "def speaker?\n !self.speaker_on.empty?\n end", "def has_song?(song)\n songs.include?(song)\n end", "def has_essay?\n essay != nil\n end", "def exists?\n system = Sonos::System.new\n speaker = system.speakers.select { |s| s.name.downcase == @resource[:name].downcase }\n present = false\n if speaker.size < 1\n fail(\"Speaker #{resource[:name]} not associated to network?\")\n else\n if speaker[0].get_player_state[:state] == 'PLAYING'\n present = true\n end\n end\n\n present\n end", "def available?\n Spotify.album_is_available(pointer)\n end", "def track?\n type == \"track\"\n end", "def have_sip_device?\n self.sip_devices and self.sip_devices.size.to_i > 0\n end", "def liking?(song)\n likes.include?(song)\n end", "def is_music?\n @status\n end", "def has_played?\n stats != nil\n end", "def favorited? subject\n has_event? 'favorite', subject\n end", "def partner_staff?\n staff? && agencies.any? { |a| a.partner? }\n end", "def booked?\n meetup = Model::MEETUPS.first\n meetup[\"speakers\"].size > 1\n end", "def synced_with_lastfm?\n lastfm_username.present?\n end", "def participating?(micropost)\n\tif micropost.present?\n\t\treturn !participations.find_by_micropost_id(micropost.id).nil?\n\tend\n end", "def has_participations?\n participations.any?\n end", "def is_qualified?\n if self.photo.present? and self.skill_ids.count > 0\n return true\n else\n return false\n end\n end", "def online?\n @presence && @presence.type == nil\n end", "def following?(river)\n favorites.include?(river)\n end", "def played?\n\t\treturn @played\n\tend", "def following_stream?(stream)\n return favorites.streams.pluck(:favable_id).include?(stream.id)\n end", "def presence\n object.presence\n end", "def following_profile?(profile)\n return favorites.streams.where(favable_id: profile.stream_ids).count > 0\n end", "def is_tracked?(request)\n tracks.any? do |_name, track|\n track.matched_by?(request)\n end\n end", "def is_playlist\n return @play_list != nil\n end", "def presence\n self if present?\n end", "def presence\n self if present?\n end", "def includes? track\n\t\[email protected]? track\n\tend", "def following? subject\n has_event? 'follow', subject\n end", "def fireplace_present?\n $structures.any?{|structure| structure.is_a? Fireplace }\n end", "def someone_won?\n !!winnning_marker\n end", "def has_sound?\n @has_sound = if @movie_info[:format][:nb_streams] == 1\n false\n elsif @movie_info[:format][:nb_streams] == 2\n true\n end\n end", "def secretary?\n ASF::Service.find('asf-secretary').members.include? self\n end", "def sports?\n userPreference.sports?\n end", "def audio?\n @descriptive_detail.audio?\n end", "def favoring?(article)\n favorites.include?(article)\n end", "def favorited_tweet?(tweet)\n favorite_tweets.include? tweet\n end", "def include?(p_artist)\n\n\t\t\t# Check parameter\n\t\t\treturn unless p_artist.is_a? Artist\n\t\t\t\n\t\t\t# Return result\n\t\t\[email protected]?(p_artist)\n end", "def qualify?\n @qualify\n end", "def opinion_show_poll?\n\t\t\tbegin\n\t\t\t\t!opinion_user.nil?\n\t\t\trescue NoMethodError\n\t\t\t\tfalse\n\t\t\tend\n\t\tend", "def in_playlist?\n return false if self.new_record?\n !self.position.blank?\n end", "def present?\n exists? && visible?\n end", "def saisoku?\n !!title.first_channel.match(channel_name)\n end", "def is_favoritable?\n true\n end", "def is_favorite?\n\t favorite?\n\tend", "def trackable?\n published?\n end", "def has_audio?\n return !!get_audio\n end", "def on_saling?\n return false if flash_sale_detail_id.nil?\n\n !FlashSaleDetail.find_by(id: flash_sale_detail_id).nil?\n end", "def auditor_verified?\n AUDITOR_COMPLETE_RESULTS.include?(self.auditor_result)\n end", "def has_track(player_data, direction)\n return false\n end", "def has_track(player_data, direction)\n return false\n end", "def subscribed?\n self.friendship_status > 0\n end", "def favorite?\n @favorite\n end", "def has_hands\n return @hands.select{|hands| hands.status == HandStatus::PLAY} != []\n end", "def is_officer?\n self.officer_position.to_sym != :no_position\n end", "def femme?\n identified? && sexe == 'F'\n end", "def audio?\n @streams.any? { |stream| stream.is_a? AudioStream }\n end", "def has_future_participations?\n future_participations = []\n \n participations.each do |participation|\n\t current_micropost = participation.micropost\n\t\n if current_micropost.time && current_micropost.time.future?\n return true\n end\n end\n \n return false\n end", "def has_shifts?(audience)\n audience ? !shifts.for(audience).empty? : !shifts.empty?\n end", "def playing?\n connection.write(\"is_playing\", false) == \"1\"\n end", "def playing?\n connection.write(\"is_playing\", false) == \"1\"\n end", "def playing?\n connection.write(\"is_playing\", false) == \"1\"\n end", "def tracks?(entity)\n if entity.is_a?(Sociographer::Entity)\n # @@neo = Neography::Rest.new\n self_node = self.get_node\n tracked_node = entity.get_node\n if self_node && tracked_node\n self_node.outgoing(:friends).map{|u| u}.include?(tracked_node)\n else\n false\n end\n else\n false\n end\n end", "def loaded?\n Spotify.album_is_loaded(pointer)\n end", "def favoriter?\n true\n end", "def empty?\n @artists.empty?\n end", "def saq_activity?\n @activity_name.to_s =~ /SAQ$/\n end", "def soundcloud?\n\t\treturn path && path.starts_with?(\"stoffi:track:soundcloud:\")\n\tend", "def has_results?\n meeting_individual_results.has_points(:goggle_cup_points).exists?\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def audio?\n has_stream_of :audio\n end", "def has_stock(ticker)\n found_stock = false\n @stocks.each do |item|\n if item.ticker == ticker\n found_stock = true\n end\n end\n found_stock\n end", "def exists?()\n\t\t\treturn @metadata.exists?\n\t\tend", "def has_honors\n if @gpa >= 3.5\n return true\n end\n return false\n end", "def has_team?\n has_team.nil? ? (position.present? && Position.where(position_id: position.id).exists?) : has_team\n end", "def can_create_playlist?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def is_track_value\n return ( 'tracks' == @top_level_key ) && [\n '/plist/dict/dict/dict/integer',\n '/plist/dict/dict/dict/string',\n '/plist/dict/dict/dict/true',\n '/plist/dict/dict/dict/false',\n '/plist/dict/dict/dict/date'\n ].any? { |bc|\n @breadcrumb === bc\n }\n end", "def favoriter?\n false\n end", "def plays?(sport)\n self.player_sports.\n where(:sport_id => sport.id).\n present?\n end", "def playing?\n self.play_start != nil\n end", "def oversight_staff?\n staff? && agencies.any? { |a| a.oversight? }\n end", "def can_watch?(song)\n song.open? ||\n song.closed? && authenticated? ||\n authenticated? && @current_user.played?(song)\n end", "def is_artist_page?(p)\n\t\treturn false unless p && p.content && p.categories && p.title\n\t\tbelongs_to_categories? p, [\n\t\t\t\"musicians\",\n\t\t\t\"artists\",\n\t\t\t\"duos\",\n\t\t\t\"groups\",\n\t\t\t\"singers\",\n\t\t\t\"guitarists\",\n\t\t\t\"gitarrister\",\n\t\t\t\"sångare\",\n\t\t\t\"grupper\",\n\t\t\t\"musiker\"\n\t\t], true\n\tend", "def universal_visibility?\n self.visibility == :universal\n end", "def has_offsite_holdings?\n return false unless self[:location_facet].present?\n\n # string regexp against the location field\n self[:location_facet].each do |location_facet|\n return true if location_facet =~ /^Offsite/\n return true if location_facet =~ /ReCAP/i\n # (this should not really happen)\n return true if location_facet =~ /scsb/i\n end\n\n # No offsite location found\n false\n end", "def podcast?\n podcast = false\n self.items.each do |item|\n item.enclosures.each do |enclosure|\n podcast = true if enclosure.audio?\n end\n end\n return podcast\n end", "def smokes?\n userPreference.smokes?\n end", "def played?\n winner.present?\n end", "def is? var\n !!screen_names.detect { |sn| sn.is?(var) }\n end", "def present?\n true\n end", "def needs_followup?\n followup_note_count && followup_note_count > 0\n end", "def tracked?\n\t\treturn !self.not_tracked?\n\tend", "def vital?\n return @peer.vital?\n end", "def streaming?\n @descriptive_detail.streaming?\n end", "def is_favorite_of user\n\t fave = get_favorite_for user\n\t fave ? true : false\n\tend", "def has_ta_for_marking?\n ta_memberships.count > 0\n end", "def has_onsite_holdings?\n return false unless self[:location_facet].present?\n\n # consider each location for this record....\n self[:location_facet].each do |location_facet|\n # skip over anything that's offsite...\n next if location_facet =~ /^Offsite/\n next if location_facet =~ /ReCAP/i\n\n # skip over Online locations (e.g., just links)\n next if location_facet =~ /Online/i\n\n # If we got here, we found somthing that's onsite!\n return true\n end\n\n # If we dropped down to here, we only found offsite locations.\n false\n end", "def squishy?\n\n # Methods like this are for storing CODE\n # rather than simple values - so if you\n # need to run some code to get an answer\n # about the properties of a model object,\n # this is the place to put it\n\n # This answer 'true' will apply to ALL Pears\n true\n end" ]
[ "0.6704451", "0.6697281", "0.66919917", "0.66657716", "0.66538143", "0.64946294", "0.64104366", "0.6219673", "0.6211889", "0.61940783", "0.6171543", "0.61488086", "0.60517704", "0.6046949", "0.6045938", "0.6020353", "0.5998667", "0.59777397", "0.5945749", "0.5937926", "0.5919896", "0.5907749", "0.59036356", "0.5888453", "0.58632505", "0.5860112", "0.58253866", "0.58231694", "0.58231694", "0.5817237", "0.5816618", "0.58078384", "0.5803695", "0.5798877", "0.5791075", "0.5779379", "0.5757823", "0.5748991", "0.57303566", "0.57226974", "0.5719805", "0.5718717", "0.57148486", "0.5714157", "0.57085276", "0.5707269", "0.57056713", "0.5702841", "0.5695539", "0.5689102", "0.56824774", "0.56761134", "0.56761134", "0.5669229", "0.56590295", "0.565372", "0.5653327", "0.56526434", "0.5645609", "0.56454664", "0.5645309", "0.5639057", "0.5639057", "0.5639057", "0.562777", "0.5618995", "0.56163603", "0.5612422", "0.56121844", "0.56101346", "0.5607925", "0.56056905", "0.5604829", "0.560182", "0.5592472", "0.5588086", "0.55874133", "0.55853164", "0.5583073", "0.5582682", "0.5581503", "0.55810034", "0.5579227", "0.55784476", "0.55683416", "0.55605435", "0.5557373", "0.5553429", "0.5553168", "0.55528194", "0.5541877", "0.5538981", "0.5536836", "0.5536537", "0.5529119", "0.55241746", "0.5521577", "0.5521517", "0.5521418", "0.5519861" ]
0.60533273
12
Whether or not the artist has a Last.fm presence.
def lastfm?; lastfm.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def synced_with_lastfm?\n lastfm_username.present?\n end", "def artist?\n end", "def lastfm_user?(user)\n lastfm_users.any? { |lastfm| lastfm.user_id == user.try(:id) }\n end", "def speaker?\n !self.speaker_on.empty?\n end", "def is_music?\n @status\n end", "def following? subject\n has_event? 'follow', subject\n end", "def has_sound?\n @has_sound = if @movie_info[:format][:nb_streams] == 1\n false\n elsif @movie_info[:format][:nb_streams] == 2\n true\n end\n end", "def needs_followup?\n followup_note_count && followup_note_count > 0\n end", "def has_song?(song)\n songs.include?(song)\n end", "def has_future_participations?\n future_participations = []\n \n participations.each do |participation|\n\t current_micropost = participation.micropost\n\t\n if current_micropost.time && current_micropost.time.future?\n return true\n end\n end\n \n return false\n end", "def online?\n @presence && @presence.type == nil\n end", "def non_musical_sound_recording?\n marc_leader_06_match = record.leader.byteslice(6) == 'i'\n\n marc_006_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 'i'\n end\n\n return true if marc_leader_06_match || marc_006_match\n end", "def available?\n Spotify.album_is_available(pointer)\n end", "def has_essay?\n essay != nil\n end", "def booked?\n meetup = Model::MEETUPS.first\n meetup[\"speakers\"].size > 1\n end", "def participating?(micropost)\n\tif micropost.present?\n\t\treturn !participations.find_by_micropost_id(micropost.id).nil?\n\tend\n end", "def following_profile?(profile)\n return favorites.streams.where(favable_id: profile.stream_ids).count > 0\n end", "def has_played?\n stats != nil\n end", "def has_following?\n\t self.following_count > 0\n\tend", "def liking?(song)\n likes.include?(song)\n end", "def following_stream?(stream)\n return favorites.streams.pluck(:favable_id).include?(stream.id)\n end", "def music_recording?\n marc_leader_06_match = record.leader.byteslice(6) == 'j'\n\n marc_006_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 'j'\n end\n\n return true if marc_leader_06_match || marc_006_match\n end", "def audio?\n @descriptive_detail.audio?\n end", "def has_audio?\n return !!get_audio\n end", "def followers?\n following?\n end", "def has_followers?\n\t self.followers_count > 0\n\tend", "def available?\n online? and (presence.show == nil or presence.show == :chat)\n end", "def following?(friends)\n friends.find { |f| f[\"screen_name\"].casecmp(tname) == 0 }\n end", "def is_friend?\n @friended\n end", "def mountable?\n !!( mount_point && (self['mountable'].to_s != 'false') && (not in_raid?) )\n end", "def away?\n online? and (presence.show == :away or presence.show == :xa)\n end", "def focal_length?\n !focal_length.nil?\n end", "def empty?\n @artists.empty?\n end", "def exists?\n system = Sonos::System.new\n speaker = system.speakers.select { |s| s.name.downcase == @resource[:name].downcase }\n present = false\n if speaker.size < 1\n fail(\"Speaker #{resource[:name]} not associated to network?\")\n else\n if speaker[0].get_player_state[:state] == 'PLAYING'\n present = true\n end\n end\n\n present\n end", "def can_listen?\n\t\tprovider.in? [\"facebook\", \"lastfm\"]\n\tend", "def following?(tw_user)\n following.include?(tw_user)\n end", "def presence\n object.presence\n end", "def followed_by?(user)\n extension_followers.where(user: user).any?\n end", "def episode?\n content_type == \"Episode\"\n end", "def favorited? subject\n has_event? 'favorite', subject\n end", "def audio?\n has_stream_of :audio\n end", "def in_playlist?\n return false if self.new_record?\n !self.position.blank?\n end", "def finished?\n @episodes.last.watched?\n end", "def saisoku?\n !!title.first_channel.match(channel_name)\n end", "def following?(ministry)\n following.include?(ministry)\n end", "def asf_member?\n ASF::Member.status[name] or ASF.members.include? self\n end", "def mnf?\n\t\tgame = Game.find(game_id)\n\t\t(game.game_time.to_datetime.utc - 4.hours).monday? ? true : false\n\t\t# removing four hours so that SNF games don't show up as MNF games\n\t\t# which they would in utc time\n\tend", "def podcast?\n podcast = false\n self.items.each do |item|\n item.enclosures.each do |enclosure|\n podcast = true if enclosure.audio?\n end\n end\n return podcast\n end", "def following?(tribute)\n following.include?(tribute)\n end", "def audio?\n !!audio_stream\n end", "def family?\r\n infoxml = get_info\r\n \r\n if family = infoxml['family']\r\n return family == '1'\r\n end\r\n \r\n return false\r\n end", "def played?\n\t\treturn @played\n\tend", "def isFollowable?\n isTwitter? || isCompany?\n end", "def has_participations?\n participations.any?\n end", "def audio_without_closed_captions?\n audio? && closed_captions.blank?\n end", "def status_follow?()\n return true if (@status == TAC_PLUS_AUTHEN_STATUS_FOLLOW)\n return false\n end", "def audiobook?\n marc_leader_06_match = record.leader.byteslice(6) == 'i'\n marc_008_30_31_match = record.fields('008').find do |field|\n (%w[a b d e f h k m o p] & (field.value.byteslice(30..31) || '').scrub(' ').split('')).any?\n end\n\n marc_006_00_13_14_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 'i' &&\n (%w[a b d e f h k m o p] &\n (field.value.byteslice(13..14) || '').scrub(' ').split('')).any?\n end\n\n return true if (marc_leader_06_match &&\n marc_008_30_31_match) ||\n marc_006_00_13_14_match\n end", "def is_qualified?\n if self.photo.present? and self.skill_ids.count > 0\n return true\n else\n return false\n end\n end", "def has_userinfo?\n ImpURI.has_userinfo?(@uri)\n end", "def audio?\n @streams.any? { |stream| stream.is_a? AudioStream }\n end", "def has_played_since_last_update?\n @front_page = get_page(bungie_net_front_page_url)\n last_played = (@front_page/\"div.spotlight div \").inner_html.split(\"&nbsp; | &nbsp;\")[1].gsub(\"Last Played \", \"\").to_date\n return last_played > self.updated_at.to_date\n end", "def metadata?\n !!@metadata\n end", "def metadata?\n !!@metadata\n end", "def is_artist_page?(p)\n\t\treturn false unless p && p.content && p.categories && p.title\n\t\tbelongs_to_categories? p, [\n\t\t\t\"musicians\",\n\t\t\t\"artists\",\n\t\t\t\"duos\",\n\t\t\t\"groups\",\n\t\t\t\"singers\",\n\t\t\t\"guitarists\",\n\t\t\t\"gitarrister\",\n\t\t\t\"sångare\",\n\t\t\t\"grupper\",\n\t\t\t\"musiker\"\n\t\t], true\n\tend", "def loaded?\n Spotify.album_is_loaded(pointer)\n end", "def logged_in? # obj - nil\n\t\tcurrent_artist\n\tend", "def attending?(fun_event)\n if eu_rels.find_by(attended_id: fun_event).nil?\n false\n else\n eu_rels.find_by(attended_id: fun_event).checked_in?\n end\n end", "def twitter?\n false\n end", "def has_audios?\n audios[I18n.locale.to_sym].length + attached_audios[I18n.locale.to_sym].length > 0\n end", "def is_following?(listing)\n followed_listings.include?(listing)\n end", "def track?\n type == \"track\"\n end", "def should_be_offline?\n time_ago = (update_frequency.seconds * 4.8).ago\n # Provides leeway for new stations\n if created_at > time_ago\n return false\n end\n observations.since(time_ago).order(created_at: :desc).count < 3\n end", "def is_playlist\n return @play_list != nil\n end", "def subscribed?\n self.friendship_status > 0\n end", "def check_online?\n url = @record.fulltext_link[:url]\n # SFX URLs observed in the wild: owens.mit.edu/sfx_local,\n # sfx.mit.edu/sfx_local, library.mit.edu/?func=service-sfx\n url.present? && (\n @record.fulltext_link[:label] == 'Check SFX for availability'\n )\n end", "def ever_tracked?\n !!last_tracked_at\n end", "def avid?\n namespace.__avid_instances__.any? &method( :equal? )\n end", "def has_feed?\n !feed.nil?\n end", "def attending?\n user_id = current_user.id\n event_id = @event.id\n return (Attend.where(userID: user_id, eventID: event_id).empty?)\n end", "def following?\n Follow.where(follower_class: self.class.to_s, follower_id: id).count > 0\n end", "def last_name?\n last_name.present?\n end", "def followed?\n Follow.where(followee_class: self.class.to_s, followee_id: id).count > 0\n end", "def following?(river)\n favorites.include?(river)\n end", "def third_screen_visible?\n @third_screen_title.visible?\n end", "def secretary?\n ASF::Service.find('asf-secretary').members.include? self\n end", "def newly_published?\n !!@newly_published\n end", "def us_fulltext?\n self.any? { |item| item.us_availability == HathiTrust::Constants::FT }\n end", "def is_oral_history?\n genre && genre.include?(\"Oral histories\")\n end", "def favorited_tweet?(tweet)\n favorite_tweets.include? tweet\n end", "def presence\n self if present?\n end", "def presence\n self if present?\n end", "def fb_connected?\n fb_user_id.present?\n end", "def someone_won?\n !!winnning_marker\n end", "def see_ball?\n \tball.notSeenLongTime() < 5\n end", "def has_honors\n if @gpa >= 3.5\n return true\n end\n return false\n end", "def entertained?\n return (gladiators.map { |g| g.name }).include? \"Maximus\"\n end", "def publishable?\n [ UNPUBLISHED, OUT_OF_DATE ].include? flickr_status\n end", "def exists?()\n\t\t\treturn @metadata.exists?\n\t\tend", "def following?(band)\n following.include?(band.id)\n end", "def can_watch?(song)\n song.open? ||\n song.closed? && authenticated? ||\n authenticated? && @current_user.played?(song)\n end" ]
[ "0.74193984", "0.6500434", "0.6453162", "0.641817", "0.6268934", "0.61428946", "0.6078084", "0.6071122", "0.60555345", "0.6053814", "0.60133976", "0.5993804", "0.5990403", "0.59785444", "0.5969268", "0.5959378", "0.5919845", "0.5888771", "0.5870201", "0.586676", "0.58446467", "0.58411515", "0.5839451", "0.5824835", "0.58228326", "0.5805013", "0.5780512", "0.57439435", "0.574073", "0.5734382", "0.57312286", "0.5709968", "0.56923383", "0.56813705", "0.56801224", "0.56634194", "0.56561416", "0.5653291", "0.5646089", "0.56379515", "0.5635655", "0.5634516", "0.5627705", "0.5622253", "0.56205446", "0.56170493", "0.56145054", "0.56133896", "0.56112325", "0.5601573", "0.5594797", "0.559439", "0.558769", "0.5586236", "0.5578848", "0.55736417", "0.5572804", "0.5572403", "0.55686563", "0.55669546", "0.5563294", "0.5561531", "0.5561531", "0.55586666", "0.5557295", "0.5548757", "0.55444205", "0.554262", "0.5541008", "0.55231035", "0.5518851", "0.5515863", "0.5507321", "0.5506", "0.5498102", "0.54947346", "0.54894435", "0.54870933", "0.5478963", "0.54751956", "0.5471373", "0.54705095", "0.54640865", "0.5462664", "0.54597545", "0.54572624", "0.5443487", "0.5433015", "0.54287654", "0.5424886", "0.5424886", "0.54196435", "0.54150075", "0.54141676", "0.5410616", "0.54091346", "0.5401091", "0.53944665", "0.5390554", "0.5387752" ]
0.6694979
1
Whether or not the artist has a website.
def website?; website.to_s != "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_website?\n !url.blank?\n end", "def is_displayed_on_site?\n feed.feed_type.name == \"Article\"\n end", "def show_links?\n edata = extra_data\n bitvalue = edata[\"m_search_engines\"].to_i\n is_a_search_link_set = [1,2,4,8,16].map do |a| \n (bitvalue & a) > 0 ? 1 : nil \n end.compact.size > 0\n is_a_search_link_set || (edata[\"artist\"] &&\n !edata[\"artist\"][\"name\"].blank? &&\n !edata[\"artist\"][\"url\"].blank?)\n end", "def website_required?\n !using_open_id?\n end", "def scraped?\n !url.blank?\n end", "def source_noteworthy?\n source.present? && source != \"mo_website\"\n end", "def url?\n !urn?\n end", "def webpage_site?\n marc_leader_06_match = record.leader.byteslice(6) == 'a'\n marc_leader_07_match = %w[b i s].include?(record.leader.byteslice(7))\n marc_008_21_match = record.fields('008').find do |field|\n field.value.byteslice(21) == 'w'\n end\n\n marc_006_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 's' &&\n field.value.byteslice(4) == 'w'\n end\n\n return true if (marc_leader_06_match &&\n marc_leader_07_match &&\n marc_008_21_match) ||\n marc_006_match\n end", "def url?\n !url.nil?\n end", "def wikilink_available?\n wikilink && !wikilink.empty?\n end", "def off_site?(url)\n url !~ /^\\// # urls not starting with a /\n end", "def needs_seo (url)\n if url.description.nil? || url.keywords.nil?\n return true\n else\n return false\n end\nend", "def artist?\n end", "def check_online?\n url = @record.fulltext_link[:url]\n # SFX URLs observed in the wild: owens.mit.edu/sfx_local,\n # sfx.mit.edu/sfx_local, library.mit.edu/?func=service-sfx\n url.present? && (\n @record.fulltext_link[:label] == 'Check SFX for availability'\n )\n end", "def already_on_site?\n driver.current_url != 'about:blank' &&\n driver.current_url.include?(BASE_URL)\n end", "def g750_host? url\n return url.include? G750_HOST[:desktop]\n end", "def real_url?\n url && url.present? && url != \"#\"\n end", "def is_unknown_url? url\n @urls.count_documents(url:url) == 0\n end", "def about_link?\n\t\tself.external == false && self.link == 'about'\n\tend", "def accessed_from_website?\n res = false\n \n referer = request.env['HTTP_REFERER']\n unless referer.nil? || referer.match(\"^#{Conf.base_uri}\").nil?\n res = true\n end\n \n return res\n end", "def accessed_from_website?\n res = false\n \n referer = request.env['HTTP_REFERER']\n unless referer.nil? || referer.match(\"^#{Conf.base_uri}\").nil?\n res = true\n end\n \n return res\n end", "def accepts_outcome_url?\n accepted_outcome_types.member?('url')\n end", "def a_domain_we_care_about?(url)\n begin\n [email protected] { |domain| URI.parse(url).host == domain.host }.empty?\n rescue\n [email protected] { |domain| url.gsub(/https*:\\/\\//,'').starts_with?(domain.host) }.empty?\n end\n end", "def facebook_url_exists?\n return false if facebook == \"\" || twitter == nil\n return true\n end", "def pro?\n base_url =~ /invoc.us/\n end", "def has_github?\n !github_url.blank?\n end", "def cuisineaz_host? url\n return url.include? CUISINEAZ_HOST[:desktop]\n end", "def webmod?\n @data['webMod']\n end", "def online?\n Browser.get(url).code != 0\n end", "def is_static?\n self.url.blank?\n end", "def has_onsite_holdings?\n return false unless self[:location_facet].present?\n\n # consider each location for this record....\n self[:location_facet].each do |location_facet|\n # skip over anything that's offsite...\n next if location_facet =~ /^Offsite/\n next if location_facet =~ /ReCAP/i\n\n # skip over Online locations (e.g., just links)\n next if location_facet =~ /Online/i\n\n # If we got here, we found somthing that's onsite!\n return true\n end\n\n # If we dropped down to here, we only found offsite locations.\n false\n end", "def google?\n @domain.include?(:Google)\n end", "def is_site_compatible?(site_link, display)\n site = get_site(site_link)\n if site == nil\n puts 'Data error '.red + '(invalid website) :' + ' the website ' + site_link.yellow + ' is unmanaged' if display\n end\n site\n end", "def trackable?(uri)\n uri && uri.absolute? && %w(http https).include?(uri.scheme)\n end", "def internet_connection?\n begin\n true if open(\"http://www.google.com/\")\n rescue\n false\n end\n end", "def site_known?(site)\n\t\traise \"Web site store not loaded properly! \" if @known_sites.nil?\n\t\tsite=site.strip.downcase unless site.nil?\n\t\tsite=url_2_site(site)\n\t\treturn @known_sites.key?(site) unless site.nil?\n\trescue => ee\n\t\tputs \"Error checking web site #{site} against the site store: #{ee}\"\n\t\treturn false\n\tend", "def url?(url_hash)\n @@db.client[:urls].find(url_hash).any?\n end", "def has_appstore?\n !appstore_url.blank?\n end", "def secondary_url?\n case url\n when %r!pixiv\\.net/stacc!i\n true\n when %r!pixiv\\.net/fanbox!i\n true\n when %r!twitter\\.com/intent!i\n true\n when %r!lohas\\.nicoseiga\\.jp!i\n true\n when %r!(?:www|com|dic)\\.nicovideo\\.jp!i\n true\n when %r!pawoo\\.net/web/accounts!i\n true\n when %r!www\\.artstation\\.com!i\n true\n when %r!blogimg\\.jp!i, %r!image\\.blog\\.livedoor\\.jp!i\n true\n else\n false\n end\n end", "def irrelevant?\n video.nil? && manuscript.nil? && external_reference_link.blank?\n end", "def is_site?(url)\n\t\tputs \"Validate the website string format for: #{url}\" if @verbose\n\t\tbegin\n\t\t\turl=url.strip.downcase\n\t\t\tif is_url?(url)\n\t\t\t\tif url == url_2_site(url)\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\treturn false\n\t\t\t\tend\t\t\t\n\t\t\telse\n\t\t\t\tputs \"Unknown site format: #{url}\" if @verbose\n\t\t\t\treturn false\n\t\t\tend\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__}: #{ee}\" if @verbose\n\t\t\treturn nil\n\t\tend\n\tend", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def url?\n children[0] && children[0].is_a?(Url)\n end", "def social?\n @data['social'] != {}\n end", "def url?(url)\n assert_type(url, String) # This includes Wgit::Url's.\n hash = { 'url' => url }\n @client[:urls].find(hash).any?\n end", "def include?(url)\n @urls.empty? || [email protected]{ |u| u =~ url }\n end", "def site_enable?\n self[:type] == \"CompanyZ\" && !self.layout.architecture_type.nil?\n end", "def require_links?\n @require_links\n end", "def search_engine?\n @_se ||= (@platform == 'web' && browser.user_agent.match(/\\(.*https?:\\/\\/.*\\)/)) || params[:se] == '1'\n end", "def check_for_url(url)\n array = read_articles\n\n if array.any? {|article| article[\"url\"] == url}\n false\n else\n true\n end\nend", "def landing_page? \n landing_page.present? \n end", "def url?(link)\n true if link =~ /\\Ahttps?:\\/\\//\nend", "def marmiton_host? url\n return url.include?(MARMITON_HOST[:desktop]) || url.include?(MARMITON_HOST[:mobile])\n end", "def link_is_fulltext?\n @link_is_fulltext\n end", "def has_essay?\n essay != nil\n end", "def isFollowable?\n isTwitter? || isCompany?\n end", "def urlset?\n root_name == 'urlset'\n end", "def yahoo?\n provider_name == 'Yahoo!'\n end", "def website(input)\n\t(/((http|https)\\:\\/\\/)?(www)?(.+)(\\.[a-zA-Z]{2,3})+/i =~ input)? \"true\" : \"false\"\nend", "def visited?(url); end", "def vimeo?\n website.url.host =~ /vimeo/\n end", "def url_has_protocol(url) \n\treturn (url.include? \"http\") || (url.include? \"https\")\nend", "def valid_url?\n !Sailpoint.config.url.blank?\n end", "def invalid_url?(url)\n url.include? 'hurl.it'\n end", "def sitemap_urlset?\n sitemap_root_name == 'urlset'\n end", "def no_sites?\n self.proxy_performances.active.empty?\n end", "def is_artist_page?(p)\n\t\treturn false unless p && p.content && p.categories && p.title\n\t\tbelongs_to_categories? p, [\n\t\t\t\"musicians\",\n\t\t\t\"artists\",\n\t\t\t\"duos\",\n\t\t\t\"groups\",\n\t\t\t\"singers\",\n\t\t\t\"guitarists\",\n\t\t\t\"gitarrister\",\n\t\t\t\"sångare\",\n\t\t\t\"grupper\",\n\t\t\t\"musiker\"\n\t\t], true\n\tend", "def url?(url)\n assert_type(url, String) # This includes Wgit::Url's.\n query = { url: url }\n retrieve(URLS_COLLECTION, query, limit: 1).any?\n end", "def get_web_info_from_link(data, display)\n unless data[:link].start_with?('http://', 'https://')\n data[:link] = 'http://' + data[:link]\n end\n unless data[:link].end_with?('/')\n data[:link] += '/'\n end\n buff = data[:link].split('/')\n tmp_site = buff[2]\n data[:website] = is_site_compatible?(tmp_site, display)\n if data[:website] == nil\n return false\n end\n if data[:website][:to_complete] == ''\n data[:name] = buff[3]\n else\n data[:name] = buff[4]\n end\n data[:link] = data[:website][:link] + data[:website][:to_complete] + data[:name] + ((data[:website][:index_link_ends_with_slash]) ? '/' : '')\n true\n end", "def github_domain?\n !!domain.match(/\\.github\\.com$/)\n end", "def codwars?(url)\n /^(https?:\\/\\/)?([a-z]+\\.)*codwars\\.com([?\\/]|$)/ === url\nend", "def user_site?\n !Site::RESERVED.include? site_subdomain\n end", "def usable_link?(type, url)\n case type\n when :twitter\n # twitter users starting with _ (like _NapervilleIl) are weatherbugs\n # if the username does not start with _ it is a valid username\n (url.match(/^http:\\/\\/(?:www\\.)?twitter.com[^\\/]*\\/[^_]/)) && (! url.match(/\\/share|\\/goodies/))\n when :facebook\n url.match(/^http:\\/\\/(?:www\\.)?facebook.com/)\n else\n true\n end\n end", "def valid_target_url?\n return false unless cloud_info = cloud_info()\n return false unless cloud_info[:name]\n return false unless cloud_info[:build]\n return false unless cloud_info[:support]\n return false unless cloud_info[:version]\n true\n rescue\n false\n end", "def needs_SEO (description_contains_keywords , url_contains_keywords)\n if description_contains_keywords==true && url_contains_keywords==true\n return false\n else \n return true\n end \nend", "def internal_site?\n Site::RESERVED.include? site_subdomain\n end", "def isArticle?(url)\n\t\n\t# possible parameters:\n\t# page contains a date\n\nend", "def exists?\n # TODO: Expose window querying from driver\n url != ''\n end", "def remote?\n !(url =~ /^https?/).nil?\n end", "def belongs_to_this_website?(website)\n p = (self.parents.size > 0) ? self.parents.first : self\n p.belongs_to_this_brand?(website)# && (p.discontinued? || !(p.product_families & website.product_families).empty?)\n end", "def guessing?\n ! page.has_content?(\"Your Results\")\n end", "def url_provided?\n @url = params[:url]\n @url.present? && @url.strip\n end", "def url_filled?\n !url.blank?\n end", "def has_wiki?\n !!wiki_pages\n end", "def trackable?\n published?\n end", "def saisoku?\n !!title.first_channel.match(channel_name)\n end", "def is?(url)\n return true if url.match('https?://github\\.com/(.+)/(.+)')\n end", "def in_use?\n published? || has_answers? || has_choices?\n end", "def sierra_856_perfect?\n @url == self.proper.proper_856_content\n end", "def bloomingdales?(url = nil)\n not macys?(url)\n end", "def is_photo_link(link)\n\t\n\tif \t(link.include?(\"pinterest.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"flickr.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"deviantart.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"fotolog.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"shutterfly.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"panoramio.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"photobucket.com\") ) \n\t\treturn true;\n\tend\n\n\treturn false;\t\n\nend", "def facebook?\n self.kind == 'facebook'\n end", "def match?\n return false if parsed_url.nil?\n parsed_url.domain.in?(domains)\n end", "def has_hyperlink?\n HYPERLINK_HOOKS.each { |string|\n return true if self.include?(string)\n }\n false\n end", "def valid_link?(url)\n # GET or HEAD? Head is more friendly to the server, but some pages\n # May behave differently depending on HEAD or GET.\n HTTParty.head(url,\n verify: false, # don't verify ssl certs\n ).code == 200\n end", "def any_places?\n\t\ttwitter? or facebook? or googleplus? or myspace? or\n\t\tyoutube? or soundcloud? or spotify? or lastfm? or website?\n\tend", "def relevant_fulltext_link?(link)\n relevant_links.map { |x| link[:url].include?(x) }.any?\n end", "def episode?\n content_type == \"Episode\"\n end", "def about_knowhow?\n category == \"knowhow\"\n end", "def what_links_heres_ok?\n what_links_here_except_obsolete_combinations.empty?\n end" ]
[ "0.78435975", "0.6993461", "0.6976083", "0.6928762", "0.6921482", "0.6893517", "0.6882417", "0.66944975", "0.6683662", "0.6626746", "0.6567063", "0.6538847", "0.65360755", "0.652172", "0.64843476", "0.64735204", "0.645805", "0.6445146", "0.63952225", "0.6357893", "0.6357893", "0.63522774", "0.6295295", "0.62862533", "0.62805516", "0.6276163", "0.62483275", "0.6245257", "0.62250626", "0.61889654", "0.6186855", "0.6181315", "0.6177107", "0.6171692", "0.61633104", "0.6155429", "0.61523366", "0.61405253", "0.61391646", "0.61321825", "0.61199", "0.6116562", "0.6113471", "0.61114204", "0.6110844", "0.61056423", "0.6099827", "0.6090167", "0.6084563", "0.6081815", "0.6070797", "0.6068891", "0.6056115", "0.60540706", "0.60540015", "0.6052794", "0.60512334", "0.60477394", "0.6039574", "0.6023856", "0.60235906", "0.601454", "0.60108286", "0.6004796", "0.5999738", "0.5997606", "0.5996888", "0.59963316", "0.5977751", "0.5974538", "0.5972341", "0.59713054", "0.5969632", "0.596058", "0.59591156", "0.59460115", "0.59362376", "0.5931555", "0.59289575", "0.59224117", "0.5919388", "0.5901576", "0.58989197", "0.58982676", "0.5895817", "0.5893416", "0.58883375", "0.5884894", "0.58837754", "0.58813", "0.5878817", "0.58587265", "0.5857533", "0.58573294", "0.58567035", "0.58563817", "0.58554256", "0.5855005", "0.585054", "0.58426744" ]
0.7231332
1
The URL to the artist's Twitter account.
def twitter_url; "https://twitter.com/#{twitter}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url\n \"http://twitter.com/#{self.username}/statuses/#{self.twitter_id}\"\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def twitter_url(username)\n \"https://twitter.com/#!/#{username}\"\n end", "def base_url\n \"https://api.twitter.com\"\n end", "def tw_profile_url\n \"http://twitter.com/intent/user?user_id=#{tw_user_id}\"\n end", "def main_url\n return nil unless twitter\n \"http://twitter.com/#{twitter.downcase}\"\n end", "def url\n \"http://twitter.com/#{attribute_get(:username)}/statuses/#{attribute_get(:id)}\"\n end", "def author_url\n @author_url ||= begin\n \"http://twitter.com/#{self.author_screenname}\" if self.author_screenname\n end\n end", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def share_on_twitter_url(object)\n url = member_url([@tier, @topic, object])\n title = object.title\n \"http://twitter.com/home?status=#{url}\"\n end", "def twitter_url(json)\n \"http://twitter.com/#{json['from_user']}/status/#{json['id']}\"\n end", "def twitter_link(player)\n if player.twitter_screen_name\n # clean up any bad characters in a player's twitter name\n twitter_user = player.twitter_screen_name.sub(/^.*[@\\/]/, '')\n\n link_to(\"@\" + twitter_user, \"http://twitter.com/#{twitter_user}\")\n end\n end", "def authorize_url\n polymorphic_url([ @workspace, :twitter_account ], :action => 'authorize')\n end", "def twitter_share_url(options = {})\n \"https://twitter.com/share?#{options.to_query}\"\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def url\n @client.url + self.class.path + @username\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def twitter\n callback_from :twitter\n end", "def twitter_ref_link\n url = u(root_url(:ref_id => current_user.id))\n \"http://twitter.com/home/?status=#{u(Setting::get('Facebook invitation text'))} #{url}\"\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def author_picture_url\n @author_picture_url ||= begin\n if self.author_screenname\n \"http://twitter.com/api/users/profile_image/#{self.author_screenname}\"\n else\n image_path(\"default-avatar.png\")\n end\n end\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def author_intent_url\n \"#{ USER_INTENT_URL_BASE }#{ author.screen_name }\"\n end", "def oauth_callback_url\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def term_url\n Config.config_value(term_config, :url)\n end", "def youtube_url; \"https://youtube.com/user/#{youtube}\" end", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def path_to_url(path, query_values = nil)\n Addressable::URI.new(\n :scheme => \"https\",\n :host => \"api.twitter.com\",\n :path => path,\n :query_values => query_values\n ).to_s\n end", "def link_twitter\n\n end", "def twitter\n @data['social']['twitter']\n end", "def twitter_url\n\t\ttwitter = []\n\t\ttext = html.search(\"a\").text.split(\" \")\n\t\ttext.each do |element|\n\t\t\tif element.to_s.match(/@/)\n\t\t\t\ttwitter << element\n\t\t\tend\n\t\tend\n\t\t\treturn twitter\n\tend", "def connectURL\n\t\t\"http://beta.stoffiplayer.com/auth/#{provider}\"\n\tend", "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "def get_twitter_authentication_url(opts = {})\n data, _status_code, _headers = get_twitter_authentication_url_with_http_info(opts)\n data\n end", "def auth_url\n client.authorization.authorization_uri(state: '', approval_prompt: :force, access_type: :offline, user_id: client_email).to_s\n end", "def url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n self.twitter_name = user_info['name']\n self.twitter_screen_name = user_info['screen_name']\n self.login = 'twitter_' + user_info['screen_name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def github_url\n \"https://github.com/#{self.nickname}\"\n end", "def grab_url(tweet)\n\t\t# only grabs the url from the tweet text and replaces any https with http\n\t\ttweet.text.split(' ').find { |hunk| hunk =~ /\\Ahttps{0,1}:\\/\\/t.co/ }.gsub('https', 'http')\n\tend", "def twitter\n\t\thandle_omniauth_callback(request.env['omniauth.auth'])\n\tend", "def callback_url\n auth_endpoint_callback_url(org: @organization.id)\n end", "def twitter_connect\n access_token = OAuth::AccessToken.new(UserSession.oauth_consumer, self.oauth_token, self.oauth_secret)\n user_info = JSON.parse(access_token.get(\"https://twitter.com/account/verify_credentials.json\").body)\n\n self.login = user_info['screen_name']\n self.twitter_name = user_info['name']\n self.password = \"5uttr33_#{self.login}\"\n self.signup_source = 'twitter'\n self.save\n end", "def url\n uri.to_s\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def connect_twitter\n auth = request.env[\"omniauth.auth\"]\n current_member.twitter_token = auth[\"credentials\"][\"token\"]\n current_member.twitter_secret = auth[\"credentials\"][\"secret\"]\n current_member.twitter_id = auth[\"uid\"]\n if current_member.img_url.blank?\n current_member.username = auth.info.name\n current_member.img_url = auth.info.image\n\t end\n current_member.save\n\t TwitterModel.store_urls(current_member)\n\t redirect_to members_social_sign_up_path\n end", "def callback_url\n File.join([full_host, script_name, callback_path].compact)\n end", "def twitter_link(username, link_options = nil)\n # default options\n link_options ||= {target: '_blank', rel: 'nofollow'}\n\n if username.present?\n link_to \"@#{username}\", \"https://twitter.com/#{username}\", link_options\n end\n end", "def twitter_profile\n @network = current_user.network ||= Network.new\n (@network.twitter.nil?) ? \"\" : @network.twitter\n end", "def url\n uri.to_s\n end", "def url\n @url.to_s\n end", "def url\n \"http://github.com/#{login}\"\n end", "def access_token_url\n Settings.mobile_lighthouse_letters.access_token_url\n end", "def feed_url\n \"http://#{@account}.github.com/feed.xml\"\n end", "def host\n \"#{account}.campfirenow.com\"\n end", "def twitter\n handle_callback(:twitter)\n end", "def artist_social(artist)\n\t #-----------For Artist Meta Tags----------------\n\n\t #Page Title, Facebook Title and Twitter Title\n\t @social_title = artist.name+\" on Three Repeater\"\n\t #Meta description (google), Facebook Description, and Twitter Card Description\n\t @social_descrip = artist.bio\n\n\t #logic around figuring out which facebook url is used\n\t facebook_url(artist)\n\n\t #Twitter ID\n\t @social_twitter_name = artist.twitter_name\n\n\t #Image for twitter and FB\n\t @social_image = artist.logo.to_s\n\n\t #------------------------------------------------\n\n end", "def oauth_url\n @oauth_url || File.join(host, \"oauth20/token\")\n end", "def oauth_callback_url\n url_for :action => \"list\"\n end", "def to_url\n to_uri.to_s\n end", "def profile_url\n \"#{Steam::API::COMMUNITY_URL}/profiles/#{steam_id}\"\n end", "def twitter=(value)\n value.gsub!(/^\\@/, '')\n write_attribute(:twitter, value)\n end", "def tweet\n\treturn \"Tweet Tweet Twitter\"\nend", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def tw_image_url(type)\n \"http://api.twitter.com/1/users/profile_image?user_id=#{tw_user_id}&size=#{type}\"\n end", "def token_url(params = nil)\n connection.build_url(oauth_token_path, params).to_s\n end", "def url\n \"#{@client.url}#{self.class.path}#{@user1.username};#{@user2.username}\"\n end", "def feed_id\n \"http://#{@account.downcase}.github.com/\"\n end", "def twitter\n default_oauth_callback do |auth|\n # username may already be taken, user will have to enter another one\n if User.exists? username: auth.info.nickname\n redirect_to controller: '/registrations', action: 'twitter_screen_name_clash'\n else\n default_oauth_fail\n end\n end\n end", "def url(prefix, stem)\n if prefix == ''\n \"/#{stem}/#{self.id}\"\n else\n \"#{prefix}/#{stem}/#{self.id}\"\n end\n end", "def user_url\n @raw['user']['url']\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def token_url\n \"#{sk_url}/oauth/token\"\n end", "def set_twitter_info omni\n info = omni['info']\n \n # Get profile image from twitter. Remove _normal to return normal size\n # (weird, right?)\n if info['image'].present?\n self.remote_profile_image_url = info['image'].gsub(\"_normal\", \"\")\n end\n end", "def get_pic_url\n\t if !self.pic_url\n\t\t twit_u = User.get_twitter_user_from_name(self.screen_name)\n\t\t\tputs twit_u\n\t\t\tself.pic_url = twit_u[\"profile_image_url\"]\n\t\t\tself.save!\n\t\tend\n\tend", "def url\n uri\n end", "def url\n uri\n end", "def profile_url\r\n infoxml = get_info\r\n return infoxml.at('profileurl').inner_text\r\n end", "def url\n\t\t\"http://beta.stoffiplayer.com/profile/#{id}\"\n\tend", "def server_url\n @uri\n end" ]
[ "0.7565765", "0.75593746", "0.7546104", "0.7427597", "0.7349594", "0.73262626", "0.71758527", "0.7172174", "0.7111333", "0.6972876", "0.69531876", "0.6834006", "0.67090166", "0.66411895", "0.6608745", "0.64482653", "0.6444345", "0.6439055", "0.64155185", "0.63727593", "0.6354539", "0.6289774", "0.62521195", "0.62416583", "0.62378", "0.6227813", "0.62091917", "0.6192771", "0.6188101", "0.61565626", "0.6097137", "0.60819185", "0.60570073", "0.6039054", "0.60255265", "0.6025099", "0.5965716", "0.5943241", "0.59358364", "0.5935816", "0.59350264", "0.59273845", "0.59031904", "0.58838123", "0.5873828", "0.585221", "0.584404", "0.5834988", "0.5829666", "0.5827978", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58166337", "0.58103263", "0.57901305", "0.5779012", "0.57719946", "0.57623434", "0.5759348", "0.5759031", "0.57397807", "0.57367396", "0.5734268", "0.57316744", "0.57280433", "0.57219464", "0.57083964", "0.56874645", "0.56873417", "0.5684684", "0.5675036", "0.56749624", "0.5671988", "0.5671767", "0.5666251", "0.5651725", "0.5651142", "0.5637755", "0.5626896", "0.5625395", "0.56207836", "0.56152713", "0.5607545", "0.5603845", "0.5603845", "0.55857456", "0.5583881", "0.5580264" ]
0.79917204
0
The URL to the artist's Facebook page or account.
def facebook_url; "https://facebook.com/#{facebook}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def external_url\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"external_url\"]\n end", "def fb_url\n \"http://feeds.feedburner.com/#{Blog.feedburner}\"\n end", "def og_url\n \"http://gaymerconnect.com/users/#{url}\"\n end", "def fb_about_url\n \"http://#{Facebooker.www_server_base_url}/apps/application.php?api_key=#{Facebooker.api_key}\"\n end", "def canvas_page_url(protocol)\n \"#{ protocol }apps.facebook.com/#{ namespace }\"\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def fb_profile_url\n \"http://www.facebook.com/profile.php?id=#{fb_user_id}\"\n end", "def facebook_url\n facebook_id.blank? ? \"\" : \"http://facebook.com/\" + facebook_id\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def set_facebook_url\n facebook_id = user.authorization.uid\n \"http://graph.facebook.com/#{facebook_id}/picture\"\n end", "def author_intent_url\n \"#{ USER_INTENT_URL_BASE }#{ author.screen_name }\"\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def author_url\n @author_url ||= begin\n \"http://twitter.com/#{self.author_screenname}\" if self.author_screenname\n end\n end", "def facebook_auth_uri\n return '' unless E9::Config.instance.facebook_auth_ready?\n\n facebook_client.auth_code.authorize_url({\n :redirect_uri => facebook_redirect_uri,\n :scope => 'publish_stream,manage_pages,offline_access'\n })\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def profile_url\r\n infoxml = get_info\r\n return infoxml.at('profileurl').inner_text\r\n end", "def oauth_url\n url = <<-URL\n https://www.facebook.com/dialog/oauth/\n ?client_id=#{Network::Facebook.app_id}\n &redirect_uri=#{URI.escape(\"#{root_url}auth/facebook/?r=#{redirect_for(request.referer)}\")}\n &scope=#{Network::Facebook.scope}\n URL\n url.gsub(/\\s+/, '')\n end", "def account_home_page_url(account)\n \"http://#{account.short_name}.#{account_domain}\"\n end", "def url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end", "def profile_url\n @json['user']['links']['self']\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def get_profile_picture_url\n\t\tidentity = self.identities.find_by_provider_id(ApplicationController.fb_app[:id])\n\t\treturn ApplicationController.fb_app[:graph][:query_root_url] + identity.uid + \"/\" + ApplicationController.fb_app[:graph][:query_mypic_suffix]\t\t\n\tend", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def tw_profile_url\n \"http://twitter.com/intent/user?user_id=#{tw_user_id}\"\n end", "def profile_url\n \"#{Steam::API::COMMUNITY_URL}/profiles/#{steam_id}\"\n end", "def og_url(url)\n\t\tbase_url = \"http://ehip.net\"\n\t\tif url.empty?\n\t\t\tbase_url\n\t\telse\n\t\t\turl\n\t\tend\n\tend", "def oauth_callback_url\n end", "def url\n uri.to_s\n end", "def url\n @url.to_s\n end", "def canvas(suffix)\n \"http://apps.facebook.com/\" + ENV['FACEBOOKER_RELATIVE_URL_ROOT'] + suffix\n end", "def url\n uri.to_s\n end", "def profile_url\n @data[:profile_url]\n end", "def artist_social(artist)\n\t #-----------For Artist Meta Tags----------------\n\n\t #Page Title, Facebook Title and Twitter Title\n\t @social_title = artist.name+\" on Three Repeater\"\n\t #Meta description (google), Facebook Description, and Twitter Card Description\n\t @social_descrip = artist.bio\n\n\t #logic around figuring out which facebook url is used\n\t facebook_url(artist)\n\n\t #Twitter ID\n\t @social_twitter_name = artist.twitter_name\n\n\t #Image for twitter and FB\n\t @social_image = artist.logo.to_s\n\n\t #------------------------------------------------\n\n end", "def callback_url\n if @authorization_code_from_signed_request_in_cookie\n ''\n else\n # Fixes regression in omniauth-oauth2 v1.4.0 by https://github.com/intridea/omniauth-oauth2/commit/85fdbe117c2a4400d001a6368cc359d88f40abc7\n options[:callback_url] || (full_host + script_name + callback_path)\n end\n end", "def facebook_authenticate_url\n facebook_client.web_server.authorize_url(:redirect_uri => Settings.authentication.facebook.callback_url,\n :scope => Settings.authentication.facebook.scope)\n end", "def callback_url\n auth_endpoint_callback_url(org: @organization.id)\n end", "def get_profile_url_linkedin\n profile_url = self[:info][:urls][:public_profile] if self[:info] and self[:info][:urls]\n profile_url.gsub!(/^http:/, 'https:') if profile_url # protect cookies\n profile_url\n end", "def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def main_url\n return nil unless twitter\n \"http://twitter.com/#{twitter.downcase}\"\n end", "def url\n return nil if page.hidden?\n\n [ self.preferred_domain.url, self.path.gsub(/^\\//, '') ].join # facets\n end", "def profile_url\n nil\n end", "def fb_page_thumbnail_url\n \"\"\n end", "def url\n case subject_type\n when USER, 'user'\n user_pretty_url( subject )\n when ALBUM, 'album'\n album_pretty_url( subject )\n when PHOTO, 'photo'\n photo_pretty_url( subject )\n else\n 'http://www.zangzing.com'\n end\n end", "def nice_url\n if homepage\n if Addressable::URI.parse(homepage)\n Addressable::URI.parse(homepage).host\n else\n homepage.first(15)\n end\n else\n \"\"\n end\n end", "def nice_url\n if homepage\n if Addressable::URI.parse(homepage)\n Addressable::URI.parse(homepage).host\n else\n homepage.first(15)\n end\n else\n \"\"\n end\n end", "def author_picture_url\n @author_picture_url ||= begin\n if self.author_screenname\n \"http://twitter.com/api/users/profile_image/#{self.author_screenname}\"\n else\n image_path(\"default-avatar.png\")\n end\n end\n end", "def profile_pic_url\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"profile_pic_url\"]\n end", "def to_s\n url\n end", "def initial_url\n options.fetch(:url) { \"https://#{FaaInfo.domain}/\" }\n end", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def sso_url(sso)\n sso.to_url\n end", "def callback_url\n File.join([full_host, script_name, callback_path].compact)\n end", "def facebookProfilePicURL\n # https://www.facebook.com/user_name\n if facebook_url\n return \"https://graph.facebook.com/[PROFILE_ID]/picture\"\n else\n None\n end\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def normalize_for_artist_finder\n profile_url.presence || url\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def url\n @client.url + self.class.path + @username\n end", "def url\n response[\"url\"]\n end", "def public_home_page_url(append_request_uri=false)\n url = \"http://www.#{account_domain}\"\n url << (append_request_uri ? request.request_uri : '/')\n url\n end", "def callback_url\n options[:callback_url] || (full_host + script_name + callback_path)\n end", "def callback_url\n options[:callback_url] || (full_host + script_name + callback_path)\n end", "def callback_url\n options[:callback_url] || (full_host + script_name + callback_path)\n end", "def to_s; @url; end", "def account_url\n return new_user_session_url unless user_signed_in?\n return :user_dashboard_url\n end", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "def twitter_url(username)\n \"https://twitter.com/#!/#{username}\"\n end", "def flickr_url\n get_url(:flickr)\n end", "def og_url\n \"http://gaymerconnect.com/groups/#{url}\"\n end", "def share_on_facebook_url(object)\n url = member_url([@tier, @topic, object])\n \"http://www.facebook.com/share.php?u=#{url}\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def homepage_url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end" ]
[ "0.8186199", "0.7000176", "0.6912926", "0.6892157", "0.675054", "0.6731198", "0.6724468", "0.67072654", "0.6682942", "0.6672041", "0.6643282", "0.6627645", "0.65963805", "0.656821", "0.65167904", "0.6470973", "0.6467474", "0.64137995", "0.63689274", "0.6354642", "0.6353523", "0.6352716", "0.6329481", "0.6328091", "0.63087904", "0.628212", "0.6217553", "0.6217553", "0.6210412", "0.617736", "0.6172317", "0.6166085", "0.61402255", "0.6130197", "0.6127519", "0.61166096", "0.60879993", "0.60877514", "0.6081675", "0.6080931", "0.60713685", "0.60522443", "0.60476124", "0.6025443", "0.60163206", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.60117275", "0.5997459", "0.597036", "0.59689087", "0.59633714", "0.5940261", "0.59299946", "0.59299946", "0.5922533", "0.59168345", "0.59079254", "0.5901305", "0.59002614", "0.5896478", "0.58865625", "0.5880741", "0.587518", "0.58642286", "0.58625203", "0.58625203", "0.58625203", "0.58625203", "0.58625203", "0.5859891", "0.5857516", "0.5854665", "0.58513266", "0.58513266", "0.58513266", "0.58480954", "0.5847035", "0.5846755", "0.58380646", "0.58380646", "0.58379704", "0.58328474", "0.58285785", "0.582694", "0.58182263", "0.58182263", "0.5808689" ]
0.71161056
1
The URL to the artist's Google+ account.
def googleplus_url; "https://plus.google.com/#{googleplus}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def og_url\n \"http://gaymerconnect.com/users/#{url}\"\n end", "def authenticate_url\n \"https://accounts.google.com/o/oauth2/auth?scope=https://www.googleapis.com/auth/urlshortener&response_type=code&client_id=#{ENV['GOOGL_CLIENT_ID']}&redirect_uri=#{ENV['GOOGL_REDIRECT_URI']}&access_type=offline&include_granted_scopes=true&approval_prompt=force\"\n end", "def connect_gplus\n\t auth = request.env[\"omniauth.auth\"]\n\t current_member.gplus_id = auth[\"uid\"]\n current_member.gplus_token = auth.credentials.token\n if auth.info.image.present?\n current_member.username = auth.info.name\n current_member.img_url = auth.info.image\n end\n current_member.gplus_refresh_token = auth.credentials.refresh_token\n current_member.gplus_token_expires_at = auth.credentials.expires_at\n\t current_member.save\n\t GoogleModel.store_urls(current_member)\n\t redirect_to members_social_sign_up_path\t\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def gardener_url\n (ENV['SUT_SCHEME'] || 'https') + \"://\" + gardener_fqhn()\n end", "def auth_url\n client.authorization.authorization_uri(state: '', approval_prompt: :force, access_type: :offline, user_id: client_email).to_s\n end", "def api_url\n authentication_credentials_provided? ? \"https://api.gowalla.com\" : \"http://api.gowalla.com\"\n end", "def access_token_url\n Settings.mobile_lighthouse_letters.access_token_url\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def get_oauth_authorization_link(account, project)\n return @client.authorization.authorization_uri({:state => \"#{account.site_address}-#{project.id}-google\"}).to_s\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def create_url\n \"#{api_url}/gists\"\n end", "def oauth_callback_url\n end", "def google_bucket_url\n \"https://accounts.google.com/AccountChooser?continue=https://console.cloud.google.com/storage/browser/#{self.bucket_id}\"\n end", "def oauth_url\n 'https://geoloqi.com/oauth/authorize'\n end", "def url\n @client.url + self.class.path + @username\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def callback_url\n auth_endpoint_callback_url(org: @organization.id)\n end", "def ext_url\n \"#{GOOGLEAPIS_URL}#{ext_path}\"\n end", "def og_url\n \"http://gaymerconnect.com/groups/#{url}\"\n end", "def external_url\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"external_url\"]\n end", "def get_auth_url\n\t\tURI::HTTP.build(\n\t\t\t:host => @options['auth_host'],\n\t\t\t:path => @options['auth_page'],\n\t\t\t:query => {\n\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t:scope => @options['scope'],\n\t\t\t\t:response_type => \"code\",\n\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t}.to_query\n\t\t).to_s\n\tend", "def ext_url\n \"https://storage.googleapis.com#{ext_path}\"\n end", "def getAuthUrl\n\t\t\t\tURI::HTTP.build(\n\t\t\t\t\t:host => @options['auth_host'],\n\t\t\t\t\t:path => @options['auth_page'],\n\t\t\t\t\t:query => {\n\t\t\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t\t\t:scope => @options['scope'],\n\t\t\t\t\t\t:response_type => \"code\",\n\t\t\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t\t\t}.to_query\n\t\t\t\t).to_s\n\t\t\tend", "def event_url\n \"http://gigs.gigatools.com/gig/#{self.id}\"\n end", "def url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end", "def authorization_url\n uri = URI(OAUTH_URL)\n uri.query = {\n client_id: client_id,\n redirect_uri: redirect_uri,\n scope: scope_url,\n response_type: 'code',\n access_type: 'offline'\n }.to_param\n\n uri.to_s\n end", "def get_auth_url(use_callback_flow=true)\n raise 'To be implemented in child classes'\n end", "def auth_url\n raise Me2day::Error::ClientError.new unless options[:application_key]\n connection.get(\"/api/get_auth_url.json\") do |request|\n request.headers[:me2_application_key] = options[:application_key]\n end.env[:body][:url]\n rescue Faraday::Error::ClientError\n raise Me2day::Error::ClientError\n end", "def facebook_url; \"https://facebook.com/#{facebook}\" end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def get_auth_url(service)\n config = get_service_config(service)\n request_id = get_request_token(service)\n\n url = String.new\n url << config[:authorize_url]\n url << \"?response_type=code\"\n url << \"&client_id=\"\n url << config[:client_id]\n url << \"&redirect_uri=\"\n url << config[:redirect_uri]\n url << \"&scope=\"\n url << config[:scope]\n url << \"&state=\"\n url << request_id\n\n url\n end", "def url\n URI.parse(\"#{protocol}://#{host}:#{port}#{store_uri}\")\n end", "def gist_url\n \"#{api_url}/gists/%s\"\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def youtube_url; \"https://youtube.com/user/#{youtube}\" end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def host\n \"#{account}.campfirenow.com\"\n end", "def oauth_url\n url = <<-URL\n https://www.facebook.com/dialog/oauth/\n ?client_id=#{Network::Facebook.app_id}\n &redirect_uri=#{URI.escape(\"#{root_url}auth/facebook/?r=#{redirect_for(request.referer)}\")}\n &scope=#{Network::Facebook.scope}\n URL\n url.gsub(/\\s+/, '')\n end", "def google_oauth2\n youtube_connect\n end", "def access_token_url\n Settings.lighthouse_health_immunization.access_token_url\n end", "def url_to_social_login( provider_key, on_success = nil )\n provider = Aerogel::Auth.providers[provider_key] || {}\n origin = on_success || params['on_success']\n query_string = origin ? \"?origin=#{origin}\" : ''\n \"/auth/#{provider_key}#{query_string}\"\nend", "def get_auth_url\n\t\tURI::HTTPS.build(\n\t\t\t:host => @options['auth_host'],\n\t\t\t:path => @options['auth_page'],\n\t\t\t:query => {\n\t\t\t\t:client_id => @options['client_id'],\n\t\t\t\t:redirect_uri => @options['redirect_uri'],\n\t\t\t\t:response_type => \"code\",\n\t\t\t}.to_query\n\t\t).to_s\n\tend", "def connectURL\n\t\t\"http://beta.stoffiplayer.com/auth/#{provider}\"\n\tend", "def signin_path(event_id = nil)\n register_param = (event_id) ? \"&register_for_event_id=#{event_id}\" : nil\n \"#{root_url(subdomain: false)}auth/google_oauth2?origin=#{request.url}#{register_param}\"\n end", "def get_authurl\n\t\tlogger.debug \"D, #{__method__.to_s}\"\n\t\tparams = {\n \"client_id\" => @client_id,\n \"response_type\" => \"code\",\n \"redirect_uri\" => @redirect_uri,\n \"prompt\" => \"consent\"\n }\n auth_uri = URI::Generic.new(\"https\", nil, @auth_url, nil, nil, \"authorize\", \n \t\t\t\t\t\t\t nil, nil, nil)\n auth_uri.query = URI.encode_www_form(params)\n logger.debug \"D, #{__method__.to_s}, #{auth_uri.to_s}\"\n return auth_uri.to_s\n\tend", "def url\n unless @url\n conf = Grape::Jwt::Authentication.configuration\n return conf.rsa_public_key_url\n end\n @url\n end", "def facebook_auth_uri\n return '' unless E9::Config.instance.facebook_auth_ready?\n\n facebook_client.auth_code.authorize_url({\n :redirect_uri => facebook_redirect_uri,\n :scope => 'publish_stream,manage_pages,offline_access'\n })\n end", "def openid_callback_url\n \"#{request.protocol}://#{request.host}#{Merb::Router.url(:openid)}\"\n end", "def auth_url\n \"#{@url}/auth/realms/#{@realm}/protocol/openid-connect/auth\"\n end", "def authsub_url next_url, secure = false, session = true, domain = nil\n query = {\n 'next' => CGI.escape(next_url),\n 'scope' => 'http%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F',\n 'secure' => (secure ? 1 : 0),\n 'session' => (session ? 1 : 0),\n }\n\n query['hd'] = CGI.escape domain if domain\n\n query = query.map do |key, value|\n \"#{key}=#{value}\"\n end.sort.join '&'\n\n \"https://www.google.com/accounts/AuthSubRequest?#{query}\"\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def url\n \"http://github.com/#{login}\"\n end", "def url\n URI.escape(\"#{protocol}#{host}/#{path_prefix}#{key}\")\n end", "def profile_url\n \"#{Steam::API::COMMUNITY_URL}/profiles/#{steam_id}\"\n end", "def gravatar_url(email)\n \"https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(email)}?s=40\"\n end", "def token_url(params = nil)\n connection.build_url(oauth_token_path, params).to_s\n end", "def openid_redirect_uri; end", "def authorization_url\n\t\t@client ||= api_client()\n\t\[email protected]_uri.to_s\n\tend", "def get_connect_url(guid, display=nil, signup=\"facebook\", logged_uri=nil)\n return false if guid.nil?\n url = \"http://www.beintoo.com/connect.html?guid=#{guid}&apikey=#{self.apikey}&redirect_uri=#{self.redirect_uri}\"\n unless display.nil?\n url += \"&display=#{display}\"\n end\n url += \"&signup=#{signup}\"\n unless logged_uri.nil?\n url += \"&logged_uri=#{logged_uri}\"\n end\n url\n end", "def feed_url\n \"http://#{@account}.github.com/feed.xml\"\n end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def to_s\n url\n end", "def feed_id\n \"http://#{@account.downcase}.github.com/\"\n end", "def oauth_uri(provider=\"FACEBOOK\")\n dest= session[\"return_to\"] || request.env[\"REQUEST_URI\"] || \"/\"\n \"#{oauth_uri_left_part}/account/oauth_start?provider=#{CGI.escape(provider)}&dest_left=#{CGI.escape(request_uri_left_part)}&dest_path=#{CGI.escape(dest)}\"\n end", "def oauth_redirect_uri\n uri = URI.parse(request.url)\n uri.path = '/sk_auth/callback'\n uri.query = nil\n uri.to_s\n end", "def url\n @url.to_s\n end", "def url\n uri.to_s\n end", "def token_url(user, ip, playback)\n auth_token = get_token(user, ip)\n if auth_token.present?\n uri = playback.url\n uri += URI.parse(uri).query.blank? ? \"?\" : \"&\"\n uri += \"token=#{auth_token}\"\n uri\n end\n end", "def api_url\n Settings.mobile_lighthouse_letters.api_url\n end", "def profile_url\r\n infoxml = get_info\r\n return infoxml.at('profileurl').inner_text\r\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def get_googlemap_url\n url = \"http://maps.google.com/maps?q=#{self.gmap_location}&\"\n end", "def oauth_url\n @oauth_url || File.join(host, \"oauth20/token\")\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend" ]
[ "0.642339", "0.6344962", "0.6344814", "0.6262271", "0.62545645", "0.62320673", "0.62320673", "0.6183196", "0.6114626", "0.6114615", "0.6109006", "0.6095217", "0.6092586", "0.60878253", "0.60865486", "0.6032656", "0.6017477", "0.5982421", "0.5949635", "0.5935535", "0.59268236", "0.59233695", "0.59182227", "0.58414567", "0.58288765", "0.5816518", "0.5810835", "0.5805551", "0.5793596", "0.5739395", "0.5728209", "0.57255894", "0.57160985", "0.5700415", "0.56990576", "0.56932485", "0.56919175", "0.5686624", "0.5660645", "0.56405985", "0.56380975", "0.5632819", "0.5625315", "0.5610705", "0.55985755", "0.5595385", "0.5590997", "0.55738735", "0.55542487", "0.5540128", "0.5533596", "0.5528756", "0.55133337", "0.5502797", "0.55001616", "0.54996514", "0.5495532", "0.54913354", "0.54840606", "0.54749465", "0.5473956", "0.54702216", "0.5469402", "0.5461665", "0.54598594", "0.54438436", "0.54414946", "0.5440163", "0.54351676", "0.54287875", "0.54272723", "0.54264534", "0.5413124", "0.54115534", "0.5407331", "0.5404659", "0.53978825", "0.53934515", "0.53933364", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.5392007", "0.53884333", "0.53811705", "0.53786665", "0.53786665", "0.53786665", "0.53786665" ]
0.74959797
0
The URL to the artist's MySpace account.
def myspace_url; "https://myspace.com/#{myspace}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def host\n \"#{account}.campfirenow.com\"\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def url\n @client.url + self.class.path + @username\n end", "def url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def url\n URI.parse(\"#{protocol}://#{host}:#{port}#{store_uri}\")\n end", "def my_url\n url 'my'\n end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def participatory_space_url\n return unless participatory_space\n\n @participatory_space_url ||= ResourceLocatorPresenter.new(participatory_space).url\n end", "def author_url\n @author_url ||= begin\n \"http://twitter.com/#{self.author_screenname}\" if self.author_screenname\n end\n end", "def account_home_page_url(account)\n \"http://#{account.short_name}.#{account_domain}\"\n end", "def token_url(user, ip, playback)\n auth_token = get_token(user, ip)\n if auth_token.present?\n uri = playback.url\n uri += URI.parse(uri).query.blank? ? \"?\" : \"&\"\n uri += \"token=#{auth_token}\"\n uri\n end\n end", "def auth_url\n raise Me2day::Error::ClientError.new unless options[:application_key]\n connection.get(\"/api/get_auth_url.json\") do |request|\n request.headers[:me2_application_key] = options[:application_key]\n end.env[:body][:url]\n rescue Faraday::Error::ClientError\n raise Me2day::Error::ClientError\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def access_token_url\n Settings.mobile_lighthouse_letters.access_token_url\n end", "def connectURL\n\t\t\"http://beta.stoffiplayer.com/auth/#{provider}\"\n\tend", "def store_url\n \"#{DEFAULT_URL}/#{store_id}\"\n end", "def github_url\n GITHUB_ARTICLES_URL + file_name\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def github_url\n \"https://github.com/#{self.nickname}\"\n end", "def profile_url\n \"#{Steam::API::COMMUNITY_URL}/profiles/#{steam_id}\"\n end", "def url\n URI.escape(\"#{protocol}#{host}/#{path_prefix}#{key}\")\n end", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def auth_url\n \"#{@url}/auth/realms/#{@realm}/protocol/openid-connect/auth\"\n end", "def url\n ''\n end", "def server_url\n @uri\n end", "def url\n get_attribute(Yoti::Attribute::APPLICATION_URL)\n end", "def auth_url\n client.authorization.authorization_uri(state: '', approval_prompt: :force, access_type: :offline, user_id: client_email).to_s\n end", "def login_url\n cache_path = \"/tmp/spaceship_itc_login_url.txt\"\n begin\n cached = File.read(cache_path)\n rescue Errno::ENOENT\n end\n return cached if cached\n\n host = \"https://itunesconnect.apple.com\"\n begin\n url = host + request(:get, self.class.hostname).body.match(%r{action=\"(/WebObjects/iTunesConnect.woa/wo/.*)\"})[1]\n raise \"\" unless url.length > 0\n\n File.write(cache_path, url)\n return url\n rescue => ex\n puts ex\n raise \"Could not fetch the login URL from iTunes Connect, the server might be down\"\n end\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n uri.to_s\n end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def workspace_url\n \"https://app.terra.bio/#workspaces/#{self.firecloud_project}/#{self.firecloud_workspace}\"\n end", "def server_url\n return @custom_url if @custom_url\n if !@sauce_username.nil? && !@sauce_access_key.nil?\n \"http://#{@sauce_username}:#{@sauce_access_key}@ondemand.saucelabs.com:80/wd/hub\"\n else\n \"http://127.0.0.1:#{@port}/wd/hub\"\n end\n end", "def arlocal_public_artist_home_link(arlocal_settings)\n link_to @arlocal_settings.artist_name_downcase, root_path, class: :arl_header_artist_name\n end", "def url\n # URL(@list.url).join(attributes[\"ServerUrl\"]).to_s\n attributes[\"ServerUrl\"]\n end", "def main_url\n return nil unless twitter\n \"http://twitter.com/#{twitter.downcase}\"\n end", "def auth_url\n MiniFB.oauth_url(@app_id, @redirect_to,\n :scope => 'user_about_me') # See MiniFB.scopes\n end", "def url\n uri.to_s\n end", "def url(prefix, stem)\n if prefix == ''\n \"/#{stem}/#{self.id}\"\n else\n \"#{prefix}/#{stem}/#{self.id}\"\n end\n end", "def terms artist\n url = URI.parse(\"http://developer.echonest.com/api/v4/artist/terms?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\")\nend", "def gardener_url\n (ENV['SUT_SCHEME'] || 'https') + \"://\" + gardener_fqhn()\n end", "def full_url\n char = (api_env('URL') =~ /\\?/).nil? ? '?' : '&'\n api_env('URL') + \"#{char}#{api_env('PARAM')}=#{login}\"\n end", "def url\n end", "def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end", "def server_url\n url\n end", "def url\n \"http://github.com/#{login}\"\n end", "def square_url\n square_uri.to_s\n end", "def url\n @url ||= \"https://#{@host}/#{druid_without_prefix}.xml\"\n end", "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend", "def auth_url\n CloudFiles.const_get(\"AUTH_#{self.auth_location.upcase}\")\n end", "def set_user_shop_url()\n # add to session so it is easy to access\n session[:shop_url] = ShopifyMultipass.new(Rails.application.credentials.shop_multipass_secret).get_shop_login_url({\n email: @user.email,\n first_name: @user.first_name,\n last_name: @user.last_name,\n tag_string: \"created by multipass\" \n })\n end", "def url\n \"http://twitter.com/#{self.username}/statuses/#{self.twitter_id}\"\n end", "def url\n @url.to_s\n end", "def author_picture_url\n @author_picture_url ||= begin\n if self.author_screenname\n \"http://twitter.com/api/users/profile_image/#{self.author_screenname}\"\n else\n image_path(\"default-avatar.png\")\n end\n end\n end", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def identifier(account)\n identity_url(:account => account, :protocol => scheme)\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def term_url\n Config.config_value(term_config, :url)\n end", "def url\n uri\n end", "def url\n uri\n end", "def initial_url\n options.fetch(:url) { \"https://#{FaaInfo.domain}/\" }\n end", "def cdn_management_url\n self.auth_response[:cdn_management_url]\n end", "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def author_intent_url\n \"#{ USER_INTENT_URL_BASE }#{ author.screen_name }\"\n end", "def youtube_url; \"https://youtube.com/user/#{youtube}\" end", "def manager_uri\n Bixby.manager_uri\n end", "def twitter_url(username)\n \"https://twitter.com/#!/#{username}\"\n end", "def to_url\n\t\t\tto_uri.to_s\n\t\tend", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def get_api_url\n\t\t\t\"https://#{club_name}.tidyhq.com/api/v1/\"\n\t\tend", "def url\n easy = EasyFactory.new(self).get\n url = easy.url\n Typhoeus::Pool.release(easy)\n url\n end", "def url\n raise NotImplementedError, 'this should be overridden by subclass'\n end", "def url\n if @uploader.upyun_bucket_domain\n \"http://\" + @uploader.upyun_bucket_domain + '/' + @path\n else\n nil\n end\n end", "def query_url\n user_dn = env['omniauth.params']['user_dn']\n build_query = \"#{options.cas_server}#{options.authentication_path}\"\n build_query += \"/#{user_dn}\"\n build_query += \"/#{options.return_field}.#{options.format}\"\n URI.encode(build_query)\n end", "def artist\n artist = Spotify.album_artist!(pointer)\n Artist.new(artist) unless artist.null?\n end", "def url\n check_validity!\n\n build_redis_url without_namespace: true\n end", "def query_artist(artist_name = 'Dire+Straits')\n \"http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=#{artist_name}&api_key=1ca2cf614eeaa185c2b61753b434b599&format=json\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def url\n \"#{self.public_path}/#{self.slug}\"\n end", "def mp3_url\n @mp3_url ||= url_for_format('mp3')\n end", "def canonical_uri; end", "def account_url\n return new_user_session_url unless user_signed_in?\n return :user_dashboard_url\n end", "def generate_url(api_key, page_number, username)\n %W[\n ws.audioscrobbler.com\n /2.0/?method=user.getrecenttracks&user=#{username}&api_key=#{api_key}&format=json&page=#{page_number}\n ]\n end", "def to_s\n url\n end", "def make_url(dav_uri, mailbox)\n \"#{dav_uri}/#{mailbox}/\"\n end", "def artist_name_from_url\n urls.map { |url| url[PROJECT, :artist_name] || url[ARTIST, :artist_name] }.compact.first\n end", "def url\n File.join(server.url, path)\n end" ]
[ "0.696291", "0.6773452", "0.657059", "0.6504948", "0.634028", "0.6255836", "0.6252541", "0.61759347", "0.6134905", "0.6131673", "0.605028", "0.60061556", "0.59966105", "0.5991381", "0.59790176", "0.5929904", "0.5924964", "0.5893371", "0.58563805", "0.5807878", "0.5791183", "0.5784443", "0.5783901", "0.5765915", "0.57652897", "0.57590437", "0.5758715", "0.5741846", "0.5738762", "0.5734614", "0.57204366", "0.5715366", "0.5685002", "0.5666153", "0.56631774", "0.56620467", "0.5660666", "0.56537914", "0.5648929", "0.5648929", "0.5627784", "0.56239873", "0.5623252", "0.5606178", "0.56054705", "0.56033814", "0.56011456", "0.56005615", "0.5596838", "0.559467", "0.5593261", "0.55854344", "0.55746984", "0.5568878", "0.55633444", "0.556213", "0.5549126", "0.5538785", "0.55380714", "0.55366546", "0.55229855", "0.5517531", "0.5516457", "0.5515304", "0.55129266", "0.55096745", "0.550525", "0.5500414", "0.5499692", "0.5491183", "0.5491183", "0.5490147", "0.54856515", "0.54788804", "0.5478145", "0.5477784", "0.54703057", "0.54594135", "0.54577744", "0.5455847", "0.54544646", "0.5453447", "0.5450828", "0.54477996", "0.54460055", "0.5441726", "0.54390687", "0.54320437", "0.54318625", "0.5428246", "0.5428246", "0.5424466", "0.5416437", "0.54139376", "0.54117113", "0.54111", "0.54092956", "0.53991973", "0.5398443", "0.5396668" ]
0.7400994
0
The URL to the artist's YouTube channel or account.
def youtube_url; "https://youtube.com/user/#{youtube}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def youtube_url\n \"https://www.youtube.com/watch?v=#{@data['youtubeID']}\" if @data['youtubeID']\n end", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def youtube_embed_url\n VideoInfo.new(self.video_url).embed_url if self.video_url?\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def url\n case subject_type\n when USER, 'user'\n user_pretty_url( subject )\n when ALBUM, 'album'\n album_pretty_url( subject )\n when PHOTO, 'photo'\n photo_pretty_url( subject )\n else\n 'http://www.zangzing.com'\n end\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def get_service_url unique_id\n \"http://gdata.youtube.com/feeds/api/videos/#{unique_id}?v=2&prettyprint=true&alt=json\"\n end", "def uri\n @uri ||= File.join(self.class.base_uri, channel)\n end", "def url\n @url.to_s\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def source\n\t\tif youtube?\n\t\t\treturn \"http://www.youtube.com/v/\" + youtube_id + \"?fs=1\"\n\t\telse\n\t\t\treturn \"\"\n\t\tend\n\tend", "def get_api_url\n\t\t\t\"https://#{club_name}.tidyhq.com/api/v1/\"\n\t\tend", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def to_s\n url\n end", "def url(key)\n %(http://#{Panda::Config[:videos_domain]}/#{key})\n end", "def embed_link\n return nil if self.youtube_link.nil?\n\n id_regex = /(?:http:\\/\\/)?(?:www\\.)?(?:youtube\\.com|youtu\\.be)\\/(?:watch\\?v=)?(.+)/\n youtube_id = self.youtube_link.match(id_regex)\n return nil if youtube_id.nil?\n\n return YOUTUBE_EMBED_PREFIX + youtube_id[1] + \"?rel=0\"\n end", "def url\n connection.build_url(url_chunk, params).to_s\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def author_url\n @author_url ||= begin\n \"http://twitter.com/#{self.author_screenname}\" if self.author_screenname\n end\n end", "def url\n @client.url + self.class.path + @username\n end", "def invite_url(server = nil)\n raise 'No application ID has been set during initialization! Add one as the `application_id` named parameter while creating your bot.' unless @application_id\n\n guild_id_str = server ? \"&guild_id=#{server.id}\" : ''\n \"https://discordapp.com/oauth2/authorize?&client_id=#{@application_id}#{guild_id_str}&scope=bot\"\n end", "def youtube_id\n\t\tif youtube?\n\t\t\treturn path[\"stoffi:track:youtube:\".length .. -1]\n\t\telse\n\t\t\treturn \"\"\n\t\tend\n\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def url\n @client.url + self.class.path + @sport.to_s\n end", "def twitter_url\n twitter_user.blank? ? nil : \"#{TWITTER_URL}#{twitter_user}\"\n end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def publish_url(channel)\n (ssl ? \"https\" : \"http\") << \"://#{origin}/publish/#{publish_key}/#{subscribe_key}/#{secret_key || 0}/#{channel}/0\"\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def video_url\n \"http://video.ted.com/#{videoID}\"\n end", "def external_url\n \"https://play.crayta.com/games/#{external_id}\"\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def play\n\t\treturn \"stoffi:track:youtube:#{youtube_id}\" if youtube?\n\t\treturn \"stoffi:track:soundcloud:#{soundcloud_id}\" if soundcloud?\n\t\treturn url\n\tend", "def host\n \"#{account}.campfirenow.com\"\n end", "def url\n if @uploader.upyun_bucket_domain\n \"http://\" + @uploader.upyun_bucket_domain + '/' + @path\n else\n nil\n end\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def feed_url\n client_url = 'https://kitsu.io'\n # Direct to user notifications list when more than one action\n return \"#{client_url}/notifications\" if activities.length > 1\n\n model_type, model_id = activity['foreign_id'].split(':')\n path = ''\n case model_type\n when 'Follow'\n path = \"/users/#{actor_id}\"\n when 'Post'\n path = \"/posts/#{model_id}\"\n when 'Comment'\n path = \"/comments/#{model_id}\"\n when 'PostLike'\n target_id = activity['target'].split(':').last\n path = \"/posts/#{target_id}\"\n when 'CommentLike'\n target_id = activity['target'].split(':').last\n path = \"/comments/#{target_id}\"\n when 'GroupInvite'\n path = \"/group-invite/#{model_id}\"\n end\n\n \"#{client_url}#{path}\"\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def url\n @url\n end", "def url\n @url\n end", "def new_url\n playlist_url(@response.new_index)\n end", "def embeddable_url\n\t\turl.sub('watch?v=', 'embed/')\n\tend", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def url\n uri.to_s\n end", "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end", "def url\n uri.to_s\n end", "def url\n ''\n end", "def main_url\n return nil unless twitter\n \"http://twitter.com/#{twitter.downcase}\"\n end", "def url\n easy = EasyFactory.new(self).get\n url = easy.url\n Typhoeus::Pool.release(easy)\n url\n end", "def embed_url\n params = {\n showChat: false,\n userName: Rack::Utils.escape(h.current_user.username)\n }\n\n \"#{url}?#{params.to_query}\"\n end", "def url\n \"http://twitter.com/#{self.username}/statuses/#{self.twitter_id}\"\n end", "def server_url\n return @custom_url if @custom_url\n if !@sauce_username.nil? && !@sauce_access_key.nil?\n \"http://#{@sauce_username}:#{@sauce_access_key}@ondemand.saucelabs.com:80/wd/hub\"\n else\n \"http://127.0.0.1:#{@port}/wd/hub\"\n end\n end", "def url\n response[\"url\"]\n end", "def tw_profile_url\n \"http://twitter.com/intent/user?user_id=#{tw_user_id}\"\n end", "def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end", "def to_s\n url\n end", "def auth_url\n raise Me2day::Error::ClientError.new unless options[:application_key]\n connection.get(\"/api/get_auth_url.json\") do |request|\n request.headers[:me2_application_key] = options[:application_key]\n end.env[:body][:url]\n rescue Faraday::Error::ClientError\n raise Me2day::Error::ClientError\n end", "def callback_url\n File.join([full_host, script_name, callback_path].compact)\n end", "def to_s; @url; end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def to_s\n @url\n end", "def callback_url\n auth_endpoint_callback_url(org: @organization.id)\n end", "def url\n @client.get_download_link(@path)\n end", "def url_for_video_player\n if VIDEOS_ON_S3\n \"http://wickedstartbucket.s3.amazonaws.com#{self.multimedia.url(:original, false)}\"\n else\n self.multimedia.url(:original, false)\n end\n end", "def auth_url\n client.authorization.authorization_uri(state: '', approval_prompt: :force, access_type: :offline, user_id: client_email).to_s\n end", "def youtube\n @data['social']['youtube']\n end", "def profile_url\n \"#{Steam::API::COMMUNITY_URL}/profiles/#{steam_id}\"\n end", "def url\n get_attribute(Yoti::Attribute::APPLICATION_URL)\n end", "def subscribe_url\n nil\n end", "def service_url\n begin\n return video.url\n rescue\n nil\n end\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def server_url\n url\n end", "def term_url\n Config.config_value(term_config, :url)\n end", "def url\n [ Configuration.url, @path ].join\n end", "def url\n @url\n end" ]
[ "0.7158124", "0.71342033", "0.6498359", "0.6339778", "0.62844515", "0.62076956", "0.6019845", "0.60163605", "0.60078895", "0.59888846", "0.5982293", "0.59743637", "0.5963959", "0.5920635", "0.5920635", "0.5897243", "0.58970475", "0.5891887", "0.58897555", "0.5883948", "0.5824304", "0.5815993", "0.58016944", "0.5796812", "0.57916003", "0.5781446", "0.5775532", "0.5770045", "0.5770045", "0.5770045", "0.5770045", "0.5770045", "0.57561004", "0.5739947", "0.5736707", "0.57360524", "0.5726306", "0.57241344", "0.57051396", "0.5703977", "0.570384", "0.568981", "0.5689116", "0.5686489", "0.5686146", "0.56848717", "0.56811726", "0.56752807", "0.56678915", "0.56662285", "0.56662285", "0.5662081", "0.5661246", "0.5650552", "0.56498", "0.5647359", "0.5640476", "0.5632717", "0.5631038", "0.56284595", "0.5627391", "0.5619939", "0.5617188", "0.5610326", "0.56067026", "0.56044936", "0.5601767", "0.5599057", "0.5598681", "0.55910486", "0.5590849", "0.5590337", "0.5584851", "0.5582821", "0.5577916", "0.55759555", "0.55744755", "0.55711836", "0.5564186", "0.55581367", "0.55570334", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.5554368", "0.55540776", "0.55399555", "0.5539922", "0.5536603" ]
0.72266465
0
The URL to the artist's SoundCloud account.
def soundcloud_url; "https://soundcloud.com/#{soundcloud}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def my_account_url\n get_institution_or_default(:eshelf_url) + '/account'\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def url\n host = @uploader.ucloud_cdn_host || @uploader.ucloud_bucket_host\n return nil unless host\n [host, @path].join(\"/\")\n end", "def auth_url\n CloudFiles.const_get(\"AUTH_#{self.auth_location.upcase}\")\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def url\n @client.url + self.class.path + @username\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def url\n File.join(DigitalRiver.config.oauth_url)\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def to_s\n cdn_url\n end", "def host\n \"#{account}.campfirenow.com\"\n end", "def connectURL\n\t\t\"http://beta.stoffiplayer.com/auth/#{provider}\"\n\tend", "def url\n if @uploader.upyun_bucket_domain\n \"http://\" + @uploader.upyun_bucket_domain + '/' + @path\n else\n nil\n end\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def show\n artist = params[:artist]\n track = params[:track]\n @url = \"http://soundcloud.com/#{artist}/#{track}\"\n @soundcloud_track = Soundcloud.client.get('/resolve', :url => @url)\n end", "def url\n if @account.url.blank?\n \"/\"\n else\n @account.url\n end\n end", "def url\n uri.to_s\n end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def url\n uri.to_s\n end", "def url\n @url.to_s\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def auth_url\n client.authorization.authorization_uri(state: '', approval_prompt: :force, access_type: :offline, user_id: client_email).to_s\n end", "def get_cloud_href\n @api_client.get_instance.links.detect { |link| link['rel'] == 'cloud' }['href']\n end", "def s3_url\n if $current_user.present?\n object.get_s3_secure_url\n else\n nil\n end\n end", "def url\n UploadUtils.get_url(\n FilestackConfig::CDN_URL, handle: handle, security: security\n )\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def url\n if @attributes[:filename] =~ /^http:\\/\\//\n @attributes[:filename]\n elsif $cloudfront && $cloudfront[s3_bucket]\n \"#{$cloudfront[s3_bucket]}/#{s3_key}\"\n else\n \"http://#{s3_bucket}.s3.amazonaws.com/#{s3_key}\"\n end\n end", "def auth_url\n raise Me2day::Error::ClientError.new unless options[:application_key]\n connection.get(\"/api/get_auth_url.json\") do |request|\n request.headers[:me2_application_key] = options[:application_key]\n end.env[:body][:url]\n rescue Faraday::Error::ClientError\n raise Me2day::Error::ClientError\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def github_url\n GITHUB_ARTICLES_URL + file_name\n end", "def cdn_url(opts={})\n S3Buckets::MediaBucket.url(s3_key, opts) if s3_key\n end", "def to_s\n url\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def s3_url\n return self.authenticated_s3_url(:expires_in => current_user.admin? ? 1.week : 24.hours, :use_ssl => true)\n end", "def url(options = {})\n self.class.url_for(key, bucket.name, options)\n end", "def url\n URI.parse(\"#{protocol}://#{host}:#{port}#{store_uri}\")\n end", "def url\n uri\n end", "def url\n uri\n end", "def s3_url\n return self.authenticated_s3_url(:expires_in => 24.hours, :use_ssl => true)\n end", "def author_url\n @author_url ||= begin\n \"http://twitter.com/#{self.author_screenname}\" if self.author_screenname\n end\n end", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def url\n @url\n end", "def url\n @url\n end", "def callback_url\n auth_endpoint_callback_url(org: @organization.id)\n end", "def myspace_url; \"https://myspace.com/#{myspace}\" end", "def url\n # HACK: Revisit and make configurable separate from the connection options.\n \"http://#{@uploader.sftp_host}/#{path}\"\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def cdn_management_url\n self.auth_response[:cdn_management_url]\n end", "def initial_url\n options.fetch(:url) { \"https://#{FaaInfo.domain}/\" }\n end", "def url\n # URL(@list.url).join(attributes[\"ServerUrl\"]).to_s\n attributes[\"ServerUrl\"]\n end", "def passport_url\n S3.object_url(self.passport_s3_key)\n end", "def acs_url\n @acs_url ||= URI.join(host, acs_path).to_s\n end", "def query_url\n user_dn = env['omniauth.params']['user_dn']\n build_query = \"#{options.cas_server}#{options.authentication_path}\"\n build_query += \"/#{user_dn}\"\n build_query += \"/#{options.return_field}.#{options.format}\"\n URI.encode(build_query)\n end", "def play\n\t\treturn \"stoffi:track:youtube:#{youtube_id}\" if youtube?\n\t\treturn \"stoffi:track:soundcloud:#{soundcloud_id}\" if soundcloud?\n\t\treturn url\n\tend", "def url\n ''\n end", "def external_url\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"external_url\"]\n end", "def url\n @url ||= \"https://#{@host}/#{druid_without_prefix}.xml\"\n end", "def callback_url\n File.join([full_host, script_name, callback_path].compact)\n end", "def url\n Blobs::URI.blob(container.name, name)\n end", "def uribase\n \"http://#{ENV['S3_BUCKET']}.#{ENV[\"S3_HOST\"]}/\"\n end", "def url\n URI.escape(\"#{protocol}#{host}/#{path_prefix}#{key}\")\n end", "def store_url\n \"#{DEFAULT_URL}/#{store_id}\"\n end", "def square_url\n square_uri.to_s\n end", "def server_url\n @uri\n end", "def url\n api_url\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def url\n \"#{@client.site_url}/#{id}\"\n end", "def s3_uri\n File.join(settings[:bucket] =~ %r{^s3://}i ? settings[:bucket].to_s : \"s3://#{settings[:bucket]}\", \"\") # always use a traling '/' with s3cmd\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def s3_url\n establish_s3_connection\n bucket = self.datastreams[\"s3\"].bucket_values.first\n key = self.datastreams[\"s3\"].key_values.first\n AWS::S3::S3Object.url_for(key, bucket, :expires_in => 60 * 60 * 1.5)\n end", "def flickr_url\n get_url(:flickr)\n end", "def mp3_url\n @mp3_url ||= url_for_format('mp3')\n end", "def to_url\n to_uri.to_s\n end", "def url\n @url\n end", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def public_uri\n URI.parse(s3obj.url(:expires_in => self.class.url_lifetime))\n end", "def cname_url\n URI.escape(\"#{protocol}#{name}/#{key}\") if bucket.vhost?\n end", "def workspace_url\n \"https://app.terra.bio/#workspaces/#{self.firecloud_project}/#{self.firecloud_workspace}\"\n end", "def s3_url(thumbnail = nil)\n if attachment_options[:cname]\n [\"#{s3_protocol}#{bucket.name}\", full_filename(thumbnail)].join(\"/\")\n else\n [\"#{s3_protocol}#{s3_hostname}#{bucket.path_prefix}\", full_filename(thumbnail)].join(\"/\")\n end\n end", "def url(opts = {})\n if bucket.mode == :private\n bucket.private_get_url(@path, opts)\n else\n bucket.path_to_url(@path, opts)\n end\n end", "def get_cloud_url\n @last_used_cloud_url\n end", "def fullurl\n if Rails.env == 'development'\n 'http://localhost:3000' + object.url.to_s\n else\n 'http://signlab-rails.herokuapp.com' + object.url.to_s\n end\n end", "def to_s\n url\n end", "def authorization_url\n\t\t@client ||= api_client()\n\t\[email protected]_uri.to_s\n\tend", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end", "def callback_url\n full_host + script_name + callback_path\n end" ]
[ "0.6697832", "0.6523755", "0.6417824", "0.63073164", "0.62918776", "0.62814075", "0.6279145", "0.6275267", "0.62289333", "0.6222981", "0.62201273", "0.61858714", "0.6184742", "0.61826706", "0.6141412", "0.61046547", "0.6071862", "0.6046681", "0.6014983", "0.60091907", "0.6001799", "0.5998747", "0.5983523", "0.5976735", "0.59730387", "0.5972094", "0.59641373", "0.59617484", "0.59563226", "0.59561807", "0.59336996", "0.59333265", "0.59320056", "0.59254414", "0.59189135", "0.5896464", "0.5892578", "0.5881692", "0.5862181", "0.5862181", "0.5860049", "0.58580565", "0.5855815", "0.583949", "0.583949", "0.5838823", "0.5808994", "0.57991743", "0.57909375", "0.5786597", "0.5778486", "0.57770824", "0.5775371", "0.57696325", "0.57674927", "0.5766727", "0.5766676", "0.576423", "0.5761131", "0.57563686", "0.57516557", "0.57511336", "0.57503736", "0.57480925", "0.57467574", "0.57460064", "0.5715535", "0.5714446", "0.5714446", "0.5714446", "0.5714446", "0.5714446", "0.5713032", "0.5710299", "0.57077813", "0.57077813", "0.5704525", "0.57038033", "0.5703765", "0.56886226", "0.568039", "0.5676641", "0.56713766", "0.566726", "0.56662345", "0.56626916", "0.5660878", "0.5658931", "0.56583637", "0.5655845", "0.56543255", "0.5652265", "0.5652265", "0.5652265", "0.5652265", "0.5652265", "0.5652265", "0.5652265", "0.5652265", "0.5652265" ]
0.72950274
0
The URL to the artist's Spotify page.
def spotify_url; "http://open.spotify.com/artist/#{spotify}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\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 artists\n link :top_artists, :Artist, name\n end", "def new_url\n playlist_url(@response.new_index)\n end", "def get_api_url_for(path)\n\t\treturn ('https://api.spotify.com' << path)\n\tend", "def url\n @client.url + self.class.path + @sport.to_s\n end", "def url\n \"#{@partnership.url}/#{@sport}\"\n end", "def url\n # URL(@list.url).join(attributes[\"ServerUrl\"]).to_s\n attributes[\"ServerUrl\"]\n end", "def artists\n link :top_artists, :Artist, country\n end", "def url\n uri.to_s\n end", "def url\n @url.to_s\n end", "def flickr_url\n get_url(:flickr)\n end", "def url\n uri.to_s\n end", "def display_artist(song)\n if song.artist.nil?\n link_to('Add Artist', edit_song_path(song)) \n else\n link_to(song.artist.name, artist_path(song.artist))\n end\n end", "def url\n create_episode_url(@slug)\n end", "def set_spotify_artist\n @spotify_artist = SpotifyArtist.find(params[:id])\n end", "def play\n\t\treturn \"stoffi:track:youtube:#{youtube_id}\" if youtube?\n\t\treturn \"stoffi:track:soundcloud:#{soundcloud_id}\" if soundcloud?\n\t\treturn url\n\tend", "def url\n end", "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend", "def sso_url(sso)\n sso.to_url\n end", "def url\n \"#{self.public_path}/#{self.slug}\"\n end", "def url(prefix, stem)\n if prefix == ''\n \"/#{stem}/#{self.id}\"\n else\n \"#{prefix}/#{stem}/#{self.id}\"\n end\n end", "def artist_show_song\r\n\r\n\t\t#@artist = Artist.find(params[:id])\r\n\t\tsearchString = params[:url_slug]\r\n\t\t@artist = Artist.find_by_url_slug(searchString)\r\n\t\t@song = @artist.song.find.by_url_slug(params[:song_name])\r\n\r\n\t\trespond_to do |format|\r\n\t\t\tformat.html # show.html.erb\r\n\t\t\tformat.xml { render :xml => @artist }\r\n\t\tend\r\n\tend", "def square_url\n square_uri.to_s\n end", "def artist_name_from_url\n urls.map { |url| url[PROJECT, :artist_name] || url[ARTIST, :artist_name] }.compact.first\n end", "def url\n uri\n end", "def url\n uri\n end", "def to_s\n url\n end", "def url\n @url\n end", "def url\n @url\n end", "def url\n ''\n end", "def url\n return nil if page.hidden?\n\n [ self.preferred_domain.url, self.path.gsub(/^\\//, '') ].join # facets\n end", "def show\n artist = params[:artist]\n track = params[:track]\n @url = \"http://soundcloud.com/#{artist}/#{track}\"\n @soundcloud_track = Soundcloud.client.get('/resolve', :url => @url)\n end", "def to_s; @url; end", "def artist\n artist = Spotify.album_artist!(pointer)\n Artist.new(artist) unless artist.null?\n end", "def url\n URI.parse(\"#{protocol}://#{host}:#{port}#{store_uri}\")\n end", "def store_url\n \"#{DEFAULT_URL}/#{store_id}\"\n end", "def arlocal_public_artist_home_link(arlocal_settings)\n link_to @arlocal_settings.artist_name_downcase, root_path, class: :arl_header_artist_name\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def url\n Config.site.url.chomp('/') + self.path\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def url\n response[\"url\"]\n end", "def url\n @url\n end", "def url\n \"#{@client.site_url}/#{id}\"\n end", "def url\n endpoint+'?'+query_string\n end", "def initialize(artist, track)\n @artist = artist\n @track = track\n\n url =(\"https://api.spotify.com/v1/search?q=\" + track + \"&type=track\")\n\n response = HTTParty.get(url).parsed_response\n\n @uri = response['tracks']['items'][0]['uri']\n\n\n # ['artists']['items'][0]['uri']\n end", "def url\n \[email protected]_s\n end", "def url\n URI.join(host, sitemaps_path.to_s, filename.to_s).to_s\n end", "def normalize_for_artist_finder\n profile_url.presence || url\n end", "def url\n unless new_record?\n Engine.routes.url_helpers.quickie_url(self, :host => Kublog.default_url_options[:host])\n end\n end", "def url\n\t\t\"http://beta.stoffiplayer.com/profile/#{id}\"\n\tend", "def server_url\n @uri\n end", "def streaming_endpoint\n encoded_url = URI.encode(\"#{SITE_URL}#{STREAM_URL}\".strip)\n URI.parse(encoded_url)\n end", "def to_s\n url\n end", "def url\n URI.parse(endpoint).join(path.to_s).to_s\n end", "def item_url(item)\n item.url\n end", "def item_url(item)\n item.url\n end", "def p_url\n Rails.application.routes.url_helpers.rent_url(id, host: PUBLIC_URL)\n end", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def url\n raise NotImplementedError, 'this should be overridden by subclass'\n end", "def url\n ::File.join \"/\", path.to_s\n end", "def faq_url\n WALLSOME_SITE_BASE_URL + \"/faq.html\"\n end", "def url\n storage.url_for(path_with_query)\n end", "def artist\n @artist #tells song its artist name\n end", "def site_url\n get_url(:site)\n end", "def url\n item_path(object)\n end", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url_for_me(action)\n if action == 'show'\n \"/articles/#{to_param}\"\n else\n \"/articles/#{to_param}/#{action}\"\n end\n end", "def item_url(result)\n query = CGI.parse(env.url.query.to_s)\n url = \"#{env.url.scheme}://#{env.url.host}/officers/#{result['identifiers'][0]['identifier']}\"\n if query['api_token'].any?\n url += \"?api_token=#{CGI.escape(query['api_token'][0].to_s)}\"\n end\n url\n end", "def url\n item_hash.deep_find([:listing_details, :view_item_url])\n end", "def seller_url\r\n ['http:', user.user_url].join('//') rescue nil\r\n end", "def my_url\n url 'my'\n end", "def server_url\n url\n end", "def entry_url(page)\n services.url_builder.url_for(page)\n end", "def url\n if Henshin.local?\n permalink\n else\n permalink.sub /index\\.html$/, ''\n end\n end", "def url\n [ Configuration.url, @path ].join\n end", "def url\n get_attribute(Yoti::Attribute::APPLICATION_URL)\n end", "def url\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def show\n @artist = @song.artist\n @artist_name = @artist ? @song.artist.name : \"no artist\"\n end", "def url\n easy = EasyFactory.new(self).get\n url = easy.url\n Typhoeus::Pool.release(easy)\n url\n end", "def show\n\t\t@artist = Artist.find(params[:id])\n\t\tdownloader = ScDownloader.new\n\t\t@tracks = downloader.get_tracks(@artist)\n\tend", "def species_url()\n\t\t@species = @pokemon_api[\"species\"][\"url\"]\n\t\treturn @species\n\tend", "def url\n [ @parent.url, @name ].join('/')\n end", "def searchSpotify(inArtist)\n tArtist = CGI.escape(inArtist)\n \n outstring = open('http://ws.spotify.com/search/1/artist?q='+tArtist, 'User-Agent' => 'Ruby-Wget').read\n\n outdata = outstring.split(\"<opensearch:totalResults>\")\n\n outdata.delete_at(0);\n\n if outdata[0].split(\"</opensearch:totalResults>\")[0].to_i > 0\n outinfo = outstring.split(\"<artist href=\");\n return outinfo[1].split(\">\")[0];\n else\n return 0\n end\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def url\n File.join(server.url, path)\n end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def url\n \"http://#{self.domain}/#{self.path}\"\n end" ]
[ "0.68538266", "0.6753186", "0.670799", "0.66023207", "0.6378011", "0.63615906", "0.6310249", "0.6296764", "0.6231621", "0.6230158", "0.6230117", "0.62004477", "0.6188648", "0.6186068", "0.61844915", "0.6182972", "0.61539024", "0.6133382", "0.6095266", "0.60726565", "0.6064099", "0.6038756", "0.6034911", "0.60125005", "0.5997083", "0.59966224", "0.59957826", "0.5970187", "0.59535486", "0.59535486", "0.59436417", "0.59389484", "0.59389484", "0.59295845", "0.59292114", "0.5927827", "0.5925399", "0.5914339", "0.59023535", "0.589789", "0.5895341", "0.588269", "0.5878929", "0.5876792", "0.58717954", "0.58547926", "0.58426195", "0.5832483", "0.58230084", "0.5822031", "0.5810105", "0.58075815", "0.58026826", "0.5801203", "0.57977045", "0.57913077", "0.5791304", "0.57902074", "0.57882524", "0.57882524", "0.5781256", "0.57757574", "0.57756764", "0.57749003", "0.5774109", "0.577123", "0.57690287", "0.57639134", "0.57524526", "0.57515013", "0.57464397", "0.574526", "0.574526", "0.57385737", "0.5734037", "0.57295865", "0.57281804", "0.57275724", "0.5722588", "0.5711843", "0.57111377", "0.5707187", "0.57066387", "0.57027954", "0.57015985", "0.5691195", "0.5688105", "0.5686639", "0.5682626", "0.56763864", "0.5668524", "0.5668157", "0.5668157", "0.5668157", "0.5668157", "0.5668157", "0.5667232", "0.56639177", "0.5662266", "0.56565624" ]
0.81512576
0
The URL to the artist's Last.fm page.
def lastfm_url; "https://last.fm/music/#{lastfm}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def wikimedia_url(metadata)\n links = metadata.split(\"\\n\")\n @url = ''\n links.each do |meta|\n if meta.include?('archive_url:') and !meta.include?('old_archive_url:')\n @url = meta.split('archive_url:').last\n end\n end \n return @url\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def url\n return if article.nil?\n title = article.escaped_full_title\n \"#{wiki.base_url}/w/index.php?title=#{title}&diff=prev&oldid=#{mw_rev_id}\"\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def final_url\n return @final_url if !@final_url.nil?\n location = final_location(FaviconParty::HTTPClient.head(@query_url))\n if !location.nil?\n if location =~ /\\Ahttp/\n @final_url = WEBrick::HTTPUtils.escape location\n else\n uri = URI @query_url\n root = \"#{uri.scheme}://#{uri.host}\"\n @final_url = WEBrick::HTTPUtils.escape URI.join(root, location).to_s\n end\n end\n if !@final_url.nil?\n if %w( 127.0.0.1 localhost ).any? {|host| @final_url.include? host }\n # TODO Exception for invalid final urls\n @final_url = @query_url\n end\n return @final_url\n end\n @final_url = @query_url\n end", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def artist_name_from_url\n urls.map { |url| url[PROJECT, :artist_name] || url[ARTIST, :artist_name] }.compact.first\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def faq_url\n WALLSOME_SITE_BASE_URL + \"/faq.html\"\n end", "def url\n @url.to_s\n end", "def url\n uri.to_s\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def url\n if Henshin.local?\n permalink\n else\n permalink.sub /index\\.html$/, ''\n end\n end", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def url\n uri.to_s\n end", "def mp3_url\n @mp3_url ||= url_for_format('mp3')\n end", "def flickr_url\n get_url(:flickr)\n end", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def url\n get_attribute(Yoti::Attribute::APPLICATION_URL)\n end", "def url\n response[\"url\"]\n end", "def normalize_for_artist_finder\n profile_url.presence || url\n end", "def url\n ''\n end", "def artist\n artist = Spotify.album_artist!(pointer)\n Artist.new(artist) unless artist.null?\n end", "def new_url\n playlist_url(@response.new_index)\n end", "def url\n # URL(@list.url).join(attributes[\"ServerUrl\"]).to_s\n attributes[\"ServerUrl\"]\n end", "def nice_url\n if homepage\n if Addressable::URI.parse(homepage)\n Addressable::URI.parse(homepage).host\n else\n homepage.first(15)\n end\n else\n \"\"\n end\n end", "def nice_url\n if homepage\n if Addressable::URI.parse(homepage)\n Addressable::URI.parse(homepage).host\n else\n homepage.first(15)\n end\n else\n \"\"\n end\n end", "def main_url\n return nil unless twitter\n \"http://twitter.com/#{twitter.downcase}\"\n end", "def url\n Config.site.url.chomp('/') + self.path\n end", "def fb_url\n \"http://feeds.feedburner.com/#{Blog.feedburner}\"\n end", "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend", "def permalink\n url = @path.inject(:+).to_s\n\n Henshin.local? ? url[1..-1] : url\n end", "def url\n \[email protected]_s\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def display_artist(song)\n if song.artist.nil?\n link_to('Add Artist', edit_song_path(song)) \n else\n link_to(song.artist.name, artist_path(song.artist))\n end\n end", "def arlocal_public_artist_home_link(arlocal_settings)\n link_to @arlocal_settings.artist_name_downcase, root_path, class: :arl_header_artist_name\n end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def url\n return nil if page.hidden?\n\n [ self.preferred_domain.url, self.path.gsub(/^\\//, '') ].join # facets\n end", "def url\n @url ||= File.join(AUDIO_URL_ROOT, self.path) if self.live?\n end", "def canonical_uri; end", "def artists\n link :top_artists, :Artist, name\n end", "def og_url(url)\n\t\tbase_url = \"http://ehip.net\"\n\t\tif url.empty?\n\t\t\tbase_url\n\t\telse\n\t\t\turl\n\t\tend\n\tend", "def url\n URL(@site.url).join(attributes[\"RootFolder\"]).to_s\n # # Dirty. Used to use RootFolder, but if you get the data from the bulk calls, RootFolder is the empty\n # # string rather than what it should be. That's what you get with web services as an afterthought I guess.\n # view_url = ::File.dirname(attributes[\"DefaultViewUrl\"])\n # result = URL(@site.url).join(view_url).to_s\n # if ::File.basename(result) == \"Forms\" and dir = ::File.dirname(result) and dir.length > @site.url.length\n # result = dir\n # end\n # result\n end", "def url\n unless new_record?\n Engine.routes.url_helpers.quickie_url(self, :host => Kublog.default_url_options[:host])\n end\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def url(prefix, stem)\n if prefix == ''\n \"/#{stem}/#{self.id}\"\n else\n \"#{prefix}/#{stem}/#{self.id}\"\n end\n end", "def feed_url\n # Check attributes\n if @site.config[:base_url].nil?\n raise RuntimeError.new('Cannot build Atom feed: site configuration has no base_url')\n end\n\n @item[:feed_url] || @site.config[:base_url] + @item.path\n end", "def host_meta_url\n host_meta_uri.to_s\n end", "def artist\n @artist #tells song its artist name\n end", "def url\n uri\n end", "def url\n uri\n end", "def permalink\n project_url(Episode.active, project, host: Rails.application.config.rakismet.url)\n end", "def to_s\n url\n end", "def wikisource_url(metadata)\n links = metadata.split(\"\\n\")\n @url = ''\n links.each do |meta|\n if meta.include?('wikisource_url:')\n @url = meta.split('wikisource_url:').last\n end\n end \n return @url\n end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def url\n end", "def canonical_url\n @canonical_url ||= url_without_params.chomp('/')\n end", "def author_url\n @author_url ||= begin\n \"http://twitter.com/#{self.author_screenname}\" if self.author_screenname\n end\n end", "def artist_social(artist)\n\t #-----------For Artist Meta Tags----------------\n\n\t #Page Title, Facebook Title and Twitter Title\n\t @social_title = artist.name+\" on Three Repeater\"\n\t #Meta description (google), Facebook Description, and Twitter Card Description\n\t @social_descrip = artist.bio\n\n\t #logic around figuring out which facebook url is used\n\t facebook_url(artist)\n\n\t #Twitter ID\n\t @social_twitter_name = artist.twitter_name\n\n\t #Image for twitter and FB\n\t @social_image = artist.logo.to_s\n\n\t #------------------------------------------------\n\n end", "def to_s; @url; end", "def human_url\n return self.alternate_link\n end", "def url\n @url\n end", "def url\n @url\n end", "def permalink\n return \"#{uri}\"\n end", "def canonical_url\n response[\"canonicalUrl\"]\n end", "def feed_url\n if @tag\n \"#{tag_url(@tag)}feed/\"\n elsif @search\n \"#{search_url(@search)}feed/\"\n else\n '/feed/'\n end\n end", "def absolute_url\n File.join(BLOG.url, url)\n end", "def youtube_url; \"https://youtube.com/user/#{youtube}\" end", "def show\n @query = params[:id].gsub('+', ' ')\n @autoplay = params[:autoplay]\n \n begin\n @artist = LastfmArtist.new(@query, @lastfm, true)\n rescue\n @artist = nil\n end\n \n unless @artist\n not_found\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @artist }\n end\n end", "def rss_url\n [@page.path, 'rss'] * '.'\n end", "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def artist_name\n artist.name if artist\n end", "def artists\n link :top_artists, :Artist, country\n end", "def f_artist\n fname_bits[-3] || 'unknown_artist'\n end", "def url\n map_datum.url.split(\"?\").first\n end", "def artist_name\n nil\n end", "def url_was\n \"#{self.class.url}/#{slug_was}\"\n end", "def full_url\n full_domain(:with_protocol => true)\n end", "def full_url\n full_domain(:with_protocol => true)\n end", "def full_resolution_url\n result_hash['fll']\n end", "def get_album_songs_url(album_url)\r\n\t\t\thtml_doc = get_html_doc(album_url)\r\n\t\t\tlinks = html_doc.css('a')\r\n\t\t\tlinks.map {|link| (link.attribute('href').to_s =~ /mp3-song.html/) ? \"http://pzmp3.com/\"+link.attribute('href').to_s : \"\"}.sort.delete_if{|href| href.empty?}\r\n\t\tend", "def url_for_me(action)\n if action == 'show'\n \"/articles/#{to_param}\"\n else\n \"/articles/#{to_param}/#{action}\"\n end\n end", "def artist\n artists.first\n end", "def url\n @url\n end", "def feed_url\n blog_url + \"posts.atom\"\n end", "def atom_url\n Config.site.url.chomp('/') + R(TagController, :atom, CGI.escape(name))\n end", "def url\n case subject_type\n when USER, 'user'\n user_pretty_url( subject )\n when ALBUM, 'album'\n album_pretty_url( subject )\n when PHOTO, 'photo'\n photo_pretty_url( subject )\n else\n 'http://www.zangzing.com'\n end\n end", "def url\n return @url if @url\n\n url = permalink ?\n if site.config['relative_permalinks']\n File.join(@dir, permalink)\n else\n permalink\n end :\n {\n 'lang' => self.lang,\n 'categories' => self.categories,\n 'basename' => self.basename,\n }.inject(template) { |result, token|\n result.gsub(/:#{token.first}/, token.last)\n }.gsub(/\\/\\//, '/')\n\n # sanitize url\n @url = url.split('/').reject { |part| part =~ /^\\.+$/ }.join('/')\n @url += '/' if url =~ /\\/$/\n @url.gsub!(/\\A([^\\/])/, '/\\1')\n @url\n end", "def initial_url\n options.fetch(:url) { \"https://#{FaaInfo.domain}/\" }\n end" ]
[ "0.7354311", "0.6980205", "0.6637502", "0.6589523", "0.64349556", "0.6252034", "0.6225566", "0.61806107", "0.61777157", "0.6173043", "0.61364245", "0.61364245", "0.61261564", "0.6113582", "0.6098971", "0.60434854", "0.60308224", "0.60205996", "0.60141516", "0.5992478", "0.59904504", "0.5970303", "0.5929242", "0.59224945", "0.5907559", "0.5903344", "0.5902844", "0.58885556", "0.5886291", "0.58465165", "0.58465165", "0.58353454", "0.5833134", "0.5831124", "0.5828818", "0.58269864", "0.58198404", "0.58136994", "0.58120096", "0.58120096", "0.58120096", "0.58120096", "0.58120096", "0.58062184", "0.580611", "0.5781941", "0.5780707", "0.5780475", "0.5778412", "0.5757558", "0.575469", "0.574953", "0.57442766", "0.5732331", "0.5727051", "0.5723502", "0.5720714", "0.572035", "0.57194996", "0.57194996", "0.5718074", "0.5710995", "0.57092303", "0.5707769", "0.57059246", "0.57040507", "0.5701597", "0.570155", "0.5701274", "0.5696779", "0.56926864", "0.56880397", "0.56880397", "0.5681983", "0.56670064", "0.5659188", "0.5657823", "0.5657209", "0.5650671", "0.56479007", "0.5646424", "0.5635449", "0.56327605", "0.5632595", "0.5616693", "0.5615861", "0.5609301", "0.56050813", "0.55960774", "0.55960774", "0.5588702", "0.5587732", "0.5586786", "0.5585512", "0.55783075", "0.557215", "0.55658346", "0.5563563", "0.55596584", "0.5558863" ]
0.8237019
0
The URL to the artist's website.
def website_url; website end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def url\n uri.to_s\n end", "def url\n uri.to_s\n end", "def url\n @url.to_s\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def url\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def url\n @url\n end", "def url\n @url\n end", "def url\n uri\n end", "def url\n uri\n end", "def url\n ''\n end", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def url\n Config.site.url.chomp('/') + self.path\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def url\n @url\n end", "def url\n get_attribute(Yoti::Attribute::APPLICATION_URL)\n end", "def _url\n URI.join(domain, path_gen.for_uri)\n end", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def url\n raise NotImplementedError, 'this should be overridden by subclass'\n end", "def url\n easy = EasyFactory.new(self).get\n url = easy.url\n Typhoeus::Pool.release(easy)\n url\n end", "def url\n response[\"url\"]\n end", "def url\n # URL(@list.url).join(attributes[\"ServerUrl\"]).to_s\n attributes[\"ServerUrl\"]\n end", "def url\n @client.url + self.class.path + @sport.to_s\n end", "def site_url\n get_url(:site)\n end", "def url\n \"#{@client.site_url}/#{id}\"\n end", "def url\n \"#{self.public_path}/#{self.slug}\"\n end", "def url\n end", "def url\n URI.parse(\"#{protocol}://#{host}:#{port}#{store_uri}\")\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def url\n [ Configuration.url, @path ].join\n end", "def url\n \[email protected]_s\n end", "def url\n ::File.join \"/\", path.to_s\n end", "def url\n @parser.request_url\n end", "def initial_url\n options.fetch(:url) { \"https://#{FaaInfo.domain}/\" }\n end", "def to_s\n url\n end", "def url\n self.class.url\n end", "def flickr_url\n get_url(:flickr)\n end", "def url\n if Henshin.local?\n permalink\n else\n permalink.sub /index\\.html$/, ''\n end\n end", "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def server_url\n @uri\n end", "def url\n unless new_record?\n Engine.routes.url_helpers.quickie_url(self, :host => Kublog.default_url_options[:host])\n end\n end", "def get_url\n @url\n end", "def url\n @client.get_download_link(@path)\n end", "def new_url\n playlist_url(@response.new_index)\n end", "def og_url(url)\n\t\tbase_url = \"http://ehip.net\"\n\t\tif url.empty?\n\t\t\tbase_url\n\t\telse\n\t\t\turl\n\t\tend\n\tend", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def url\n connection.build_url(url_chunk, params).to_s\n end", "def url\n @url ||= args.dig(:url)\n end", "def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end", "def to_url\n\t\t\tto_uri.to_s\n\t\tend", "def site_url\n SITE_URL\n end", "def server_url\n url\n end", "def url\n @url ||= File.join(AUDIO_URL_ROOT, self.path) if self.live?\n end", "def web_url\n return @web_url\n end", "def web_url\n return @web_url\n end", "def web_url\n return @web_url\n end", "def url\n File.join(server.url, path)\n end", "def url\n api_url\n end", "def to_s; @url; end", "def url\n create_episode_url(@slug)\n end", "def url\n \"http://#{self.cms_site.hostname}#{self.full_path}\"\n end", "def my_url\n url 'my'\n end", "def faq_url\n WALLSOME_SITE_BASE_URL + \"/faq.html\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def full_uri company\n uri = company.website\n uri =~ %r(https?://) ? uri : \"http://#{uri}\"\n end", "def base_url\n 'http://ow.ly/api/1.1/url/shorten'\n end", "def url\n data['url']\n end", "def to_url\n to_uri.to_s\n end", "def url\n return nil if page.hidden?\n\n [ self.preferred_domain.url, self.path.gsub(/^\\//, '') ].join # facets\n end", "def url\n return if article.nil?\n title = article.escaped_full_title\n \"#{wiki.base_url}/w/index.php?title=#{title}&diff=prev&oldid=#{mw_rev_id}\"\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def terms artist\n url = URI.parse(\"http://developer.echonest.com/api/v4/artist/terms?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\")\nend" ]
[ "0.7183266", "0.71815664", "0.70814884", "0.7076081", "0.70367026", "0.7023664", "0.7004261", "0.69639754", "0.6952045", "0.6952045", "0.69425035", "0.69425035", "0.69038045", "0.6883503", "0.6857721", "0.6799725", "0.6796599", "0.6753872", "0.66756517", "0.6670224", "0.6670224", "0.6661802", "0.6661802", "0.6661802", "0.6661802", "0.6661802", "0.6645689", "0.6641418", "0.66134113", "0.65872014", "0.6577942", "0.6570873", "0.65632504", "0.65616566", "0.6556049", "0.65460306", "0.65380335", "0.65330917", "0.64936817", "0.64855677", "0.6475163", "0.64639354", "0.6461606", "0.64556", "0.6452117", "0.6450347", "0.6432889", "0.64221966", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.6417058", "0.64036405", "0.64030546", "0.6389072", "0.63827914", "0.6378554", "0.6374312", "0.63742703", "0.63638973", "0.63602775", "0.63434654", "0.6337908", "0.63376224", "0.6336722", "0.63346845", "0.6327172", "0.6327172", "0.6327172", "0.63268584", "0.63233864", "0.63152945", "0.63042533", "0.62910193", "0.6288552", "0.6287845", "0.6281496", "0.6281496", "0.62773955", "0.62581724", "0.6258045", "0.62561935", "0.62522197", "0.6251039", "0.62418514" ]
0.6901612
13
Whether or not the artist has any links to external properties.
def any_places? twitter? or facebook? or googleplus? or myspace? or youtube? or soundcloud? or spotify? or lastfm? or website? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_links?\n edata = extra_data\n bitvalue = edata[\"m_search_engines\"].to_i\n is_a_search_link_set = [1,2,4,8,16].map do |a| \n (bitvalue & a) > 0 ? 1 : nil \n end.compact.size > 0\n is_a_search_link_set || (edata[\"artist\"] &&\n !edata[\"artist\"][\"name\"].blank? &&\n !edata[\"artist\"][\"url\"].blank?)\n end", "def require_links?\n @require_links\n end", "def about_link?\n\t\tself.external == false && self.link == 'about'\n\tend", "def external?\n @external\n end", "def what_links_heres_ok?\n what_links_here_except_obsolete_combinations.empty?\n end", "def has_related?(link_rel)\n _ = related link_rel\n true\n rescue KeyError\n false\n end", "def link?\n !link.nil? && !link.empty?\n end", "def link?\n !link.nil? && !link.empty?\n end", "def external_metadata_file?\n false\n end", "def wikilink_available?\n wikilink && !wikilink.empty?\n end", "def artist?\n end", "def show_all_link?\n @show_all_link\n end", "def has_link?(link_rel)\n c = self.links.select {|l| l[link_rel] }.count\n c == 0 ? false : true\n end", "def is_ref? ; !!metadata[:ref] ; end", "def should_add_extra_rel_attribute_values?\n config = @target_blank_config\n case config\n when nil, NilClass\n false\n else\n config.fetch(\"rel\", false)\n end\n end", "def external?\n !external_id.blank?\n end", "def persisted?\n href.present?\n end", "def related?(link_rel)\n _ = related link_rel\n true\n\n rescue KeyError\n false\n end", "def has_source_info?\n self.any_present?(:source_title, :publisher, :start_page)\n end", "def irrelevant?\n video.nil? && manuscript.nil? && external_reference_link.blank?\n end", "def attribute?\n @attribution\n end", "def url?\n !urn?\n end", "def local_link?\n [1,2].include?(link_type)\n end", "def link_is_fulltext?\n @link_is_fulltext\n end", "def update_has_attrs\n\t\tunless promotional == true\n\t\t\tself.has_video = (video_album.video_files.size > 0) ? true : false\n\t\t\tself.has_audio = (audio_album.audio_files.size > 0) ? true : false\n\t\t\tself.has_photos = (photo_album.square_photos.size > 0) ? true : false\n\t\t\tself.has_links = (page_links.count > 0 or created_page_link_this_time) ? true : false\n\t\tend\n\t\ttrue\n\tend", "def external_meta?\n parent_eol_pk.present?\n end", "def has_social_links?\n tauth = self.authorizations.where(:provider => 'Twitter')\n fauth = self.authorizations.where(:provider => 'Facebook')\n if tauth.present? || fauth.present?\n return true # Return true if true\n end\n false # Otherwise, return false\n end", "def links?\n !cases.empty? || !field_contacts.empty?\n end", "def is_downloaded_artwork\n @ole.IsDownloadedArtwork\n end", "def relevant_fulltext_link?(link)\n relevant_links.map { |x| link[:url].include?(x) }.any?\n end", "def oneway?\n [email protected]_key?([@dest, @src])\n end", "def is_link?\n self.type == 'Document::VirtualCollege' && !is_pdf?\n end", "def hasProperties\n end", "def add_default_rel_attributes?\n @should_add_noopener = false if should_not_include_noopener?\n\n @should_add_noreferrrer = false if should_not_include_noreferrer?\n end", "def has_hyperlink?\n HYPERLINK_HOOKS.each { |string|\n return true if self.include?(string)\n }\n false\n end", "def check_for_url(url)\n array = read_articles\n\n if array.any? {|article| article[\"url\"] == url}\n false\n else\n true\n end\nend", "def social?\n @data['social'] != {}\n end", "def autolink?\n @autolink\n end", "def library_properties?\n lib_props = library_properties_path\n lib_props.exist? && lib_props.file?\n end", "def check_only_links\n end", "def external?\n !internal?\n end", "def partial?\n\t\t\tlinks.by(:rel)['alternate'].any? do |l|\n\t\t\t\tl[3]=='application/atom+xml'||l[3]=='application/atom+xml;type=entry'\n\t\t\tend\n\t\tend", "def example?\n @properties.key?(:example) && !@properties[:example].empty?\n end", "def url?\n !url.nil?\n end", "def ontology_based?\n source_ontology.present? && ols_root_term_uri.present?\n end", "def external?\n crate.canonical_id.host != canonical_id.host\n end", "def external?\n !internal?\n end", "def info_page_will_display_details\n if info_page_can_display_details && link.details_text_markup.to_s != ''\n true\n end\n end", "def autosavable?(metadata)\n !autosaved_relations.include?(metadata.name) && !metadata.embedded?\n end", "def validates_presence_of_urls\n if provider_media_id.blank?\n !( source_url.blank? || thumbnail_url.blank? || content_url.blank? )\n else\n true\n end\n end", "def meta_uri?\n return components.size == 1 && components[0] == 'cloudkit-meta'\n end", "def additional_properties\n @additional_properties.nil? ? true : @additional_properties\n end", "def trackable?(uri)\n uri && uri.absolute? && %w(http https).include?(uri.scheme)\n end", "def required_for_external?\n true\n end", "def external?\n false\n end", "def metadata?\n !!@metadata\n end", "def metadata?\n !!@metadata\n end", "def exist_links\n return [] if sumup.blank?\n\n sumup.fetch(\"public_praises\").fetch(\"items\")\n end", "def metadata?\n [email protected]? && [email protected]?\n end", "def atlas_visible?\n return quality_checked? && open_access? && geom?\n end", "def has_conjunction?\n\t\treturn self.num_sublinkages > 1\n\tend", "def include?(actor)\n @links.key? actor.mailbox.address\n end", "def specification_identified?\n self.specification_attached? || !self.document_link.blank?\n end", "def source_noteworthy?\n source.present? && source != \"mo_website\"\n end", "def accepts_outcome_url?\n accepted_outcome_types.member?('url')\n end", "def dirty?\n orig_repr.properties != repr.properties ||\n sans_anon(orig_repr.all_links) != sans_anon(repr.all_links) ||\n raw_anons(orig_repr.all_links) != raw_anons(repr.all_links)\n end", "def is_unknown_url? url\n @urls.count_documents(url:url) == 0\n end", "def is_linkkeys?(); @type == GRT_LINKKEYS; end", "def has_link?(link)\n @links.has_key?(link) || @links.has_key?(rel(link))\n end", "def required_for_external?\n false\n end", "def required_for_external?\n false\n end", "def required_for_external?\n false\n end", "def is_photo_link(link)\n\t\n\tif \t(link.include?(\"pinterest.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"flickr.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"deviantart.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"fotolog.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"shutterfly.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"panoramio.com\") ) \n\t\treturn true;\n\tend\n\tif\t(link.include?(\"photobucket.com\") ) \n\t\treturn true;\n\tend\n\n\treturn false;\t\n\nend", "def published?\n all_base_attributes_present?\n end", "def links\n metadata[:links] || Set.new\n end", "def valid_feed?(item)\n !item['url'].to_s.strip.empty?\n end", "def have_property?(prop, obj)\r\n prop = URI.parse(prop) unless prop.is_a?(URI)\r\n unless obj.is_a?(Resource) or obj.is_a?(Literal)\r\n raise ArgumentError.new(obj.inspect + \" is not Rena::Resource nor Rena::Literal\")\r\n end\r\n\r\n each_property{|predicate, object|\r\n return true if predicate == prop and object == obj\r\n }\r\n false\r\n end", "def url?\n children[0] && children[0].is_a?(Url)\n end", "def is_propertyAttr?(attr)\n if ([RDF_NS.Description.to_s, RDF_NS.li.to_s] + OLD_TERMS).include?(attr.uri.to_s)\n warn = \"Invalid use of rdf:#{attr.name}\"\n add_debug(attr, warn)\n raise InvalidPredicate.new(warn) if @strict\n return false\n end\n !CORE_SYNTAX_TERMS.include?(attr.uri.to_s) && attr.namespace && attr.namespace.href != XML_NS.uri.to_s\n end", "def has_own_property(property)\n end", "def property?\n @options[:association].nil?\n end", "def redirects_to_external?\n desc = self.layout_description\n return false if desc.blank?\n desc[\"redirects_to_external\"]\n end", "def xmlUrl?\n self.xmlUrl ? true : false\n end", "def real_url?\n url && url.present? && url != \"#\"\n end", "def location_empty?( attr )\n attr[ 'uri' ].blank? &&\n attr[ 'file_name' ].blank? &&\n attr[ 'doc_code' ].blank? &&\n attr[ 'doc_version' ].blank?\n end", "def manage_datacite?\n has_local_doi?\n end", "def metadata_loaded?\n @metadata.to_bool\n end", "def indirect?\n !indirect.empty?\n end", "def has_website?\n !url.blank?\n end", "def valid_uri?\n !self.contentable.blank? || !self.uri_path.blank?\n end", "def external?(link)\n if link&.match?(URI.regexp(%w(http https)))\n URI.parse(link).host != URI.parse(@site_url).host\n end\n end", "def has_response_body?\n @raw_link.media_type != \"null\"\n end", "def specification_attached?\n self.eco_documents.detect { |d| d.specification? } != nil\n end", "def is_displayed_on_site?\n feed.feed_type.name == \"Article\"\n end", "def is_link?\n !child_question.nil?\n end", "def with_relationships?\n self.fields.any? { |field| field.is_relationship? }\n end", "def add_image_link?(options)\n !options.key?(:link) || options[:link]\n end", "def has_assets?\n #FIXME: requires a unit test\n !all_related_data_files.empty? || !all_related_models.empty?\n end", "def absolute_url?\n (self.include?('://') || self.start_with?('/')) ? true : false\n end", "def author_worthy?\n notes?\n end", "def has_github?\n !github_url.blank?\n end" ]
[ "0.7019437", "0.6804309", "0.6650235", "0.6331638", "0.63202626", "0.62568706", "0.62467545", "0.62467545", "0.6218376", "0.621109", "0.62056124", "0.6190444", "0.61818326", "0.6166803", "0.61518073", "0.6150202", "0.612403", "0.6122944", "0.6101623", "0.606288", "0.60435456", "0.60315907", "0.6024575", "0.60240185", "0.60059655", "0.6002894", "0.5981853", "0.59712124", "0.59503615", "0.59452724", "0.5939727", "0.5916671", "0.59079516", "0.58962363", "0.58899903", "0.5841332", "0.580755", "0.5806596", "0.58053434", "0.5793812", "0.5784449", "0.57815206", "0.5766749", "0.5755438", "0.5749312", "0.57465833", "0.5743487", "0.5743346", "0.5742434", "0.57300735", "0.5728863", "0.5709836", "0.5706253", "0.57010144", "0.5698255", "0.5694913", "0.5694913", "0.5691416", "0.56866646", "0.56818694", "0.5676072", "0.56689405", "0.5664374", "0.5662736", "0.5660359", "0.5658818", "0.5657586", "0.56557214", "0.5651527", "0.5635054", "0.5635054", "0.5635054", "0.5625975", "0.5625851", "0.5619021", "0.56178635", "0.5614941", "0.5590735", "0.5589586", "0.5587479", "0.55776006", "0.55742353", "0.5565187", "0.55649215", "0.5558607", "0.5554243", "0.5547107", "0.55378914", "0.553546", "0.55312204", "0.553008", "0.5528891", "0.55236346", "0.55221033", "0.5516652", "0.5515636", "0.55134666", "0.55119085", "0.55109286", "0.55038434", "0.5498188" ]
0.0
-1
The URL for the streaming of the artist. NOT IMPLEMENTED YET
def stream_url "http://www.google.com" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def streaming_endpoint\n encoded_url = URI.encode(\"#{SITE_URL}#{STREAM_URL}\".strip)\n URI.parse(encoded_url)\n end", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def stream_uri\n @stream_uri\n end", "def url\n @url ||= File.join(AUDIO_URL_ROOT, self.path) if self.live?\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def uri\n @uri ||= uri_id && \"spotify:user:#{user.username}:playlist:#{uri_id}\"\n end", "def full_url\n @full_url ||= (Streaming.streaming_base_url / Streaming.api_version.to_s / \"statuses\" / \"#{@path}.json\")\n end", "def url_for_video_player\n if VIDEOS_ON_S3\n \"http://wickedstartbucket.s3.amazonaws.com#{self.multimedia.url(:original, false)}\"\n else\n self.multimedia.url(:original, false)\n end\n end", "def new_url\n playlist_url(@response.new_index)\n end", "def url\n uri.to_s\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def url\n @url.to_s\n end", "def url\n uri.to_s\n end", "def url\n raise NotImplementedError, 'this should be overridden by subclass'\n end", "def play\n\t\treturn \"stoffi:track:youtube:#{youtube_id}\" if youtube?\n\t\treturn \"stoffi:track:soundcloud:#{soundcloud_id}\" if soundcloud?\n\t\treturn url\n\tend", "def mp3_url\n @mp3_url ||= url_for_format('mp3')\n end", "def url\n connection.build_url(url_chunk, params).to_s\n end", "def path\n @path ||= \"#{@device.path}/streams/#{HTTP::URL.encode(@attributes[\"name\"])}\"\n end", "def url\n @url\n end", "def url\n @url\n end", "def url\n uri\n end", "def url\n uri\n end", "def url\n # HACK: Revisit and make configurable separate from the connection options.\n \"http://#{@uploader.sftp_host}/#{path}\"\n end", "def get_song_url_by_id(id)\n resp = get_stream_auth_by_songid(id)\n \"http://#{resp['ip']}/stream.php?streamKey=#{resp['stream_key']}\"\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 url\n repository.datastream_url(pid, dsid) + \"/content\"\n end", "def url\n @url\n end", "def url\n # URL(@list.url).join(attributes[\"ServerUrl\"]).to_s\n attributes[\"ServerUrl\"]\n end", "def url\n end", "def url\n @client.url + self.class.path + @sport.to_s\n end", "def server_url\n @uri\n end", "def wikimedia_url(metadata)\n links = metadata.split(\"\\n\")\n @url = ''\n links.each do |meta|\n if meta.include?('archive_url:') and !meta.include?('old_archive_url:')\n @url = meta.split('archive_url:').last\n end\n end \n return @url\n end", "def url\n response[\"url\"]\n end", "def url\n @client.get_download_link(@path)\n end", "def external_download_url\n @file.external_bytestream_uri.to_s\n end", "def make_url\n [ \"http://ws.audioscrobbler.com/2.0/?method=#{api_method}#{identifier}\",\n \"&limit=#{max_items}&api_key=#{api_key}&format=json\",\n \"&page=#{page}\" ].join(\"\")\n end", "def url\n ''\n end", "def stream_urls\n @stream_urls ||= begin\n return {} unless presenter.solr_document['derivatives_metadata_ssi'].present?\n files_metadata = JSON.parse(presenter.solr_document['derivatives_metadata_ssi'])\n file_locations = files_metadata.select { |f| f['file_location_uri'].present? }\n return {} unless file_locations.present?\n streams = {}\n file_locations.each do |f|\n streams[f['label']] = Hyrax::IiifAv.config.iiif_av_url_builder.call(\n f['file_location_uri'],\n request.base_url\n )\n end\n streams\n end\n end", "def url(key)\n %(http://#{Panda::Config[:videos_domain]}/#{key})\n end", "def url\n return nil unless @uploader.upyun_bucket_host\n\n [@uploader.upyun_bucket_host, @path].join(\"/\")\n end", "def url\n File.join(server.url, path)\n end", "def to_s\n url\n end", "def url\n data['url']\n end", "def url\n @url ||= \"https://#{@host}/#{druid_without_prefix}.xml\"\n end", "def server_url\n url\n end", "def url\n storage.url_for(path_with_query)\n end", "def url\n URI.parse(\"#{protocol}://#{host}:#{port}#{store_uri}\")\n end", "def url_attribute\n @url\n end", "def url\n if @uploader.upyun_bucket_domain\n \"http://\" + @uploader.upyun_bucket_domain + '/' + @path\n else\n nil\n end\n end", "def url\n self.class.url\n end", "def http_audio_url\n https_audio_url.gsub(/\\Ahttps/, 'http')\n end", "def current_stream_url\n @ole.CurrentStreamURL\n end", "def s3_url\n establish_s3_connection\n bucket = self.datastreams[\"s3\"].bucket_values.first\n key = self.datastreams[\"s3\"].key_values.first\n AWS::S3::S3Object.url_for(key, bucket, :expires_in => 60 * 60 * 1.5)\n end", "def to_s; @url; end", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def download_uri\n @attributes[:download_uri]\n end", "def download_uri\n @attributes[:download_uri]\n end", "def url\n @attributes[:url]\n end", "def url\n @attributes[:url]\n end", "def soundcloud_url; \"https://soundcloud.com/#{soundcloud}\" end", "def url\n \[email protected]_s\n end", "def url\n create_episode_url(@slug)\n end", "def url\n get_attribute(Yoti::Attribute::APPLICATION_URL)\n end", "def url\n \"http://#{self.domain}/#{self.path}\"\n end", "def query_artist(artist_name = 'Dire+Straits')\n \"http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=#{artist_name}&api_key=1ca2cf614eeaa185c2b61753b434b599&format=json\"\n end", "def url\n @attributes.fetch('url', nil)\n end", "def url\n easy = EasyFactory.new(self).get\n url = easy.url\n Typhoeus::Pool.release(easy)\n url\n end", "def get_url\n URI.parse(\"#{@server}#{URL}\")\n end", "def download_uri\n return @download_uri\n end", "def initialize(artist, song)\n @provider = URI(\"http://lyrics.wikia.com/api.php?artist=#{sanitize_param artist}&song=#{sanitize_param song}&fmt=realjson\")\n end", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def getURL\r\n\t\t\t\t\treturn @url\r\n\t\t\t\tend", "def streaming_video_url\n # TODO figure out how to remove the need for this stupid hack\n # paperclip adds the cache buster to the URL automatically, I need\n # it to go away, probably a really easy paperclip option, but not\n # finding it at the moment.\n unless streaming_video.nil?\n streaming_video.data.url.split(\"?\")[0]\n else\n nil\n end\n end", "def artist\n artist = Spotify.album_artist!(pointer)\n Artist.new(artist) unless artist.null?\n end", "def initialize(artist, track)\n @artist = artist\n @track = track\n\n url =(\"https://api.spotify.com/v1/search?q=\" + track + \"&type=track\")\n\n response = HTTParty.get(url).parsed_response\n\n @uri = response['tracks']['items'][0]['uri']\n\n\n # ['artists']['items'][0]['uri']\n end", "def get_url\n @url\n end", "def url\n @parser.request_url\n end", "def podcast_url\n @podcast_url ||= File.join(PODCAST_URL_ROOT, self.path) if self.live?\n end", "def artist\n @artist #tells song its artist name\n end", "def url\n [ Configuration.url, @path ].join\n end", "def oembed_url\n 'https://www.slideshare.net/api/oembed/2?format=json&url='\\\n \"#{source_url}\"\n end", "def url\n ::File.join \"/\", path.to_s\n end", "def uri\n @_uri ||= URI(@url)\n end", "def uri\n @_uri ||= URI(@url)\n end", "def url\n @url ||= args.dig(:url)\n end", "def show\n\t\t@artist = Artist.find(params[:id])\n\t\tdownloader = ScDownloader.new\n\t\t@tracks = downloader.get_tracks(@artist)\n\tend", "def url\n @gapi[\"selfLink\"]\n end", "def url\n @gapi[\"selfLink\"]\n end", "def to_s\n url\n end", "def square_url\n square_uri.to_s\n end", "def snapshots_transport_destination_url; end", "def url\n URI.parse(endpoint).join(path.to_s).to_s\n end", "def youtube_url\n \"https://www.youtube.com/watch?v=#{@data['youtubeID']}\" if @data['youtubeID']\n end", "def to_url\n\t\t\tto_uri.to_s\n\t\tend", "def get_url\n\t\t@url = \"http://finance.yahoo.com/q?s=#{@big_symbol}\"\n\tend", "def url\n URI.join(host, sitemaps_path.to_s, filename.to_s).to_s\n end", "def url\n ::URI.join(\"#{service.service_url}/\", ::URI.escape(url_chunk)).to_s\n end" ]
[ "0.7382917", "0.71609527", "0.71308386", "0.7042859", "0.6936072", "0.67046183", "0.66134655", "0.66025156", "0.6545525", "0.6524978", "0.6522201", "0.648554", "0.64835656", "0.6435491", "0.64323115", "0.6432228", "0.64292574", "0.6423609", "0.64230716", "0.64230716", "0.64019597", "0.64019597", "0.6381553", "0.63523054", "0.62782043", "0.6273866", "0.6269319", "0.6236282", "0.6234874", "0.62274444", "0.6224427", "0.6200696", "0.61672354", "0.61652005", "0.61525446", "0.6146463", "0.6129181", "0.6125152", "0.61160946", "0.61051375", "0.6102754", "0.60715383", "0.6051358", "0.60487807", "0.60293025", "0.6024684", "0.6022258", "0.6019264", "0.6017272", "0.6014912", "0.60129166", "0.60094607", "0.6007874", "0.6002762", "0.59999365", "0.5999105", "0.5999105", "0.5984643", "0.5984643", "0.59806466", "0.59772307", "0.5976957", "0.59765637", "0.5971227", "0.5968266", "0.5961867", "0.5959168", "0.5959149", "0.5955537", "0.5952348", "0.5949113", "0.5949113", "0.5949113", "0.5949113", "0.5949113", "0.59444785", "0.5927728", "0.5924233", "0.5918459", "0.59157693", "0.5914615", "0.590493", "0.5903651", "0.5901801", "0.5900457", "0.5890539", "0.5890539", "0.5874804", "0.5874767", "0.58744353", "0.58744353", "0.58730274", "0.5863498", "0.58583355", "0.5852114", "0.5841037", "0.58304656", "0.58139575", "0.5813393", "0.58131623" ]
0.7149358
2
Description of the artist. Will fetch the information from Wikipedia. DEPRECATED! TODO: We should create a resource called "external_source" with all twitter/facebook/wikipedia/etc urls.
def info return "" p = localized_page return "" unless p && p.content logger.debug "parsing page #{p.title}" # extract the top-most section (the one before any ToC) c = WikiCloth::Parser.new({ :data => WikiParser::sanitize(p.content) }) c = c.sections.first l = I18n.locale ret = WikiParser.new({ :data => c }).to_html #I18n.locale = l return ret end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def biography artist\n url = \"http://developer.echonest.com/api/v4/artist/biographies?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\nend", "def description\n\t\ts = \"#{title}, a song \"\n\t\ts+= \"by #{artist.name} \" if artist\n\t\ts+= \"on Stoffi\"\n\tend", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def update_artist(artist)\n begin\n # Handle unknown artist\n if artist.name == Artist::UNKNOWN_ARTIST_NAME\n artist.wikilink = ''\n artist.save\n return\n end\n\n # Result is like this:\n search = search_text(artist.name, 1)\n\n if search.length == 0\n artist.wikilink = ''\n else\n artist.wikilink = search[0][1]\n end\n\n download_wiki_image(artist)\n rescue\n Log.log_last_exception(\"Error updating #{artist.to_s}\")\n artist.wikilink = ''\n end\n artist.save\n end", "def query_artist(artist_name = 'Dire+Straits')\n \"http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=#{artist_name}&api_key=1ca2cf614eeaa185c2b61753b434b599&format=json\"\n end", "def show\n @artist = @song.artist\n @artist_name = @artist ? @song.artist.name : \"no artist\"\n end", "def artist\n art = super\n if art.nil?\n art = Artist.new\n art.title = \"Unknown Artist\"\n end\n art\n end", "def artistInfo(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def artist\n @artist #tells song its artist name\n end", "def artist_details(artist)\n Scraper.scrape_individual_artist(artist) \n\n puts \"\"\n puts \"Here are more details about #{artist.name.bold}.\".black.on_light_white\n puts \"\"\n puts \"Representing Gallery: #{artist.gallery.name} \"\n puts \"\"\n puts \"Artist Bio: #{artist.bio}\"\n puts \"\"\n puts \"About the Artist : #{artist.about_art}\"\n puts \"\"\n\n end", "def artist_name\n if self.artist\n artist.name\n else\n nil\n end\n end", "def artist_name\n \tif self.artist\n \t\tself.artist.name\n \tend\n end", "def info(options={})\n get(:standard, {:method => \"artist.getInfo\"}.merge(options))\n end", "def artist_name\n nil\n end", "def artist_name\n if artist\n self.artist.name\n else\n nil\n end\n end", "def artist_name\n artist.name if artist\n end", "def artist_name\n self.artist.name\n end", "def artist_name\n self.artist.name\n end", "def artist_name\n self.artist.name\n end", "def artist_name\n self.artist.name\n end", "def artist\n @ole.Artist\n end", "def artist\n @artist\n end", "def artist\n @artist\n end", "def get_meta_artist \n send_cmd(\"get_meta_artist\")\n end", "def artist_name\n # self.artist.name\n self.artist ? self.artist.name : ''\n end", "def artist_name\n self.artist ? self.artist.name : nil\n end", "def artists\n link :top_artists, :Artist, country\n end", "def artist_name\n @artist.name if @artist\n end", "def artist\r\n @artist\r\n end", "def artist_name\n if self.artist == nil\n nil\n else\n self.artist.name\n end\n end", "def artist_name\n if self.artist\n self.artist.name\n else\n nil\n end\n end", "def new_artist\n Artist.new(\n name: tag_name,\n other_names: other_names,\n url_string: profile_urls.join(\"\\n\")\n )\n end", "def terms artist\n url = URI.parse(\"http://developer.echonest.com/api/v4/artist/terms?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\")\nend", "def name\n return @artist_data[\"name\"]\n end", "def display_artist(song)\n if song.artist.nil?\n link_to('Add Artist', edit_song_path(song)) \n else\n link_to(song.artist.name, artist_path(song.artist))\n end\n end", "def initialize(artist, song)\n @provider = URI(\"http://lyrics.wikia.com/api.php?artist=#{sanitize_param artist}&song=#{sanitize_param song}&fmt=realjson\")\n end", "def artist_name\n artist ? artist.name : ''\n end", "def artists\n link :top_artists, :Artist, name\n end", "def description\n metadata[:description]\n end", "def artist_social(artist)\n\t #-----------For Artist Meta Tags----------------\n\n\t #Page Title, Facebook Title and Twitter Title\n\t @social_title = artist.name+\" on Three Repeater\"\n\t #Meta description (google), Facebook Description, and Twitter Card Description\n\t @social_descrip = artist.bio\n\n\t #logic around figuring out which facebook url is used\n\t facebook_url(artist)\n\n\t #Twitter ID\n\t @social_twitter_name = artist.twitter_name\n\n\t #Image for twitter and FB\n\t @social_image = artist.logo.to_s\n\n\t #------------------------------------------------\n\n end", "def description\n meta['description'] || extract_description\n end", "def artist\n artist = Spotify.album_artist!(pointer)\n Artist.new(artist) unless artist.null?\n end", "def artist()\n sql = \"SELECT artist_name FROM artists WHERE id = $1\"\n values = [@artist_id]\n result = SqlRunner.run(sql, values)\n return result[0][\"artist_name\"]\n end", "def familiarity artist\n url = \"http://developer.echonest.com/api/v4/artist/familiarity?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\n result = parseURL url\n result[\"response\"][\"artist\"][\"familiarity\"]\nend", "def artist_name\n self.artist ? self.artist.name : nil\n end", "def f_artist\n fname_bits[-3] || 'unknown_artist'\n end", "def description\n info[\"Description\"]\n end", "def artist(value)\n @ole.Artist = value\n nil\n end", "def artist_name\n if self.name \n self.name\n else \n nil\n end \n end", "def artist(url: nil, name: nil)\n name = Utility::ArtistUrlParser.call(url) if url\n\n return [] if name.nil? || name.empty?\n\n Utility::ArtistLoader.call(agent, id, name)\n end", "def artist_name\n if self.artist #if song has an artist aka TRUE\n self.artist.name #return the artist name\n else\n nil #if no artist name return nil\n end\n end", "def artist\n artists.first\n end", "def artist_name_from_url\n urls.map { |url| url[PROJECT, :artist_name] || url[ARTIST, :artist_name] }.compact.first\n end", "def get_artist(id)\n @connection.get \"artists/#{id}\"\n end", "def artist\n\t\tArtist.find(artist_id)\n\tend", "def description\n \"Whois lookup\"\nend", "def artists\n if RESPONSE.code == 200\n # Return data to page\n JSON.parse(RESPONSE.to_s)['topartists']['artist']\n else\n # print error message\n \"Error Code #{RESPONSE.code}\"\n end\n end", "def artist_name\n self.artist.name if self.artist \n end", "def album_artist\n @ole.AlbumArtist\n end", "def set_artist\n @artist = Artist.friendly.find(params[:id])\n end", "def artist_name\n if self.artist == nil #findining artist of song\n nil\n else\n artist.name\n end\n end", "def description\n search_by_itemprop 'description'\n end", "def artist()\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql,values)\n artist_data = results[0]\n artist = Artist.new(artist_data)\n end", "def about_us\n # it's deliberate that there's no code in here... but we should have a helpful error when we request the URL again\n end", "def artist_name\n self.try(:artist).try(:name)\n end", "def artist_name\n self.try(:artist).try(:name)\n end", "def artist_name\n self.try(:artist).try(:name)\n end", "def title\n \"#{artist.name} - #{name} [#{release.catalog_number}]\"\n end", "def show\n @artist = Artist.find(params[:id])\n end", "def descr\n return text_get(2, id)\n end", "def artist()\n sql = \"SELECT * FROM artists WHERE id = $1\"\n values = [@artist_id]\n result = SqlRunner.run(sql, values)[0]\n return Artist.new(result)\n end", "def artist(string)\n PRESETS[:artist].fetch(string.to_sym,\n title(string).gsub('and the ', 'and The '))\n end", "def title\n \"#{@artist} - #{@name} (#{@length})\"\n end", "def meta_description\n # Change the value below between the quotes.\n \"File Repository for EZ Troubleshooter\"\n end", "def artist_name\n self.artists.collect do |artist|\n artist.name\n end\n end", "def artist\n\t\tartists == nil ? nil : artists.first\n\tend", "def show\n @artist = @album.artist\n end", "def tag_name\n artist_name\n end", "def full_name\n\t\ts = title\n\t\ts = \"#{artist.name} - #{s}\" if artist\n\t\treturn s\n\tend", "def description\n fetch('restaurant.description')\n end", "def set_artist\n @artist = Artist.friendly.find(params[:id])\n end", "def description\n return nil if info.nil?\n info[:description]\n end", "def description\n response_json = @client.api_get_request('', 'tree=description')\n response_json['description']\n end", "def display_artist_info(artist_id)\n\t\tif @artist_list.has_key? artist_id then @artist_list[artist_id].print()\n\t\telse puts \"Artist with ID #{artist_id} does not exist in database!\" end\n\tend", "def description\n\t\"Search twitter for this username.\"\nend", "def meta_description\n read_attribute(:meta_description).blank? ? self.intro[0, 255] : read_attribute(:meta_description)\n end", "def description\n metadata[dataset_uri][dct.description.to_s][0] rescue nil\n end", "def description\n data['description']\n end", "def show\n @query = params[:id].gsub('+', ' ')\n @autoplay = params[:autoplay]\n \n begin\n @artist = LastfmArtist.new(@query, @lastfm, true)\n rescue\n @artist = nil\n end\n \n unless @artist\n not_found\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @artist }\n end\n end", "def description; @text; end", "def show\n results = Dbpedia.sparql.query(\"SELECT ?person ?abstract ?name WHERE {\n ?person rdf:type <http://dbpedia.org/ontology/Person>.\n ?person foaf:name ?name.\n ?person dbpedia-owl:abstract ?abstract .\n FILTER (LANG(?abstract)='pl' && ?name=\\\"\"[email protected]_name+\"\\\"@en)\n }\")\n if results.first != nil\n @bio=results.first[:abstract] \n end\n end", "def description\n data[:description]\n end", "def description\n data[:description]\n end", "def get_artist\n Artist.find(params[:id])\n end", "def get_info\n doc = Hpricot(open(noaa_url))\n puts noaa_url\n if !self.description\n doc.search(\"h1\").each do |elem| \n desc = elem.inner_html\n # remove imbeded links in the middle of the description\n desc.gsub!(/\\<a.href.*?\\<\\/a\\>/,' ')\n self.description = desc\n puts self.description\n self.save\n end\n end\n if !self.geo_location\n begin\n elems = doc.search(\"p/b\").to_a.map{|elm| elm.inner_html}\n if elems[1] == \"Owned and maintained by National Data Buoy Center\"\n puts elems[4]\n self.geo_location = elems[4]\n self.save\n end\n rescue\n end \n end\n end", "def description\n @description = \"Dark Roast Coffee\"\n end", "def full_description\n\t\t\t\"#{@name}\\n\\nYou are in #{@description}\"\n\t\tend", "def artist_name_and_genre\n \"#{artist_name} - #{genre.name}\"\n end", "def artist=(artist)\n @artist = artist\n end", "def artist=(artist)\n @artist = artist\n end", "def artist=(artist)\n @artist = artist\n end" ]
[ "0.713922", "0.7042694", "0.69483167", "0.6712117", "0.6679223", "0.6636209", "0.6632982", "0.65864205", "0.64998525", "0.64984953", "0.64162904", "0.641354", "0.6406691", "0.64031464", "0.6357529", "0.6349998", "0.6274402", "0.6274402", "0.6274402", "0.6274402", "0.6272282", "0.6269541", "0.6269541", "0.6251644", "0.6237262", "0.62366724", "0.6235996", "0.6234548", "0.623109", "0.6222088", "0.62191266", "0.62037194", "0.61937064", "0.61661273", "0.6164688", "0.61636806", "0.61370814", "0.61357903", "0.6125957", "0.61215615", "0.6117405", "0.61063427", "0.6099333", "0.6096047", "0.60725117", "0.6065958", "0.60433084", "0.60371184", "0.6033396", "0.60232407", "0.60125387", "0.5990938", "0.5985258", "0.59694445", "0.5967854", "0.5954297", "0.59488416", "0.5938129", "0.59289765", "0.59211004", "0.5914413", "0.59116614", "0.5906113", "0.59002656", "0.58837545", "0.58837545", "0.58837545", "0.5872024", "0.58672357", "0.5853735", "0.584571", "0.5831661", "0.58270746", "0.58265465", "0.58245766", "0.58239913", "0.58174473", "0.5810204", "0.5795984", "0.5792811", "0.57884777", "0.57735306", "0.5771739", "0.5770777", "0.5766955", "0.57605994", "0.57597494", "0.5754482", "0.5751942", "0.5744386", "0.5738311", "0.5738182", "0.5738182", "0.57366896", "0.5733003", "0.5725421", "0.57178587", "0.57099456", "0.5701856", "0.5701856", "0.5701856" ]
0.0
-1
The URL to the artist on Wikipedia. DEPRECATED!
def wikipedia_link p = localized_page base = "https://#{langtag(I18n.locale)}.wikipedia.org" return base unless p && p.title "#{base}/wiki/#{p.title}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wikipedia\n uri = nil\n @artist_data[\"relations\"].each do |rel|\n if rel[\"type\"] == \"wikipedia\"\n uri = rel[\"url\"][\"resource\"]\n end\n end\n return uri\n end", "def wikimedia_url(metadata)\n links = metadata.split(\"\\n\")\n @url = ''\n links.each do |meta|\n if meta.include?('archive_url:') and !meta.include?('old_archive_url:')\n @url = meta.split('archive_url:').last\n end\n end \n return @url\n end", "def lastfm_url; \"https://last.fm/music/#{lastfm}\" end", "def wikipedia_url\n \"http://en.wikipedia.org/wiki/ISO_639:#{iso_639}\"\n end", "def wikisource_url(metadata)\n links = metadata.split(\"\\n\")\n @url = ''\n links.each do |meta|\n if meta.include?('wikisource_url:')\n @url = meta.split('wikisource_url:').last\n end\n end \n return @url\n end", "def url\n return if article.nil?\n title = article.escaped_full_title\n \"#{wiki.base_url}/w/index.php?title=#{title}&diff=prev&oldid=#{mw_rev_id}\"\n end", "def wikipedia_link\n to_nil _response_entity.fetch(\"wikiLink\", nil)\n end", "def spotify_url; \"http://open.spotify.com/artist/#{spotify}\" end", "def update_artist(artist)\n begin\n # Handle unknown artist\n if artist.name == Artist::UNKNOWN_ARTIST_NAME\n artist.wikilink = ''\n artist.save\n return\n end\n\n # Result is like this:\n search = search_text(artist.name, 1)\n\n if search.length == 0\n artist.wikilink = ''\n else\n artist.wikilink = search[0][1]\n end\n\n download_wiki_image(artist)\n rescue\n Log.log_last_exception(\"Error updating #{artist.to_s}\")\n artist.wikilink = ''\n end\n artist.save\n end", "def htlal_wiki_url\n \"http://learnanylanguage.wikia.com/wiki/#{name.gsub(' ', '_')}\"\n end", "def wiki_url\n \"https://hq.songbirdnest.com/wiki/index.php?title=Release:#{name}_Iteration_Notes#Iteration_#{@number}\"\n end", "def url\n\t\t\"#{base}/wiki/#{page}\"\n\tend", "def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end", "def facebook_url(artist)\n\t if artist.fb_page_url.blank?\n\t\t @social_fb_url = artist_link_url(artist.url_slug)\n\t else\n\t\t @social_fb_url = artist.fb_page_url\n\t end\n end", "def url() \n\t #'http://' << ENV['DOMAIN'] << \n\t '/' << self.author.username.to_s << '/' << self.name.to_s\n end", "def artist_name\n if artist_name_from_url.present?\n artist_name_from_url\n elsif api_metadata.present?\n api_metadata.dig(:author, :username)\n else\n nil\n end\n end", "def get_wiki_url(query)\n search_keywords = query.strip.gsub(/\\s+/,'+')\n url = \"http://www.google.com/search?q=#{search_keywords}+site%3Aen.wikipedia.org&safe=active\"\n begin\n doc = Hpricot(open(url, \"UserAgent\" => \"reader\"+rand(10000).to_s).read)\n result = doc.search(\"//div[@id='ires']\").search(\"//li[@class='g']\").first.search(\"//a\").first\n rescue\n return ''\n end\n if result\n return result.attributes[\"href\"]\n else\n return ''\n end\n end", "def terms artist\n url = URI.parse(\"http://developer.echonest.com/api/v4/artist/terms?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\")\nend", "def biography artist\n url = \"http://developer.echonest.com/api/v4/artist/biographies?api_key=#{ECHONEST_API_KEY}&name=#{artist}&format=json\"\nend", "def initialize(artist, song)\n @provider = URI(\"http://lyrics.wikia.com/api.php?artist=#{sanitize_param artist}&song=#{sanitize_param song}&fmt=realjson\")\n end", "def artists\n link :top_artists, :Artist, country\n end", "def user_url(user)\n \"http://last.fm/user/\" + user\n end", "def url_create(state_code, city_name)\n 'http://en.m.wikipedia.org/wiki/' + self.url_suffix_create(state_code, city_name)\n end", "def artist_name_from_url\n urls.map { |url| url[PROJECT, :artist_name] || url[ARTIST, :artist_name] }.compact.first\n end", "def full_url\n\t\tcase typ\n\t\twhen /wikipedia_(..)/\n\t\t\treturn \"http://\"+$~[1]+\".wikipedia.org/wiki/\"+url\n\t\twhen \"gutenberg.org\"\n\t\t\treturn \"http://www.gutenberg.org/author/\"+url\n\t\twhen \"gutenberg.spiegel.de\"\n\t\t\treturn \"http://gutenberg.spiegel.de/autoren/\"+url+\".htm\"\n\t\twhen \"fictionfantasy.de\"\n\t\t\treturn \"http://www.fictionfantasy.de/load.php?name=News&file=article&sid=\"+url\n\t\twhen \"homepage\", \"sonstiges\"\n\t\t\t# return url\n\t\telse\n\t\t\t# return url\n\t\tend\n\t\tif url.starts_with? \"http://\" then\n\t\t\treturn url\n\t\telse\n\t\t\treturn \"http://\"+url\n\t\tend\n\t\t# TODO\n\t\t# dsfdb.org, isfdb.org\n\t\t# perrypedia, perry-rhodan.net link\n\t\t# http://www.nemesisarchiv.de.vu/\n\tend", "def url\n \"http://twitter.com/search/?q=\" + self.query\n end", "def human_url\n return self.alternate_link\n end", "def normalize_for_artist_finder\n profile_url.presence || url\n end", "def artists\n link :top_artists, :Artist, name\n end", "def url\n if Henshin.local?\n permalink\n else\n permalink.sub /index\\.html$/, ''\n end\n end", "def arlocal_public_artist_home_link(arlocal_settings)\n link_to @arlocal_settings.artist_name_downcase, root_path, class: :arl_header_artist_name\n end", "def url\n ''\n end", "def youtube_url\n return \"https://www.youtube.com/results?search_query=#{CGI.escape(self.name)}\"\n end", "def get_tracks_url(album)\n tracks_url = ''\n if album.first == 'Twist and Shout' || album.first == 'A Hard Day\\'s Night' || album.first == 'Yellow Submarine'\n tracks_url = \"https://en.wikipedia.org/wiki/#{album.first} (album)\"\n elsif album.first == 'Something New' || album.first == 'Revolver' || album.first == 'Let It Be'\n tracks_url = \"https://en.wikipedia.org/wiki/#{album.first} (Beatles album)\"\n elsif album.first == 'The Beatles (\"The White Album\")'\n tracks_url = \"https://en.wikipedia.org/wiki/The_Beatles_(album)\"\n else\n tracks_url = \"https://en.wikipedia.org/wiki/#{album.first}\"\n end\n return tracks_url\nend", "def text_url\n link_uri\n end", "def download_wiki_image(artist)\n\n # Check if the artist image already exists\n return if artist.image_path(:medium)\n\n image_url = get_wikipedia_image_url(artist.wikilink)\n MetaGeneration::download_artist_image(artist, image_url)\n end", "def link_wikipedia(term, desc)\n # query = Rack::Utils.escape(\"site:wikipedia.org #{term}\")\n # href = \"http://google.com/?q=#{query}\"\n term = Rack::Utils.escape(term)\n tag(:a, desc, :href => \"http://en.wikipedia.org/w/#{term}\", :class => 'wiki-link-external')\n end", "def link() url; end", "def link() url; end", "def url\n end", "def website_url; website end", "def canonical_uri; end", "def twitter_url; \"https://twitter.com/#{twitter}\" end", "def my_url\n url 'my'\n end", "def query_artist(artist_name = 'Dire+Straits')\n \"http://ws.audioscrobbler.com/2.0/?method=artist.getinfo&artist=#{artist_name}&api_key=1ca2cf614eeaa185c2b61753b434b599&format=json\"\n end", "def url(prefix, stem)\n if prefix == ''\n \"/#{stem}/#{self.id}\"\n else\n \"#{prefix}/#{stem}/#{self.id}\"\n end\n end", "def url\n raise NotImplementedError, 'this should be overridden by subclass'\n end", "def url\n self.name\n end", "def display_artist(song)\n if song.artist.nil?\n link_to('Add Artist', edit_song_path(song)) \n else\n link_to(song.artist.name, artist_path(song.artist))\n end\n end", "def url\n end", "def permalink\n return \"#{uri}\"\n end", "def ward_url\n \"/ward/\"+self.name.sub(/^St\\./,'St').gsub(' ','_')\n end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url; end", "def url\n \"/article/#{self.to_param}\"\n end", "def url\n uri.to_s\n end", "def url_for_taxon(taxon)\n new_url = self.url.sub('[NAME]', taxon.name)\n if taxon.species_or_lower? && pieces = taxon.name.split\n new_url.sub!('[GENUS]', pieces.first)\n new_url.sub!('[SPECIES]', pieces[1] || '')\n else\n new_url.sub!(/\\[GENUS\\].*\\[SPECIES\\]/, taxon.name)\n end\n new_url\n end", "def youtube_url; \"https://youtube.com/user/#{youtube}\" end", "def conceptwiki_ep_search\n\t\tOPS_API_FREETEXT_SEARCH_URL\n\tend", "def geoserver_url(record)\n return settings['geoserver.stan_url'] if record.stanford_only?\n\n settings['geoserver.pub_url']\nend", "def get_wikipedia_image_url(wikipedia_url)\n begin\n\n return nil if !wikipedia_url || wikipedia_url.empty?\n\n # Download the wikipedia page\n page = Nokogiri::HTML(open(wikipedia_url))\n\n # Get the image href:\n link = page.css( @settings.image_selector ).first\n return if !link\n image_href = link.attr('href')\n image_href = URI.unescape(image_href)\n # image_href => '/wiki/Archivo:Metallica_at_The_O2_Arena_London_2008.jpg'\n\n # Get the image \"id\":\n slash_idx = image_href.rindex('/')\n return if !slash_idx\n image_id = image_href[ slash_idx + 1 .. -1 ]\n # image_id => 'Archivo:Metallica_at_The_O2_Arena_London_2008.jpg'\n\n # Get the full URL:\n # /w/api.php?action=query&prop=imageinfo&format=json&iiprop=url&titles=Archivo%3AMetallica_at_The_O2_Arena_London_2008.jpg\n image_info = Wikipedia.client.request( {\n action: 'query',\n prop: 'imageinfo',\n iiprop: 'url',\n titles: image_id,\n format: 'json'\n } )\n # result => {\n # \"batchcomplete\": \"\",\n # \"query\": {\n # \"normalized\": [\n # {\n # \"from\": \"Archivo:Metallica_at_The_O2_Arena_London_2008.jpg\",\n # \"to\": \"Archivo:Metallica at The O2 Arena London 2008.jpg\"\n # }\n # ],\n # \"pages\": {\n # \"-1\": {\n # \"ns\": 6,\n # \"title\": \"Archivo:Metallica at The O2 Arena London 2008.jpg\",\n # \"missing\": \"\",\n # \"imagerepository\": \"shared\",\n # \"imageinfo\": [\n # {\n # \"url\": \"https://upload.wikimedia.org/wikipedia/commons/0/07/Metallica_at_The_O2_Arena_London_2008.jpg\",\n # \"descriptionurl\": \"https://commons.wikimedia.org/wiki/File:Metallica_at_The_O2_Arena_London_2008.jpg\"\n # }\n # ]\n # }\n # }\n # }\n # }\n image_info = search = JSON.parse(image_info)\n\n image_url = image_info['query']['pages']['-1']['imageinfo'][0]['url']\n return image_url\n rescue\n Log.log_last_exception\n return nil\n end\n end", "def url_for_taxon(taxon)\n new_url = url.sub('[NAME]', taxon.name)\n new_url = new_url.sub('[RANK]', taxon.rank)\n new_url = new_url.sub('[NAME_WITH_RANK]', taxon.name_with_rank)\n if taxon.species_or_lower? && pieces = taxon.name.split\n new_url.sub!('[GENUS]', pieces.first)\n new_url.sub!('[SPECIES]', pieces[1] || '')\n else\n new_url.sub!(/\\[GENUS\\].*\\[SPECIES\\]/, taxon.name)\n end\n new_url\n end", "def url\n @author_url ||= begin\n \"http://twitter.com/#{self.screenname}\" if self.screenname\n end\n end", "def base_url\n 'http://ow.ly/api/1.1/url/shorten'\n end", "def url\n puts url\n \"article/#{url}\"\n puts \"right\"\n end", "def url\n \[email protected]_s\n end", "def url\n @url.to_s\n end", "def url\n uri.to_s\n end", "def to_s\n url\n end", "def main_url\n return nil unless twitter\n \"http://twitter.com/#{twitter.downcase}\"\n end", "def artist_params\n params.require(:artist).permit(:name, :wikilink)\n end", "def original_url; end", "def url\n @doc.url\n end", "def national_archive_url\n \"http://webarchive.nationalarchives.gov.uk/#{tna_timestamp}/#{old_url}\"\n end", "def learn_url\n \"http://learn.uwaterloo.ca\"\n end", "def documentation_url; end", "def to_s\n url\n end", "def information_url=(value)\n @information_url = value\n end", "def information_url=(value)\n @information_url = value\n end", "def mediawiki_link\n return nil unless @name\n \"[[#{@name}]]\"\n end", "def to_s; @url; end", "def information_url\n return @information_url\n end", "def information_url\n return @information_url\n end" ]
[ "0.7347838", "0.71356297", "0.70432323", "0.6865283", "0.6863208", "0.683811", "0.66920805", "0.6576479", "0.6498456", "0.6448711", "0.6418263", "0.6374906", "0.637116", "0.6325014", "0.6290413", "0.6200087", "0.6172314", "0.6169388", "0.61571443", "0.6154253", "0.6091112", "0.6055742", "0.6040407", "0.60368073", "0.60314727", "0.6017226", "0.5999783", "0.59886354", "0.5985436", "0.5979202", "0.59519374", "0.59501535", "0.59417194", "0.5918004", "0.5891615", "0.5890608", "0.5872372", "0.58370054", "0.58370054", "0.58261675", "0.58244663", "0.5818125", "0.5812128", "0.5809592", "0.58004034", "0.5797238", "0.57925266", "0.57797813", "0.57734585", "0.5768514", "0.57627434", "0.57615155", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5760272", "0.5745942", "0.5734591", "0.57260895", "0.57226056", "0.5710306", "0.56972414", "0.5695357", "0.56912696", "0.5689023", "0.56870013", "0.56745005", "0.5674211", "0.567376", "0.5672599", "0.56718993", "0.56585675", "0.5652826", "0.5649613", "0.56477845", "0.5647286", "0.5633128", "0.5628657", "0.56285256", "0.5623945", "0.5623945", "0.5609466", "0.560613", "0.56006896", "0.56006896" ]
0.6917309
3
Whether the artist is unknown.
def unknown? return name.to_s == "" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def unknown?\n false\n end", "def artist?\n end", "def empty?\n @artists.empty?\n end", "def unknown?\n status == 'Unknown'\n end", "def unknow\r\n return false unless unknow?\r\n @unknow.shift\r\n end", "def unknown?\n @value.nil?\n end", "def unknown?; false; end", "def unknown?; false; end", "def unknown?\n @type == 'TYPE_UNSPECIFIED'\n end", "def unknown?\n text_name == \"Fungi\"\n end", "def unknown?\n\t\treturn ( major.text.include?('InsufficientInformation') )\n\tend", "def checkUnspeakableArtist(artist)\n artist.strip!.downcase!\n case artist\n when \"full beat\"\n log \"Changed '#{artist}' into Volbeat\"\n return \"volbeat\"\n when \"a full beat\"\n log \"Changed '#{artist}' into Volbeat\"\n return \"volbeat\"\n when \"the full beats\"\n log \"Changed '#{artist}' into Volbeat\"\n return \"volbeat\"\n when \"soul fly\"\n log \"Changed '#{artist}' into Soulfly\"\n return \"soulfly\"\n when \"so fly\"\n log \"Changed '#{artist}' into Soulfly\"\n return \"soulfly\"\n else\n log \"Changed nothing for '#{artist}'\"\n return artist\n end\n end", "def artist_name\n nil\n end", "def unknown?\n kind == NODE_UNKNOWN\n end", "def artificial?\n @attributes[\"artificial\"] ? @attributes[\"artificial\"] == \"1\" : false\n end", "def unspecified?\n @name.nil? or @name == 'Unspecified'\n end", "def missing?\n @missing\n end", "def artist_name\n if self.artist == nil #findining artist of song\n nil\n else\n artist.name\n end\n end", "def has_example?\n false\n end", "def valid_artist_name?\n\t\t\tif params[:artist].empty?\n\t\t\t\tflash[:danger] = \"Please enter an artist name\"\n\t\t\t\tredirect_to search_artist_path\n\t\t\tend\n\t\tend", "def unknown?\n home_team.nil? && away_team.nil?\n end", "def artist_name\n if self.artist #if song has an artist aka TRUE\n self.artist.name #return the artist name\n else\n nil #if no artist name return nil\n end\n end", "def artist_name\n artist ? artist.name : ''\n end", "def metadata?\n !!@metadata\n end", "def metadata?\n !!@metadata\n end", "def bogus?\n !! self.bogosity\n end", "def all_same_artist?(tags)\n all_same_tag?(tags, :artist)\n end", "def measurement_not_present?\n @event.measurement.blank? || @event.measurement_type.blank?\n end", "def has_essay?\n essay != nil\n end", "def set_artist\n\n\tartist = Artist.find_by_artist_name(self.artist_name)\n\t if artist != nil \n\t\t self.artist_name = artist\n\t\t return true\n\t else\n\t\terrors.add_to_base(\"combination of: 'artist_name' is invalid- it must be unique\")\n\t\t return false\n\tend\nend", "def lastfm?; lastfm.to_s != \"\" end", "def unidentified?\n @unidentified ||= ids.values.all?(&:blank?)\n end", "def sv_missing_etymology\n true # see Protonym\n end", "def undetermined?\n undetermined == 'true'\n end", "def unknown?\n !dir? && !file? && !symlink? && !device?\n end", "def audio?\n @descriptive_detail.audio?\n end", "def spotify?; spotify.to_s != \"\" end", "def not_tracked?\n\t\treturn self.status == '?'\n\tend", "def has_played?\n stats != nil\n end", "def artist_name\n if self.artist == nil\n nil\n else\n self.artist.name\n end\n end", "def audio_without_closed_captions?\n audio? && closed_captions.blank?\n end", "def artist_name\n if self.artist == nil \n nil \n else self.artist.name \n end \nend", "def artist_name\n if artist\n self.artist.name\n else\n nil\n end\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 artist_name\n self.artist ? self.artist.name : nil\n end", "def show_unplayed_by artist\n if $albums.any?\n x = nil\n artist_unplayed = []\n $albums.each do |album, status|\n if album[1].downcase == artist.downcase\n if status == \"unplayed\"\n puts \"#{album[0]} by #{album[1].gsub('\"', '')}\"\n artist_unplayed.push(album)\n x = true\n end\n end\n end\n if x == true\n return artist_unplayed\n else\n puts \"You don't have any unplayed albums by that artist.\"\n end\n else\n puts \"You don't have any albums! You should add some.\"\n end\nend", "def f_artist\n fname_bits[-3] || 'unknown_artist'\n end", "def is_unknown_url? url\n @urls.count_documents(url:url) == 0\n end", "def artist_name\n self.artist ? self.artist.name : nil\n end", "def knows?(name)\n false\n end", "def artist_name\n if self.artist\n self.artist.name\n else\n nil\n end\n end", "def undefined?\n true\n end", "def album_name_unique?(album_name, artist_name) \n album_names = self.albums.select{|album| album.artist.present?}\n .select{|album| album.artist.name == artist_name}\n .map{|album| album.name}\n\n album_names.select{|name| name == album_name}.blank?\n \n end", "def artist_name\n if self.artist\n artist.name\n else\n nil\n end\n end", "def has_unplayed_hands()\n @current_hand < @hands.length\n end", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def unknown?\n !root? && !child?\n end", "def ok?\n [ :remote_addr, :price, :subscription_id, :transaction_id, :checksum , :jurnalo_user_id ].inject( true ){ |s,x| s && !(send(x).blank?) }\n end", "def non_musical_sound_recording?\n marc_leader_06_match = record.leader.byteslice(6) == 'i'\n\n marc_006_match = record.fields('006').find do |field|\n field.value.byteslice(0) == 'i'\n end\n\n return true if marc_leader_06_match || marc_006_match\n end", "def homme?\n !identified? || sexe == 'H'\n end", "def has_audio?\n return !!get_audio\n end", "def artist_name\n if self.name \n self.name\n else \n nil\n end \n end", "def ignored?\n !!ignored\n end", "def is_nude?\n return armor3_id == 0\n end", "def missing?\n\t\treturn self.status == '!'\n\tend", "def irrelevant?\n video.nil? && manuscript.nil? && external_reference_link.blank?\n end", "def not_found?\n @flags.empty?\n end", "def artist_name\n @artist.name if @artist\n end", "def is_known?\n describe ? true : false\n end", "def missing_nickname?\n !current_user.nickname\n end", "def series_hidden?(chart)\n chart.genre != \"games\" || chart.kind.include?(\"ipad\")\n end", "def unnamed?\n return @name == nil || @name.size == 0\n end", "def has_meta_description?\n !!meta_description\n end", "def ignored?\n marking == \"IGNORED\"\n end", "def songs_never_played\n return @tracks.find_all {|s| s.play_count == 0}\n end", "def recognized?\n return !self.etypes.empty?\n end", "def suitable_for_none?\n \treturn self.disciplines.empty?\n end", "def empty?\n _autonyms.none?{|autonym|@db.has_key? autonym}\n end", "def empty?\n _autonyms.none? { |autonym| @db.key?(autonym) }\n end", "def metadata?\n [email protected]? && [email protected]?\n end", "def mne?(y, md)\n !meq?(y, md)\n end", "def dummy?\n @type.nil?\n end", "def has_song?(song)\n songs.include?(song)\n end", "def has_questions_without_visualizer?\n questions.any? { |q| !q.visualizer_set? }\n end", "def info?\n false\n end", "def no_245_has_ak?\n no_fields?(tag: '245', complex_subfields: [[:has, code: /[ak]/]])\n end", "def uncertain?\r\n @@maybes\r\n end", "def empty_meta_keywords?\n return meta_empty?(\"keywords\")\n end", "def artist_name\n self.artist.name if self.artist \n end", "def any_unrecognized_keys?(expected, given)\n unrecognized_keys(expected, given).any?\n end", "def aye?\n true\n end", "def ignored?()\n #This is a stub, used for indexing\n end", "def unnamed?\n @graph_name.nil?\n end", "def has_sound?\n @has_sound = if @movie_info[:format][:nb_streams] == 1\n false\n elsif @movie_info[:format][:nb_streams] == 2\n true\n end\n end", "def new_artist_or_nah(request_artist)\n artist = Artist.find_by name: request_artist\n if artist == nil\n Artist.create(name: request_artist)\n else\n artist\n end \n end", "def valid?\n return (@kind != ACTNone)\n end", "def artist\n art = super\n if art.nil?\n art = Artist.new\n art.title = \"Unknown Artist\"\n end\n art\n end", "def missing?(obj)\n obj.to_s.strip.empty?\n end", "def pixi_post?\r\n !pixan_id.blank?\r\n end" ]
[ "0.7624217", "0.7250223", "0.7027815", "0.6800006", "0.67919683", "0.6752339", "0.6735627", "0.6735627", "0.66862553", "0.6485469", "0.6372836", "0.63648164", "0.62932646", "0.6274074", "0.6255854", "0.6246771", "0.6219317", "0.618793", "0.61641854", "0.61253756", "0.6112488", "0.6098108", "0.6094954", "0.6092978", "0.6092978", "0.6069529", "0.6065333", "0.6060249", "0.6049657", "0.60383743", "0.6021682", "0.60060334", "0.59887505", "0.59884673", "0.5986344", "0.5981572", "0.5978931", "0.59752905", "0.59600323", "0.59516764", "0.5931878", "0.5927405", "0.59190375", "0.5903306", "0.5898803", "0.5896733", "0.5896316", "0.5884907", "0.58789515", "0.58752036", "0.5870847", "0.58675253", "0.58435005", "0.58269507", "0.5818839", "0.58116436", "0.58116436", "0.58116436", "0.5806114", "0.5802626", "0.5801432", "0.5793825", "0.57928693", "0.5789692", "0.5787908", "0.5782651", "0.5777832", "0.5776312", "0.57732105", "0.575729", "0.57510495", "0.5746085", "0.5743217", "0.57381153", "0.5732881", "0.5729603", "0.5729327", "0.57240367", "0.5720081", "0.5715273", "0.57128084", "0.57110614", "0.5709845", "0.5701586", "0.57013637", "0.5692815", "0.5689716", "0.568817", "0.56859833", "0.567642", "0.5667503", "0.5664621", "0.5657033", "0.56514686", "0.56492174", "0.5643907", "0.5638599", "0.5637445", "0.5626505", "0.56263894" ]
0.70410854
2
The string to display to users for representing the resource.
def display name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def resource_human_name\n resource_class.model_name.human\n end", "def readable\n resource.nil? ? name.humanize : \"#{name.humanize}: #{resource.name}\"\n end", "def display_resource(user)\n \"User #{user.email}\"\n end", "def pretty_resource_name\n Heroics.pretty_name(resource_name)\n end", "def display_resource(rainwork)\n \"RW \\\"#{rainwork.name}\\\"\"\n end", "def display_resource(expert)\n \"#{expert.first_name} #{expert.last_name}\"\n end", "def display_resource(user)\n user.display_name\n end", "def resource_label\n resource_name.translate count: 1,\n default: resource_name.to_s.gsub(\"::\", \" \").titleize\n end", "def display_resource(product)\n \"#{product.english_title}\"\n end", "def to_label\n (@model_decorator.guess_title(@resource) || primary_key_value).to_s\n end", "def to_s\n result = if @resource_type\n # @resource_id.inspect displays 'nil' when the DB column is nil\n \"#{@resource_type}_id = #{@resource_id.inspect}\"\n else\n \"No resource found\"\n end\n \"#{result} (for handle '#{@handle_string}')\"\n end", "def resource_title\n if resourceful? && resource\n resource.respond_to?(:name) ? resource.name.humanize : resource.id\n else\n 'show'\n end\n end", "def resource_name\n return @resource_name\n end", "def resource_name\n return @resource_name\n end", "def resource_name\n return @resource_name\n end", "def resource_text\n nil\n end", "def resource_name\n @resource_name ||= plural_name\n end", "def display_resource(user)\n \"#{user.first_name} - #{user.last_name}\"\n end", "def display_resource(recipe)\n \"Recipe ##{recipe.id} - #{recipe.name}\"\n end", "def display_resource(region)\n \"#{region.name}\"\n end", "def display_resource(device_type)\n \"Device Type ##{device_type.to_param}\"\n end", "def display_resource(priority)\n \"#{priority.label}\"\n end", "def display_name\n NAME\n end", "def display_name\n NAME\n end", "def display_resource(device_property)\n \"Device Property ##{device_property.to_param}\"\n end", "def display_resource(cause)\n cause.name\n end", "def display_resource(user)\n user.full_name\n end", "def display_resource(user)\n user.name\n end", "def name\n @resource.name\n end", "def display_str\n \"#{objective.code} - #{short_desc}\"\n end", "def display_resource(device)\n \"Device ##{device.to_param}\"\n end", "def display_resource(building)\n \"#{building.name}\"\n end", "def display_resource(findingaid)\n \"#{findingaid.name}\"\n end", "def resource_name\n resource_specification.name\n end", "def resource_title(options = {})\n I18n.t(\"power_resource.titles.#{resource_name}.resource\",\n { default: \"#{resource_human_name} #{resource.id}\" }.merge(options) )\n end", "def to_s\n return \"#{self.name}\"\n end", "def resource\n \"#{quality}.#{format}\"\n end", "def display_resource(user)\n \"#{user.email}\"\n end", "def name\n if resource_class.respond_to?(:human_attribute_name)\n resource_class.human_attribute_name(attribute)\n else\n attribute.to_s.titleize\n end\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def to_s\n long_display\n end", "def display_resource(tutor)\n \"#{tutor.full_name} - #{tutor.id}\"\n end", "def resource_text_from_controller\n internationalized_resource_name(controller_name.singularize.camelize, false)\n end", "def resource_text_from_controller\n internationalized_resource_name(controller_name.singularize.camelize, false)\n end", "def display_resource(ability)\n ability.name\n end", "def resource_name\n @resource_name\n end", "def resource_name\n resource_class.resource_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def display_name\n return @display_name\n end", "def to_resource_name\n singularize.underscore\n end", "def display_name\n return @display_name\n end", "def display_resource(deal)\n \"Deal ##{deal.id} #{deal.item.name}/#{deal.profile.name} #{deal.profile.phone}\"\n end", "def ar_label resource= @resource\n return controller.ardata.labels[:nil_value_in_field] unless resource\n if controller.ardata.links.include? :show\n link_to(resource.label || \"-\", ar_resource_path('', resource))\n else\n resource.label || \"-\"\n end\n end", "def toString\n #Not sure if we want this or just use the getters for more\n #selective formatting\n end", "def resource_id\n return \"%s:%s\" % [self.resource_type, self.id]\n end", "def display_name\n return @display_name\n end", "def display_resource(event)\n event.name\n end" ]
[ "0.729786", "0.70247763", "0.69972306", "0.6969162", "0.6936868", "0.6882295", "0.6855878", "0.6852109", "0.6843258", "0.6839116", "0.68339336", "0.6831978", "0.6814645", "0.6814645", "0.6814645", "0.6798404", "0.67734694", "0.6764966", "0.67486507", "0.6746355", "0.6698679", "0.66778785", "0.6676089", "0.6676089", "0.66676724", "0.6660066", "0.6659025", "0.66536665", "0.6652013", "0.66482687", "0.664638", "0.6643753", "0.66338825", "0.6624849", "0.662251", "0.66106844", "0.66051686", "0.65876096", "0.6571555", "0.6558594", "0.6558594", "0.6558594", "0.6558594", "0.6543735", "0.65375817", "0.65375817", "0.65269786", "0.65182316", "0.6514422", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513082", "0.6513036", "0.6507082", "0.6501506", "0.6477621", "0.6467312", "0.64669883", "0.64641106", "0.64571124" ]
0.0
-1
All donations which are either pending of successful.
def donated donations.where("status != 'returned' AND status != 'failed' AND status != 'revoked'") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pending\n\t\tdonations.where(\"donations.status = 'pending' AND created_at < ?\", Donation.revoke_time)\n\tend", "def due_payments\n Payments.where(is_paid: false)\n \n end", "def total_donations\n donations.successful.sum(:amount)\n end", "def related_assigned_donations\n scope = Donation.where(\"id != ?\", @donation.id).where(:donor_id => @donation.donor_id)\n if [email protected]_reference.blank?\n scope.where(:bank_reference => @donation.bank_reference)\n elsif [email protected]?\n scope.where(:email => @donation.email)\n else\n []\n end\n end", "def all_not_done\n self.select { |todo| !todo.done? }\n end", "def pending_invoices\n database.select { |id, invoice| !invoice.successful? }\n end", "def confirm_all_pending_purchases\r\n self.pending_purchases.each{|purchase| purchase.confirm}\r\n end", "def donated\n \tdonations.sum(&:amount)\n end", "def related_unassigned_donations\n scope = Donation.where(\"id != ?\", @donation.id).where(:donor_id => nil)\n if [email protected]_reference.blank? && [email protected]_reference.to_s.mb_chars.downcase.to_s.strip.in?(BANK_REFERENCE_BLACKLIST)\n scope.where(:bank_reference => @donation.bank_reference)\n elsif [email protected]?\n scope.where(:email => @donation.email)\n else\n []\n end\n end", "def all_done\n self.select { |todo| todo.done? }\n end", "def invoices_all_paid?\n self.invoices.pluck(:paid_at).map {|i| not i.nil?}.reduce(:&)\n end", "def all_done\n select{ |todo| todo.done? }\n end", "def not_completed_due_today\n @not_done = @to_do_with_date.select { |x| x.is_done? == false }\n return @not_done.select { |x| x.due_date == Date.today }\n end", "def index\n @donations = Donation.all\n end", "def index\n @donations = Donation.all\n end", "def index\n @donations = Donation.all\n end", "def index\n @donations = Donation.all\n end", "def index\n @donations = Donation.all\n end", "def show_not_completed_items\n return @to_do_item.select { |x| x.is_done? == false }\n end", "def get_done_requests\n r = Request.where(:assigned => self , :done => true).to_a\n return r\n end", "def show_not_completed_date_items\n return @to_do_with_date.select { |x| x.is_done? == false }\n end", "def index\n @donations = Donation.by_person(current_user.id) || []\n end", "def user_donations\n @donations = @user.my_donations.decorate\n end", "def pending_refund_payments\n payments.joins(contribution: :project).where({\n projects: {\n state: 'failed'\n },\n state: 'paid',\n gateway: 'Pagarme',\n payment_method: 'BoletoBancario'\n }).reject do |payment|\n payment.already_in_refund_queue?\n end\n end", "def show_completed_items\n return @to_do_item.select { |x| x.is_done? == true }\n end", "def find_pending\n notifications.where sent: false\n end", "def merchants_with_pending_invoices\n failed = merchants_with_all_failed_transactions\n missing = merchants_without_transactions\n combo = [failed, missing].flatten.uniq\n merchants = combo.map { |id| @merchants.find_by_id(id) }\n end", "def donations(page=1, per_page=50, auth = false)\n get(\"v1/fundraising/pages/#{@short_name}/donations?pageNum=#{page}&pagesize=#{per_page}\",\n :basic_auth => auth)\n end", "def findings_briefs\n user = User.includes(:findings).references(:findings).merge(Finding.with_pending_status).take\n findings = user.findings.with_pending_status.finals(false)\n\n NotifierMailer.findings_brief user, findings.to_a\n end", "def man_req_donations\n prepareBaseContext\n @donations = Donation.where('donation_date IS NULL').order('donation_date')\n render 'petshelter/management/requests/donations'\n end", "def get_pending_requests\n r = Request.where(:assigned => self , :done => false).to_a\n return r\n end", "def pending_reviews\n pending_reviews = []\n self.projects.each do |p|\n p.reviews.each do |r|\n if !r.closed?\n if r.approved? && r.submitter == self \n pending_reviews.push(r)\n elsif r.review_votes.select{ |v| v.vote == ReviewVote.allowable_votes[:no_opinion] && v.user == self }\n pending_reviews.push(r)\n end\n end\n end\n end\n return pending_reviews\n end", "def reminder\n send_reminders self.charges.where(:completed => false)\n end", "def all_expense_items\n owing_expense_items + paid_expense_items\n end", "def pledge_rewards\n pledge_rewards = []\n @project=Project.find(project_id)\n @project.rewards.each do |reward|\n if dollar_amount >= reward.dollar_amount\n pledge_rewards << reward\n end\n end\n return pledge_rewards\nend", "def people_not_paid\n all_paid? ? [] : people - paid_infos.keys\n end", "def pending_requests_to_join\n ContributorRequest.includes(\n :user\n ).where(\n organization: self\n ).select(&:pending?)\n end", "def all_payments\n Payment.joins(:application).where('applications.student_id=?', id).where.not(status: nil)\n end", "def index\n #Show all donations\n #Admin only\n @donations = Donation.all\n end", "def pending\n result = {\n approvals: [],\n unapprovals: [],\n flagged: [],\n unflagged: [],\n comments: [],\n ready: []\n }\n\n Agenda.index.each do |item|\n if Pending.comments[item.attach]\n result.comments << item\n end\n\n action = false\n\n if Pending.approved.include? item.attach\n result.approvals << item\n action = true\n end\n\n if Pending.unapproved.include? item.attach\n result.unapprovals << item\n action = true\n end\n\n if Pending.flagged.include? item.attach\n result.flagged << item\n action = true\n end\n\n if Pending.unflagged.include? item.attach\n result.unflagged << item\n action = true\n end\n\n if not action and item.ready_for_review(User.initials)\n result.ready << item\n end\n end\n\n return result\n end", "def user_pledge_rewards\n user_pledge_rewards = []\n self.project_pledge_remaining.each do |project_id, pledge_amount_remaining|\n project = Project.find(project_id)\n reward_list = project.rewards\n reward_list.each do |reward|\n if pledge_amount_remaining >= reward.dollar_amount\n user_pledge_rewards << reward\n end\n end\n end\n return user_pledge_rewards\n end", "def find_requests\n @responsibility_requests = ResponsibilityRequest.paginate(:page => @page,\n :per_page => @per_page,\n :conditions => \"status='pending' OR status IS NULL\")\n \n @responsibility_requests.delete_if{|r| !r.user_can_approve(current_user) && (r.user != current_user) }\n end", "def customers_with_pending_invoices\n invoices = self.invoices.\n joins(:transactions).\n where(transactions: { result: \"failed\" })\n\n invoices.map do |invoice|\n invoice.customer\n end.uniq\n end", "def index\n @donations = EventDonation.all\n end", "def void_pending_purchase_orders\n self.purchase_orders.select(&:pending?).each {|o| o.void}\n end", "def due_today\n @due_date_task_list.select { |duedatetask| (duedatetask.status == \"incomplete\") && (duedatetask.due_date == Date.today) }\n end", "def pending_quests\n quests = UsersQuest.where(:assignee_id => @current_user.id,:is_accepted => false,:is_rejected =>false).pluck(:quest_id)\n @quests = Quest.where(:id => quests).order('due_date')\n by_me_quests = UsersQuest.where(:assignor_id => @current_user.id,:is_accepted => false,:is_rejected =>false).pluck(:quest_id)\n @by_me_quests = Quest.where(:id => by_me_quests).order('due_date')\n end", "def index\n redirect_to :root unless current_user.admin?\n @non_approved_registrations = Registration.all.where(approved: false)\n @approved_registrations = Registration.all.where(approved: true)\n end", "def withdrawals\n Transfer.where(\n from: id,\n transfer_type: 'withdrawal'\n )\n end", "def donatable?\n show_donation_basket? && has_an_approved_account_set? && money_approved?\n end", "def unpaid_bills\n\t\tCuenta.where.not(:id_cuenta => Detalle.where(:id_pago => Pago.select(:id_pago)).select(:id_cuenta)).where(:rut_cliente => rut)\n\tend", "def paid_counseling_sessions\n counseling_sessions.where.not(:stripe_charge_id => nil).all\n end", "def organ_donors\n Patient.where(is_organ_donor: true)\nend", "def not_paid_at_all\n\t\tget_cart_pending_balance == get_cart_price\n\tend", "def pending_request\n sent_requests.where(confirmed: nil)\n end", "def people_for_mailing\n self.people.select(&:ok_conf_mails?)\n end", "def all_paid?\n people.sort == paid_infos.keys.sort\n end", "def pending_assignments(assessor,certification_id = nil)\n if certification_id.nil?\n joins(:owned).where(:issued=>false,:owned=>{:id=>assessor.students})\n else\n joins(:owned).by_certification(certification_id).where(:issued=>false,:owned=>{:id=>assessor.students})\n end\n end", "def unprocessed_transactions\n\t\tself.transactions.where(approved: true, processed: false)\n\tend", "def incompleteItemsWithAndWithoutDates\n @due_items.sort!{|x,y| x.dueDate <=> y.dueDate}\n @due_items.select!{|item| item.done? == 'Item incomplete'}\n @to_do_items.select!{|item| item.done? == 'Item incomplete'}\n @incomplete_array = @due_items.concat(@to_do_items)\n end", "def incomplete_products\n return self.products.select do |product|\n !product.passing? && !product.failing?\n end\n end", "def list_all_not_completed_this_month\n @due_this_month = not_complete_by_date.select {|x| x.due_date.month == Date.today.month}\n @anniversary_this_month = @anniversary_list.select {|x| x.month == Date.today.month}\n @anniversary_this_month = @anniversary_this_month.sort_by {|x| x.day}\n return @due_this_month + @anniversary_this_month + show_not_completed_items\n end", "def unpaid_donations_sum_in_cents\n donations.unpaid.empty? ? 0 : donations.unpaid.map(&:amount_in_cents).sum\n end", "def charges\n charges = []\n self.students.each do |student|\n student.charges.each do |charge|\n if charge.promotion_id == self.id\n charges << charge\n end\n end\n end\n return charges\n end", "def get_pending\n Rutodo::Database::Todo.where(done: false).map(&:as_entity)\n end", "def filter_by_accepting_proposals(collection)\n collection.where(\"request_for_proposals.state = ?\", 'pending')\n end", "def all\n [ACTIVE, PENDING]\n end", "def pay_all_bills\n #self.appointments.update_all(cost: 0)\n self.appointments.each {|a| a.paid}\n end", "def index\n @incomplete_carts = Cart.where( purchase_completed: false )\n @completed_carts = Cart.where( purchase_completed: true )\n end", "def selectIncompleteDueDate\n @due_items.select{|item| item.dueToday? && item.done? == 'Item incomplete'}\n end", "def find_all_pending_publication\n find(:all, :conditions => [\"responses.status = ? AND responses.published_at < ?\", \n 'created', Time.now.utc - 30.days])\n end", "def unpaid_payment\n self.payments.where(status: nil).or(self.payments.where(status: :failed)).last\n end", "def fulfilled?\n user.donations.active.count >= quantity\n end", "def paid_expense_items\n paid_details.map{|pd| pd.expense_item }\n end", "def investors\n funds = []\n num_funding_rounds.each do |round| \n funds << round.venture_capitalist\n end\n funds.uniq\n end", "def pending_refund_payments_projects\n pending_refund_payments.map(&:project)\n end", "def allItemsIncompleteAndYearlyAndDue\n @due_items.sort!{|x,y| x.dueDate <=> y.dueDate}\n @due_items.select!{|item| item.done? == 'Item incomplete'}\n @anniversary_items.select!{|item| item.month}\n @to_do_items.select!{|item| item.done? == 'Item incomplete'}\n @incomplete_and_month = @due_items.concat(@anniversary_items)\n @incomplete_and_month_and_no_date = @incomplete_and_month.concat(@to_do_items)\n end", "def allDone\n Todo.where(\"done = true\")\nend", "def read_donation donation\n puts \"Organization:\"\n puts \"Amount:\"\n puts \"Date:\"\n puts \"Completed?\"\n end", "def get_uncompleted_quests()\n Quest.all.select do |quest|\n quest.characters.include?(self) == false\n end\n\n end", "def selectComplete\n @to_do_items.select {|item| item.done? == 'Item complete'}\n end", "def index\n @gt_registrations = GtRegistration.all.where(payed: true)\n end", "def coming_due_events\n candidate_events.select(&:coming_due?)\n end", "def selectIncomplete\n @to_do_items.select {|item| item.done? == 'Item incomplete'}\n end", "def index\n authorize :donation\n @donations = Donation.ordered.decorate\n end", "def set_donation\n @donation = Donation.find(params[:id])\n @payment_purposes = PaymentPurpose.all_active\n @events = Event.all_active\n @currencies = Currency.all_active\n @payment_modes = PaymentMode.all_active\n end", "def group_payments\n []\n end", "def passed\n # the non-preliminary ones go first\n @proposals = Proposal.select{ |p| p.committee.preliminary == false and p.status == 'Passed'}\n @proposals += Proposal.select{ |p| p.committee.preliminary == true and p.status == 'Passed'}\n\n respond_to do |format|\n format.html # passed.html.erb\n format.json { render json: @proposals }\n end\n end", "def paid\n where(:payment_status => \"paid\")\n end", "def donations_approved(user, project=nil)\n setup_email(user)\n @subject += head_encode(project ? (\"Contributions for %s have been activated\" / project.login) : 'Your contributions request has been approved'.t)\n @body[:project] = project\n @body[:url] = \"http://#{APP_CONFIG[:hostname]}/money\"\n end", "def participating_advocates\n result = []\n result << self.mandated_advocate if self.mandated_advocate\n result += self.responses.visible.map(&:person)\n result += self.accessors\n result.uniq!\n result\n end", "def collect_eligible(items)\n items.select{|item| eligible?(item) }\n end", "def customers_pending_invoices\n invoice_ids = invoices.pluck(:id)\n failed_transactions = Transaction.where(invoice_id: invoice_ids).where(result: \"failed\")\n customer_ids = Invoice.where(id: failed_transactions.pluck(:invoice_id)).pluck(:customer_id)\n Customer.where(id: customer_ids)\n end", "def unpaid_backlogs\n self.backlog_payments.where(:is_cleared => false )\n end", "def confirmed?\n self.contributions.each do |contribution|\n return false if contribution.isPending?\n end\n return true\n end", "def investors\n self.funding_rounds.map {|fr| fr.venture_capitalist}.uniq\n end", "def find_all_pending_publication\n find(:all, :conditions => [\"comments.status = ? AND comments.published_at < ?\", \n 'created', Time.now.utc - 30.days])\n end", "def meals\n Meal.all.select do |meal|\n meal.waiter == self\n end\n end", "def memberships_to_notify(date)\n treatment_group_memberships\n .status_enrolled\n .joins(treatment_group: :reminder_templates)\n .where(\"date_trunc('day', expected_return_date) + make_interval(days := reminder_templates.remind_on_in_days) = ?\", date)\n end" ]
[ "0.6915463", "0.65655845", "0.6478861", "0.62345284", "0.6152475", "0.61394465", "0.6063721", "0.6054466", "0.6026284", "0.6021158", "0.5989165", "0.5956796", "0.59322196", "0.59241366", "0.59241366", "0.59241366", "0.59241366", "0.59241366", "0.59001696", "0.58854645", "0.58684987", "0.5862346", "0.5839337", "0.58358175", "0.5809552", "0.5808062", "0.57607603", "0.57563883", "0.5737611", "0.57310283", "0.5661279", "0.5659525", "0.56435585", "0.562057", "0.560755", "0.5602045", "0.55889857", "0.5587024", "0.558095", "0.55797756", "0.55780536", "0.5565734", "0.55650085", "0.5562635", "0.55439264", "0.553443", "0.5533807", "0.5526672", "0.552185", "0.5504869", "0.54915804", "0.54889077", "0.5482534", "0.54721117", "0.5465503", "0.5464753", "0.5453988", "0.5442021", "0.5439036", "0.5426217", "0.54181343", "0.54018646", "0.5380862", "0.53802586", "0.5375944", "0.5366113", "0.53653127", "0.53638315", "0.53566074", "0.5354318", "0.5348296", "0.53412724", "0.5340995", "0.53370374", "0.5335357", "0.53290546", "0.53269935", "0.5326881", "0.5318342", "0.53177065", "0.53102744", "0.5300682", "0.52990806", "0.52990276", "0.52970064", "0.52815145", "0.52807164", "0.52785426", "0.5277825", "0.5270452", "0.52669406", "0.52652097", "0.52632385", "0.52550274", "0.5251707", "0.52447987", "0.52428824", "0.5241843", "0.52390367" ]
0.7606987
1
The amount of charity that donations to the artist has generated.
def charity_sum donated.sum("amount * (charity_percentage / 100)").to_f.round(2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def charity_sum\n\t\tdonations.sum(\"amount * (charity_percentage / 100)\").to_f.round(2)\n\tend", "def charity\n\t\tamount * (charity_percentage.to_f / 100)\n\tend", "def donated_sum\n\t\tdonated.sum(\"amount * (artist_percentage / 100)\").to_f.round(2)\n\tend", "def donated\n \tdonations.sum(&:amount)\n end", "def cost\n\t\treturn @extra_cost + @real_donation.cost\n\tend", "def calorie_count\n @sugar_amount * CALORIES_PER_SUGAR_GRAM +\n @flour_amount * CALORIES_PER_FLOUR_GRAM\n end", "def number_of_donations(campaign)\n\t campaign.donations.count\n\tend", "def donate_to_charity(knockee)\n\t\tif knockee.philanthropy_percent\n\t\t\tself.money_for_philanthropy = (knockee.philanthropy_percent).to_f/100 * self.price\n\t\t\tself.price -= self.money_for_philanthropy\n\t\tend\n\t\tself.money_for_philanthropy || 0.00\n\tend", "def food_consumption\n return residents.length * 2\n end", "def sum_charges\n return (self.sum_produits_used)\n end", "def donated_amount\n self.fees.purchased.sum(:amount).to_f\n end", "def total_donations\n donations.successful.sum(:amount)\n end", "def amount_charged\n\t\t@amount = 6000\n\tend", "def donated_sum\n\t\tdonated.sum(:amount).to_f.round(2)\n\tend", "def cost\n 0.89\n end", "def gc\n s = codons.map { |c| c.nuc_codon[2] }.join\n ((s.count('G')+s.count('C')).to_f/codons.count).round(4)\n end", "def cost\n # Todo pull this from the DB\n 1000\n end", "def num_oxygen\n @num_oxygen ||= total_atoms :O\n end", "def cost\n 0.99\n end", "def cost \n return @extra_cost + @basic_prescription.cost\n end", "def cult_population\n my_followers.count\n end", "def number_of_cases\n fee_quantity_for('BANOC') + 1\n end", "def number_of_calories\n self.ingredients.sum(\"calories\")\n end", "def amt_cult_follow\n Bloodoath.all.select {|bloodoath| bloodoath.follower == self}.count\n end", "def gym_cost\n \t\tgym_cost = memberships.map{|member|member.cost}\n \t\tgym_cost.sum\n end", "def cost\n 1.99\n end", "def cost_of_stay\n num_of_nights * 200.00\n end", "def charged_fee(amount)\n (amount * merchant.fee)\n end", "def number_of_councils\n payer_breakdown && payer_breakdown.select{ |p| p[:organisation_type] == 'Council' }.size\n end", "def fixed_charges\n 20.0\n end", "def gym_cost\n all_gym_costs = self.memberships.map {|membership| membership.cost}\n all_gym_costs.sum\n end", "def accommodation_cost(nights)\n City::TIER_ACCOMMODATION_COST[self.city.accomodation_category.to_sym] * nights\n end", "def total_contributions_cost\n contributions.to_a.sum(&:amount)\n end", "def gift_total_amount_per_donor(donor)\n selected_gifts = Gift.where(:donor_id => donor)\n sum = 0\n selected_gifts.each do |g|\n sum+=g.amount\n end\n return sum\n end", "def cults_amount\n self.cults.size\n end", "def gift_total_amount_per_donor(donor)\n selected_gifts = Gift.where(:donor_id => donor)\n sum = 0\n selected_gifts.each do |g|\n sum+=g.amount\n end\n return sum\n end", "def amount_of_chocolate_chips(recipe_hash)\n \"#{recipe_hash[:mini_dark_chocolate_chips]} of mini dark chocolate chips\"\nend", "def cost\n deductible * RATE\n end", "def total_charged\n return self.trips.sum(&:cost)\n end", "def calculate_number_of_commissions\n (@cancellation_factor * @hash[\"number of commissions\"][0].from_german_to_f).to_german_s\n end", "def final_amount\n amount_paid - discount_value - discount_percent\n end", "def cult_population\n followers_list.size\n end", "def cost\n total = 0.0\n not_covered.each do |n|\n total += n.cost\n end\n total\n end", "def disbursed_amount\n amount = 0\n loans.each do |project|\n amount += project.disbursed_amount.to_i\n end\n amount\n end", "def cost \n return @extra_cost + @basic_drug.cost\n end", "def percentage_owned(company)\n certificates_for(company).map(&:portion).inject(:+) || 0\n end", "def amount; end", "def size_bonus\n @character.race.size.modifier\n end", "def max_quarry_discount\n victory_points\n end", "def disbursed_amount_factor\n disbursed_amount.to_f / Country.max_disbursed_amount\n end", "def corrections_cost()\n return 0 if !defined?(@corrections) or @corrections.nil?\n return @corrections.inject(0) { |current, correction| current + correction.cost }\n end", "def cult_population\n # First, get all of the followers that belong to this cult, then count how many there are\n self.followers.count\n end", "def next_charge\n ( pre_finalised_quote * relative_progress / 100 ) - charged_so_far\n end", "def cents\n (amount * 100).to_i\n end", "def quantity\n consumables.size\n end", "def cost\n return @cost\n end", "def cost\n return @cost\n end", "def donation_amount\n number_to_currency(self.value)\nend", "def cost_of_cable(length)\n\t\tmeter = length * 0.01\n\t\tdollar = [meter * 0.4079 + 0.5771, meter * 0.0919 + 7.2745].min * BANDWIDTH\n\t\t(dollar * 100).round.to_f / 100\n\tend", "def cost\n (@items_cost - @promotion_adjustment).round(2)\n end", "def per_person\n (total_bill / @party_size).ceil.to_i\n end", "def party_size\n @actors.size + 3\n end", "def total_benefits_value\n benefits.map{|b| b.total_value_cents}.reduce(:+).to_i\n end", "def cost()\n unless @cost\n @cost = @description.inject(0) do |val, el|\n val + ((el.nil? || el.to_s.end_with?('?')) ? 1 : 0.1)\n end\n end\n @cost\n end", "def cost\r\n 0\r\n end", "def disc_count\n @ole.DiscCount\n end", "def cost\n purchase_cost\n end", "def cost\n purchase_cost\n end", "def final_price\n (self.price*(1 - self.discount.to_f / 100)).to_i\n end", "def cents; end", "def credit_amount\n sum( credits )\n end", "def total_rehabilitation_cost\n rehabilitation_labor_cost.to_i + rehabilitation_parts_cost.to_i\n end", "def total_price\n self.price + self.donation_amount\n end", "def amount_owed\n total_price - amount_paid\n end", "def offense_counts; end", "def offense_counts; end", "def cost\n @beverage.cost + 0.15\n end", "def subsidy_committed\n study_cost = self.study_cost / 100.00\n subsidy = self.stored_percent_subsidy / 100.00\n\n ((study_cost * subsidy) * 100).to_i\n end", "def total_cholesterol\n food.cholesterol * quantity\n end", "def total_debt\n self.amount\n end", "def total_card_combs(star_counter)\n c = 0\n star_counter.each { |num_of_stars| c += prmutation(5) * cmbnation(num_of_stars) if num_of_stars > 4 }\n return c\nend", "def dexterity_bonus\n @character.dexterity_modifier\n end", "def sugar_amount\n @sugar_amount\n end", "def amount_payment_outstanding\n capital_required - amount_payment_collected\n end", "def cents\n @cents\n end", "def membership_discount_total\n membership_fixed_total + membership_percent_total\n end", "def domestic_extra_charges(base = 850, insurrance = false)\n extra = base\n extra += 1_000 if insurrance\n extra\n end", "def reagent_cost\n reagents.map do |reagent|\n reagent.reagent.production_cost\n end.sum\n end", "def investment\n if buy_price\n num_of_shares * buy_price\n end\n end", "def to_centi\n big_self / CENTI\n end", "def total_cost\n # binding.pry\n self.memberships.map{|membership| membership.cost }.sum\n end", "def rent_percept_for_renter\n rent_value = 0\n self.accessories.each{|accessory|\n rent_value += ((accessory.base + accessory.tarif)*( 1 + (accessory.tax/100) ))\n }\n return rent_value\n end", "def coupon_amount\n return 0.0 unless subscription.has_coupon? and subscription.coupon.still_valid?\n\n subscription.coupon.amount\n end", "def count_drinks_customer()\n @drinks.count\n end", "def goods_produced\n (0.2 * base_production + trade_goods_bonus).round(6)\n end", "def total_copay_amount\n sum = self.insurance_payment_eobs.sum(:total_co_pay)\n sum.to_f\n end", "def charge\n subtotal * 0\n end", "def worth_at_cost\n worth= cost*quantity\n return worth\n end", "def number_of_kcal_per_meal\n kcal_per_recipe = recipe_ingredients.each.sum do |recipe_ingredient|\n calories_per_gram = recipe_ingredient.ingredient.calories / 100 \n kilograms_of_ingredient = recipe_ingredient.calculated_weight_in_grams / 1000\n (calories_per_gram * kilograms_of_ingredient) #kcal\n end\n kcal_per_recipe / num_people\n end", "def disenchantGoldens\n\t\tdust = 0\n\t\tn = 0\n\t\tfor card in @cards[TOTAL_UNIQUE_CARDS..2*TOTAL_UNIQUE_CARDS-1]\n\t\t\textras = card.removeAll\n\t\t\tdust += card.disenchant_value * extras\n\t\t\tn += extras\n\t\tend\n\t\treturn dust, n\n\tend" ]
[ "0.7724582", "0.72123253", "0.7109921", "0.7063724", "0.696419", "0.68980926", "0.6851055", "0.666505", "0.65168226", "0.6430071", "0.64178455", "0.63789487", "0.6363996", "0.6353925", "0.62362283", "0.6218141", "0.6201065", "0.61954063", "0.61674947", "0.61355335", "0.61309475", "0.6127427", "0.6126803", "0.61138093", "0.6105494", "0.6102717", "0.6082374", "0.6071573", "0.60632443", "0.6062759", "0.6062421", "0.60582405", "0.60431457", "0.60279036", "0.6005229", "0.60014784", "0.5999603", "0.5996424", "0.5994259", "0.5991268", "0.5968827", "0.5965648", "0.59458613", "0.5917547", "0.5904609", "0.59003097", "0.5893731", "0.58841175", "0.58752716", "0.5871437", "0.58683753", "0.58645093", "0.5850316", "0.5845758", "0.58408767", "0.58363366", "0.58363366", "0.5829075", "0.5811645", "0.580084", "0.57993305", "0.5795572", "0.5793234", "0.5792432", "0.57910216", "0.5786787", "0.578508", "0.578508", "0.5772561", "0.57655656", "0.5761508", "0.57546276", "0.574876", "0.5746371", "0.5742497", "0.5742497", "0.5738636", "0.5738429", "0.5736694", "0.57356703", "0.57348263", "0.57312095", "0.57246155", "0.5720408", "0.5705929", "0.5703335", "0.5701019", "0.5698028", "0.5697234", "0.5691447", "0.569135", "0.5689586", "0.5687982", "0.568575", "0.56838584", "0.56792504", "0.5677997", "0.5673017", "0.566884", "0.566795" ]
0.7591172
1
The amount that has been donated to the artist (including pending donations).
def donated_sum donated.sum("amount * (artist_percentage / 100)").to_f.round(2) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def donated\n \tdonations.sum(&:amount)\n end", "def donated_amount\n self.fees.purchased.sum(:amount).to_f\n end", "def donated_sum\n\t\tdonated.sum(:amount).to_f.round(2)\n\tend", "def total_donations\n donations.successful.sum(:amount)\n end", "def total_debt\n self.amount\n end", "def disbursed_amount\n amount = 0\n loans.each do |project|\n amount += project.disbursed_amount.to_i\n end\n amount\n end", "def final_amount\n amount_paid - discount_value - discount_percent\n end", "def amount_owed\n total_price - amount_paid\n end", "def cost\n\t\treturn @extra_cost + @real_donation.cost\n\tend", "def total_price\n self.price + self.donation_amount\n end", "def gift_total_amount_per_donor(donor)\n selected_gifts = Gift.where(:donor_id => donor)\n sum = 0\n selected_gifts.each do |g|\n sum+=g.amount\n end\n return sum\n end", "def amount_payment_outstanding\n capital_required - amount_payment_collected\n end", "def donation_amount\n number_to_currency(self.value)\nend", "def pending_sum\n\t\tpending.sum(\"amount * (artist_percentage / 100)\").to_f.round(2)\n\tend", "def gift_total_amount_per_donor(donor)\n selected_gifts = Gift.where(:donor_id => donor)\n sum = 0\n selected_gifts.each do |g|\n sum+=g.amount\n end\n return sum\n end", "def _spent_on\n return payment\n end", "def investment\n if buy_price\n num_of_shares * buy_price\n end\n end", "def sum_charges\n return (self.sum_produits_used)\n end", "def has_paid (driver, person, amount)\n # debt - amount\n end", "def amount\n user.company.point_values[:received_approval_value]\n end", "def amount_owed\n invoice_total - total_amount_paid\n end", "def amount_remaining\n @desired_amount - @bought_amount\n end", "def get_discounted_amount\n\t\tif self.discount.nil?\n\t\t\t0\n\t\telse\n\t\t\tself.amount * self.discount\n\t\tend\n\n end", "def progress\n\t@donations = Donation.find_all_by_fundraiser_id(id)\n\t@progress = 0\n\tif @donations.nil?\n\t return @progress\n\telse\n\t @donations.each do |d|\n\t\tif !d.amount.nil?\n\t\t @progress += d.amount\n\t\tend\n\t end\n\tend\n\treturn @progress\n end", "def total_debt\n Money.new(all_debts.sum { |_, debt| debt }, 'PLN')\n end", "def unpaid_donations_sum_in_cents\n donations.unpaid.empty? ? 0 : donations.unpaid.map(&:amount_in_cents).sum\n end", "def amount_paid\n accepted_payments.sum(:amount).to_f\n end", "def total_amount\n self.tickets.inject(0) do |amount, ticket|\n amount += ticket.price_minus_discount\n end\n end", "def amount; end", "def deposit_quantity\n money.to_d.divmod(market.settle_price(currency)).first\n end", "def last_gift_amount(donor)\n last_gift = find_last_gift(donor)\n if last_gift.nil?\n return 0\n else\n return last_gift.amount\n end\n end", "def balance_owed\n discounted_price - amount_paid\n end", "def amount\n @percent\n end", "def amount\n @percent\n end", "def amount\n @amount\n end", "def money\n\t\tif @wallet.neg?\n\t\t\t@in_debt = true\n\t\tend\n\t\treturn @wallet.amount\n\tend", "def amount\n\t\t\t\t@amount\n\t\t\tend", "def total_owned\n self.shares.map{ |share| share.value }.inject(:+)\n end", "def payment_amount\n convert_email_to_user && save\n return override_cost if override_cost.present?\n\n event&.get_cost(member: user&.present?)\n end", "def donate\r\n @fund += 25\r\n puts \"Project #{@name} received a generous donation!\"\r\n end", "def amount_after_tax\n if waitlist_deduct_amount.present?\n amount_after_discounted + amount_of_tax - waitlist_deduct_amount\n else\n amount_after_discounted + amount_of_tax\n end\n end", "def get_cart_paid_amount\n\t\tself.cart_paid_amount \n\tend", "def promo_total\n 0.0\n end", "def activemerchant_amount\n (amount * 100).to_i\n end", "def get_amount\n\t\t@amount\n\tend", "def amount\n return subscription.plan.amount if stripe_invoice_id.nil?\n\n stripe_invoice.amount_due / 100.0\n end", "def current_subtotal\n debt_claim_items.reject(&:marked_for_destruction?).sum(&:current_debt)\n end", "def amount(include_discount = true)\r\n include_discount && @discount && @discount.apply_to_recurring? ? self[:amount] - @discount.calculate(self[:amount]) : self[:amount]\r\n end", "def credit_amount\n sum( credits )\n end", "def amount_charged\n\t\t@amount = 6000\n\tend", "def membership_discount_total\n membership_fixed_total + membership_percent_total\n end", "def outstanding_payment_amount\n (total - amount_paid).round(2)\n end", "def amount\n return self.fee['amount'].to_f\n end", "def sugar_amount\n @sugar_amount\n end", "def points(artist = nil)\n\t\tw = artist ? \" AND artist_id = #{artist.id}\" : \"\"\n\t\tw = \"status != 'returned' AND status != 'failed' AND status != 'revoked'#{w}\"\n\t\tif artist\n\t\t\tl = artist.listens.where(\"user_id = ?\", id).count\n\t\telse\n\t\t\tl = listens.count\n\t\tend\n\t\td = donations.where(w).sum(:amount)\n\t\t\n\t\treturn (l + (d * 1000)).to_i\n\tend", "def amount\n data['amount'].to_f / 100\n end", "def amount\n bid.amount\n end", "def charged_fee(amount)\n (amount * merchant.fee)\n end", "def money_made\n total_crowd * self.ticket_price\n end", "def discounted_total\n line_item.total_in_cents - discount_amount\n end", "def unpaid_amount\n gross_amount - paid_amount\n end", "def charity_sum\n\t\tdonations.sum(\"amount * (charity_percentage / 100)\").to_f.round(2)\n\tend", "def amount\n difference\n end", "def pending_amount\n @calculator.pending_amount\n end", "def discount_amount(bill)\n return sum_price_non_groceries(bill.get_items) * @discount\n end", "def discount_amount\n has_discount? ? (line_item.total_in_cents * discount.percentage/100.0).to_i : 0\n end", "def total_amount\n unit_amount * quantity\n end", "def ot_voucher_amount\n end", "def purchase_amount\n if order.present?\n order.total - credits_amount\n else\n credits_amount\n end\n end", "def amount\n @attributes[:amount]\n end", "def total_paid\n self.user_expenses.reduce(0) { |sum, user_expense| user_expense.paid + sum }\n end", "def total_amount_before_modifier\n sale_amount + discount_amount + tax_amount + shipping_amount\n end", "def loan_amt\n (self.buying_price*1000) * (1 - (self.deposit/100))\n end", "def donateinfo\n case @@donation_type\n when \"One-off\"\n @@donation_reference = TestBrowser.browser.url.split(\"=\")[2][16..51]\n @@donation_amount = '%.2f' % (TestBrowser.browser.url.split(\"paymentAmount=\")[1][0..3].to_i/100)\n when \"Monthly\"\n @@donation_amount = '%.2f' % (TestBrowser.browser.url.split(\"=\")[3].to_i/100)\n when \"One-off PayPal\"\n @@donation_amount = '%.2f' % (TestBrowser.browser.url.split(\"=\")[2].split(\"&\").first.to_i/100)\n end\n donate_info = \"#{@@donation_type} donation of #{@@donation_amount}\"\n return donate_info\n end", "def amount_refunded\n amt = Money.new(0)\n transactions.each do |t|\n if t.transaction_type == \"refund\" && t.status != \"voided\"\n amt += t.money_amount\n end\n end\n return amt\n end", "def item_total\n @promotion_attributed_line_items.map(&:amount).sum\n end", "def amount\n recognition.badge.points\n end", "def outstanding_amount\n if payment_item.is_a? GeneralPaymentItem\n [0.0, payment_item.amount - payment_installments.map(&:amount).sum].max\n else\n nil\n end\n end", "def artist_share\n\t\tamount * (artist_percentage.to_f / 100)\n\tend", "def discount_amount\n all_discounts = line_items.collect { |li| li.discounts }.flatten\n mapping = all_discounts.map(&:price_extend)\n # when we create the discount items, we need to set calculate their price_extend value\n mapping.sum\n end", "def amount_to_set\n # if (report && Response.payment_node(report) && Response.payment_node(report)[:authorization] && Response.payment_node(report)[:authorization][:amount].present?)\n if (report && Response.payment_node(report) && Response.payment_node(report)[:authorization] && Response.payment_node(report)[:authorization][:amount].present?)\n if canceled\n return Response.payment_node(report)[:authorization][:amount].to_i\n else\n return total_acquirer_pending + total_acquirer_approved\n end\n else\n return false\n end\n end", "def amount\n price\n end", "def money_spent\n self.purchases.map { |p| p.price }.sum\n end", "def charity_sum\n\t\tdonated.sum(\"amount * (charity_percentage / 100)\").to_f.round(2)\n\tend", "def total_amount\n (total * 100).to_i\n end", "def amount_raised\n self.pledges.sum(:amount)\n end", "def total_drinking\n breast_feedings.sum(:quantity)\n end", "def number_donations\n if user_signed_in?\n @notifications = current_user.get_notifications_number\n end\n end", "def donation_this_year\n donation_year = Donation.where(\"strftime('%Y', donation_date) = ?\", Time.now.year.to_s)\n currency(donation_year.sum(:amount))\n end", "def to_d\n amount\n end", "def coupon_amount\n return 0.0 unless subscription.has_coupon? and subscription.coupon.still_valid?\n\n subscription.coupon.amount\n end", "def final_price\n (self.price*(1 - self.discount.to_f / 100)).to_i\n end", "def booking_amount\n self.charges.booking.inject(0){|sum, charge| sum + charge.amount}\n end", "def total\n total = with_product_discounts\n total = with_basket_discounts(total)\n return \"£#{total}\"\n end", "def amount_in_cents\r\n read_attribute(:amount) \r\n end", "def actual_income\n outgoing_invoices.where(:status => \"deposited\").inject(0) do |mem, invoice|\n mem += invoice.amount\n end # inject invoice\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 payment\n payment = 0\n transactions = finance_transactions\n unless transactions.nil?\n transactions.each do |t|\n payment += t.amount\n end\n end\n payment\n end", "def total_amount_due_to_retailer\n shipping = self.retailer.reimburse_shipping_cost ? self.ship_total : 0.0\n product_cost = (self.line_items.collect {|line_item| line_item.product_cost_for_retailer }).sum\n self.tax_total + shipping + product_cost\n end", "def profit\n total_before_tax - total_cost\n end" ]
[ "0.774016", "0.76883286", "0.7391061", "0.723301", "0.7097296", "0.7018243", "0.69927704", "0.69313425", "0.69001365", "0.67402846", "0.67274684", "0.6723825", "0.6723054", "0.6719791", "0.6711063", "0.6704326", "0.66622376", "0.662921", "0.6617625", "0.6613892", "0.65767926", "0.652187", "0.6505155", "0.6485909", "0.6481058", "0.6471237", "0.64711547", "0.6449346", "0.6448036", "0.64391786", "0.6437632", "0.6437268", "0.6415231", "0.6415231", "0.641147", "0.6395637", "0.6390947", "0.6381962", "0.6380838", "0.637083", "0.63634807", "0.6335433", "0.63353205", "0.63178265", "0.63130665", "0.6309664", "0.63067317", "0.63030595", "0.6298639", "0.62879676", "0.62838954", "0.62743247", "0.6273312", "0.6263641", "0.6257649", "0.62552285", "0.6254493", "0.6248902", "0.6231273", "0.62286246", "0.6227028", "0.6216104", "0.6212289", "0.6212234", "0.6202569", "0.6194151", "0.6186612", "0.6185501", "0.6183271", "0.6181995", "0.61818683", "0.61785644", "0.61765593", "0.6173561", "0.6162496", "0.6154497", "0.6154401", "0.61484957", "0.61452", "0.6142706", "0.61273474", "0.61220104", "0.6120898", "0.61202765", "0.6115068", "0.61120915", "0.6106321", "0.6105", "0.60984373", "0.60963327", "0.60806686", "0.6077702", "0.607688", "0.6074197", "0.6073418", "0.60667634", "0.6062133", "0.60483134", "0.60477096", "0.6045676" ]
0.82415795
0