query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
========================================================================== auth not required available to anyone ==========================================================================
def index @user = User.find_by_id(session[:user]) @stories = Story.find :all, :order => 'updated_at DESC', :limit => 5 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def auth\n end", "def auth\n end", "def http_auth?; end", "def auth_param; end", "def valid_for_http_auth?; end", "def auth\n {}\n end", "def auth(value); end", "def http_auth_login\n # FIXME: Implement\n end", "def require_auth\n head :unauthorized unless current_user\n end", "def capable_plain_auth?; end", "def host_authorization; end", "def host_authorization; end", "def capable_login_auth?; end", "def auth_store; end", "def http_auth_hash; end", "def auth_methods; end", "def authenticate!\n # Do nothing yet\n end", "def web\n _auth(false)\n end", "def api_auth\n api_response(403, \"Invalid Authorization header\") unless api_user\n end", "def authorization; end", "def auth?\n true\n end", "def authenticate!\n error!(\"401 Unauthorized\", 401) unless check_auth_token \n end", "def auth?\n false\n end", "def require_http_auth\n if `hostname` =~ /soykaf|lanpartei/i \n if auth = APP_CONFIG['http_auth']\n authenticate_or_request_with_http_basic do |user_name, password|\n user_name == auth['name'] && password == auth['password']\n end \n end\n end\n end", "def auth\n cfg_get(:auth)\n end", "def require_authenticated_user\n return if authenticate_or_request_with_http_basic do |ident_string, secret_string|\n ident_string == 'karl' && secret_string.to_s.crypt(ident_string)\n end\n render :text => \"You must be logged in to view this site\", :layout => false, :status => status\n end", "def login_required\n return if authorized?\n unauthorized! unless auth.provided?\n bad_request! unless auth.basic?\n unauthorized! unless authorize(*auth.credentials)\n @req.env['REMOTE_USER'] = auth.username\n end", "def auth(user, password, domain = T.unsafe(nil)); end", "def http_auth_header?; end", "def basic_auth(*args, &block); end", "def auth\n if request.get?\n show_auth\n elsif request.post?\n check_auth\n end\n end", "def allowed_auth_methods; end", "def auth\n cfg_get(:auth)\n end", "def authenticate!\n not_authorized() unless logged_in?()\n end", "def valid_for_authentication?; end", "def valid_for_authentication?; end", "def http_authenticatable?; end", "def basic_auth(opts); end", "def require_auth(user)\n return head(:forbidden) unless current_user == user.account\n end", "def skip_authorization; end", "def authenticate\n unauthorized unless current_user\n end", "def require_auth\n (authorized? && authenticated?) || halt(401)\n end", "def authenticate\n end", "def authenticate\n\t\tdeny_access unless signed_in?\n\tend", "def auth_scheme; end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def Authentication\n call('', '')\n end", "def oauth_authentication; end", "def auth_required\n unless Facts.config.user\n Facts.ui.puts \"Authorization required for this task, use `facts config`\"\n exit(0)\n end\n end", "def authorization_mode; end", "def token_auth(*args, &block); end", "def authenticate\n self.get && true\n end", "def unauthenticated\n end", "def auth_process\n\t\tif @auth_file.authorization.nil?\n \t\t\tmake_auth\n\t\telse\n\t\t\t@client.authorization = @auth_file.authorization\n\t\tend\n\tend", "def authenticate\n\tdeny_access unless signed_in?\n end", "def host_authorization=(_arg0); end", "def host_authorization=(_arg0); end", "def needs_authorization?\n true\n end", "def authenticate\n deny_access unless loged_in?\n end", "def authenticated?; super; end", "def is_authenticated?\n end", "def authenticate\n authenticate_or_request_with_http_basic(\"Fun!\") do |username, password|\n username == ENV[\"FUN_ADMIN_USER\"] && password == ENV[\"FUN_ADMIN_PASS\"]\n end\n end", "def web_auth\n\t\tauth ::UWeb\n\tend", "def credentials(authorization, request); end", "def require_no_authentication\n end", "def checkauth\n raise ZbxAPI_ExceptionBadAuth, 'Not logged in' if !loggedin?\n end", "def auth_provided?\n !username.nil? && !password.nil?\n end", "def admin_auth\n authenticate_or_request_with_http_basic do |username, password|\n username == \"ga\" && password == \"ga\"\n end\n end", "def authorize\n end", "def authorize\n end", "def authorization(*args, &block); end", "def ensure_authenticated_user\r\n head :unauthorized unless current_user\r\n end", "def authentication\n raise NotImplementedError\n end", "def api_authentication_required\n unauthorized unless current_user?\n end", "def basic_auth(user, password, domain = T.unsafe(nil)); end", "def protected!\n return if from_bitbooks?\n headers['WWW-Authenticate'] = 'Basic realm=\"Restricted Area\"'\n halt 401, \"Not authorized\\n\"\nend", "def authenticate\n @shoonga = authenticate_or_request_with_http_basic do |username, password|\n username == \"4vght\" && password == \"we8vds\"\n end\nend", "def authenticate\n authenticate_or_request_with_http_basic(\"myTaskboard Login\") do |email, password|\n user = User.where(email: email, password: password).first rescue nil\n redirect_to controller: :login, action: :index, status: 403 and return if user.nil?\n\n session[:current_user_id] = user.id #rescue nil\n end\n end", "def authenticate_user!\n if request.headers['sid'].present? && !request.headers['sid'].nil? && request.headers['utoken'].present? && !request.headers['utoken'].nil?\n session = Session.active_sessions.find_by_id(request.headers['sid'])\n if session.nil? || session.utoken != request.headers['utoken']\n render_error_add :unauthorized, 'unauthorized' and return\n end\n else\n render_error_add :unauthorized, 'unauthorized' and return\n end\n end", "def auth\r\n OAuth2\r\n end", "def user_authentication\n end", "def authenticate\n deny_access unless signed_in? \n end", "def api_auth\n\t\tauth ::UApi\n\tend", "def require_authenticated\n if !session[:email]\n halt 401\n end\n end", "def unauthorized\n end", "def require_auth\n if session[:user_id]\n return true \n else\n render json: {message: \"not authenticated\"}, status: :forbidden\n return false\n end\n end", "def params_auth_hash; end", "def force_authn?\n force_authn == true\n end", "def authenticate\n authenticate_or_request_with_http_basic do |user_name, password|\n # Change these to username and password required\n user_name == \"shitlister\" && password == \"letmein\"\n end\n end", "def require_login\n qop = ''\n case @qop\n when QOP_AUTH\n qop = 'auth'\n when QOP_AUTHINT\n qop = 'auth-int'\n when QOP_AUTH | QOP_AUTHINT\n qop = 'auth,auth-int'\n end\n\n @response.add_header('WWW-Authenticate', \"Digest realm=\\\"#{@realm}\\\",qop=\\\"#{qop}\\\",nonce=\\\"#{@nonce}\\\",opaque=\\\"#{@opaque}\\\"\")\n @response.status = 401\n end", "def require_auth\n redirect_to login_path unless authenticated?\n end", "def auth0(name: T.unsafe(nil), email: T.unsafe(nil), uid: T.unsafe(nil)); end", "def credentials; end", "def credentials; end", "def credentials; end", "def credentials; end", "def credentials; end", "def mock_defective_auth_hash\n nil\n end", "def authentication_type; end", "def basic_auth\n authenticate_or_request_with_http_basic do |username, password|\n username == Rails.application.credentials.basic[:username] && \n password == Rails.application.credentials.basic[:password]\n end\n end" ]
[ "0.8134642", "0.8134642", "0.8011821", "0.7686608", "0.76802367", "0.7625633", "0.7590445", "0.7573058", "0.7537366", "0.7522947", "0.7503559", "0.7503559", "0.73876065", "0.7386977", "0.73645234", "0.73007107", "0.7285454", "0.724081", "0.72332615", "0.72242916", "0.71924144", "0.71829104", "0.7165407", "0.71235716", "0.71218365", "0.71132135", "0.70621204", "0.70367175", "0.7034473", "0.7022128", "0.6975342", "0.6971924", "0.69710195", "0.69698256", "0.6969663", "0.6969663", "0.6964664", "0.69572645", "0.6952624", "0.6951502", "0.6941038", "0.6924516", "0.6913152", "0.69084", "0.6905818", "0.69057834", "0.69057834", "0.69018555", "0.68994576", "0.68986446", "0.6888152", "0.68857384", "0.6877196", "0.6873934", "0.6865339", "0.68543506", "0.68453306", "0.68453306", "0.68450916", "0.6834961", "0.6830418", "0.68264174", "0.6820762", "0.6818265", "0.68124646", "0.68089813", "0.67978525", "0.67929566", "0.6791014", "0.67877513", "0.67877513", "0.6776205", "0.6769476", "0.67676735", "0.676237", "0.6748181", "0.67393714", "0.6738542", "0.6735811", "0.6705422", "0.6698963", "0.66986597", "0.6695103", "0.6694529", "0.66931015", "0.66817504", "0.6681148", "0.66801745", "0.66792756", "0.66718805", "0.66688037", "0.6653262", "0.66529405", "0.6649569", "0.6649569", "0.6649569", "0.6649569", "0.6649569", "0.66373974", "0.66320294", "0.6628909" ]
0.0
-1
========================================================================== auth required available to members ==========================================================================
def new @story = Story.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def authenticate_member!\n end", "def auth\n end", "def auth\n end", "def authenticate_request!\n raise Exceptions::UnauthorizedError unless current_member\n\n current_member\n end", "def auth_methods; end", "def auth_param; end", "def auth(value); end", "def allowed_auth_methods; end", "def auth\n {}\n end", "def login_required\n raise Forbidden unless @current_member #ログイン状態でないとForbiddenを発生させる\n end", "def http_auth?; end", "def authorization; end", "def authenticateA_L\n authenticate_or_request_with_http_basic do |name, password|\n if m=Member.find_by_name(name) \n if (m.authenticate(password) )\n\t\t\tif m.id == cookies.signed[:user_id]\n\t\t\t\tif (Member.find_by_id(cookies.signed[:user_id]).role == \"administrator\" || is_leader?)\n\t\t\t\t\ttrue\n\t\t\t\telse\n\t\t\t\t\tfalse\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tfalse\n\t\t\tend\n\t\telse\n\t\t false\n\t\tend\n else\n false\n end\n end\n end", "def authenticate_member_with_basic_auth!\n if member = authenticate_with_http_basic { |u,p| Membership.find_by_user_name(u).authenticate(p) }\n session[:member_id] = member.id\n else\n authenticate_api_member!\n end\n end", "def basic_auth(*args, &block); end", "def host_authorization; end", "def host_authorization; end", "def authenticateA\n # if is_admin?\n # true\n # else\n authenticate_or_request_with_http_basic do |name, password|\n if m=Member.find_by_name(name) \n if (m.authenticate(password) && (m.id == current_user.id))\n \t\t\tif(is_admin?)\n \t\t\t\ttrue\n \t\t\telse\n \t\t\t\tfalse\n \t\t\t end\n \t\t else\n \t\t false\n \t\t end\n else\n false\n end\n end\n # end\n end", "def authenticate\n authenticate_or_request_with_http_basic do |name, password|\n if m=Member.find_by_name(name) \n if (m.authenticate(password) && m.role == \"administrator\")\n\t\t true\n\t\telse\n\t\t false\n\t\tend\n else\n false\n end\n end\n\tname=\"\"\n\tpassword=\"\"\n end", "def capable_login_auth?; end", "def auth?\n true\n end", "def admin_auth\n authenticate_or_request_with_http_basic do |username, password|\n username == \"ga\" && password == \"ga\"\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic(\"Fun!\") do |username, password|\n username == ENV[\"FUN_ADMIN_USER\"] && password == ENV[\"FUN_ADMIN_PASS\"]\n end\n end", "def require_auth\n head :unauthorized unless current_user\n end", "def authorization(*args, &block); end", "def valid_for_authentication?; end", "def valid_for_authentication?; end", "def authenticate!\n # Do nothing yet\n end", "def auth\n cfg_get(:auth)\n end", "def authenticate_member_with_basic_auth!\n if member = authenticate_with_http_basic { |u,p| Member.find_by_user_name(u).authenticate(p) }\n session[:member_id] = member.id\n else\n authenticate_member!\n end\n end", "def authenticate\n end", "def auth_store; end", "def Authentication\n call('', '')\n end", "def valid_for_http_auth?; end", "def authentication\n raise NotImplementedError\n end", "def authenticate\n authenticate_or_request_with_http_basic('Administration') do |username, password|\n username == 'igp' && password == 'ehkra!Q2w#e'\n end\n end", "def authenticateA_P2(myMember)\n\trep=false\n\tm=Member.find_by_name(myMember.name)\n\tif m != nil\n\t\tif (m.id == cookies.signed[:user_id] )\n\t\t\trep=true\n\t\telsif (is_admin?)\n\t\t\trep = true\n\t\tend\n\tend\n\treturn rep\n end", "def auth_provided?\n !username.nil? && !password.nil?\n end", "def check_auth\n @slot.user == (current_user ) or raise AccessDenied\n end", "def user_authentication\n end", "def token_auth(*args, &block); end", "def is_authenticated?\n end", "def active_for_authentication?; end", "def active_for_authentication?; end", "def authenticateA_M\n authenticate_or_request_with_http_basic do |name, password|\n if m=Member.find_by_name(name) \n if (m.authenticate(password) && (m.id == cookies.signed[:user_id]))\n\t\t\tif(isInTeam? || is_admin?)\n\t\t\t\ttrue\n\t\t\telse\n\t\t\t\tfalse\n\t\t\tend\n\t\telse\n\t\t false\n\t\tend\n else\n false\n end\n end\n end", "def capable_plain_auth?; end", "def authenticate\n authenticate_or_request_with_http_basic do |user_name, password|\n # Change these to username and password required\n user_name == \"shitlister\" && password == \"letmein\"\n end\n end", "def auth\n if request.get?\n show_auth\n elsif request.post?\n check_auth\n end\n end", "def login_required\n return if authorized?\n unauthorized! unless auth.provided?\n bad_request! unless auth.basic?\n unauthorized! unless authorize(*auth.credentials)\n @req.env['REMOTE_USER'] = auth.username\n end", "def http_auth_login\n # FIXME: Implement\n end", "def basic_auth(opts); end", "def authenticate\n \t\tlogged_in? || access_denied\n \tend", "def authenticate!\n not_authorized() unless logged_in?()\n end", "def custom_authenticate_member(current_member)\n if current_member == nil && params[:master_api_key] != \"thisisatest\" \n render :json => { :errors => [\"Authorized users only.\"] }, status: 401\t\n end\n end", "def authenticated?; super; end", "def authenticate\n deny_access unless loged_in?\n end", "def auth?\n false\n end", "def auth_level\n 2\n end", "def authenticate\n unauthorized unless current_user\n end", "def auth\n cfg_get(:auth)\n end", "def auth_required\n unless Facts.config.user\n Facts.ui.puts \"Authorization required for this task, use `facts config`\"\n exit(0)\n end\n end", "def authenticate\n\t\tdeny_access unless signed_in?\n\tend", "def require_auth\n (authorized? && authenticated?) || halt(401)\n end", "def needs_authorization?\n true\n end", "def auth\n {:basic_auth => {:username => id, :password => password}}\n end", "def authenticate\n # see if user is disabled\n if session[:authenticated] && !Member.find(:first, :conditions => [ 'id = ? and active = 1', session[:member_id]])\n session[:authenticated] = nil\n session[:member_id] = nil\n flash[:notice] = 'Your account has been disabled by an administrator.'\n redirect_to :controller => '/members/auth', :action => 'login' and return false\n end\n \n # if user is not logged in, record the current request and redirect\n if !session[:authenticated]\n flash[:notice] = defined?(UnauthenticatedMessage) ? UnauthenticatedMessage : 'To continue, please log in.'\n save_request\n redirect_to :controller => '/management/user', :action => 'login' and return false\n end\n \n return false unless (@member = Member.find_by_id(session[:member_id]))\n @member\n end", "def authenticate\n\tdeny_access unless signed_in?\n end", "def authenticate!\n error!(\"401 Unauthorized\", 401) unless check_auth_token \n end", "def auth(args)\r\n auth_method = args.fetch(:type, :standard)\r\n standard_auth(args) if auth_method == :standard\r\n end", "def basic_auth(u, p)\n @auth = {:username => u, :password => p}\n end", "def authenticate\n self.get && true\n end", "def process_auth\n return if username.empty? || password.empty?\n \"#{username}:#{password}\"\n end", "def auth_as(min = :none)\n @current_user = (AuthorizeApiRequest.new(request.headers).call)[:user]\n case min\n when :admin\n is_atleast_admin(@current_user)\n when :member\n is_atleast_member(@current_user)\n when :guest\n is_atleast_guest(@current_user)\n else\n is_atleast_member(@current_user)\n end\n end", "def checkauth\n raise ZbxAPI_ExceptionBadAuth, 'Not logged in' if !loggedin?\n end", "def require_http_auth\n if `hostname` =~ /soykaf|lanpartei/i \n if auth = APP_CONFIG['http_auth']\n authenticate_or_request_with_http_basic do |user_name, password|\n user_name == auth['name'] && password == auth['password']\n end \n end\n end\n end", "def authentication_method\n super\n end", "def authenticated_admin\n\t authenticated\n\t error!('401 Unauthorized', 401) unless is_admin?\n\t end", "def basic_auth\n authenticate_or_request_with_http_basic do |username, password|\n username == Rails.application.credentials.basic[:username] && \n password == Rails.application.credentials.basic[:password]\n end\n end", "def authorize_member\n @user = User.find(params[:user_id])\n @group = Group.find(params[:group_id])\n auth_or_unauth_member(\"auth\", @user, @group)\n end", "def authenticate\n @shoonga = authenticate_or_request_with_http_basic do |username, password|\n username == \"4vght\" && password == \"we8vds\"\n end\nend", "def authenticate\n logged_in? || access_denied\n end", "def authentication_type; end", "def auth(user, password, domain = T.unsafe(nil)); end", "def admin_auth\n\t\tif signed_out?\n deny_access \"You must sign in first.\"\t\t\t\n\t\telse\n\t deny_access \"You must be an admin to perform that action.\" unless current_user.admin\n\t\tend\n end", "def authenticate\n logged_in? || access_denied\n end", "def host_authorization=(_arg0); end", "def host_authorization=(_arg0); end", "def authenticate_admin\n check_logout_param and authenticate_with_http_basic &auth_proc\n end", "def authorize(auth = {})\n @authentication ||= TicketMaster::Authenticator.new(auth)\n auth = @authentication\n if (auth.server.blank? and auth.username.blank? and auth.password.blank?)\n raise \"Please you should provide server, username and password\"\n end\n RedmineAPI.authenticate(auth.server, auth.username, auth.password)\n end", "def authenticate\n case request.format\n when Mime::XML, Mime::JSON\n unless logged_in? && admin?\n authenticate_or_request_with_http_basic do |user_name, password|\n user_name == USER_NAME && password == PASSWORD\n end\n end\n else\n render_404 and return unless logged_in? && admin?\n end\n end", "def login_from_basic_auth\nauthenticate_with_http_basic do |username, password|\nself.current_user = User.authenticate(username, password)\nend\nend", "def authenticate\n\t\t\tlogged_in? ? true : access_denied\n\t\tend", "def authenticate_manual \n api_key = request.headers['X-Api-Key']\n @member = Member.where(api_key: api_key).first if api_key\n\n unless @member\n head status: :unauthorized\n return false\n end\n end", "def needs_login?() false end", "def authenticate\n \tlogged_in? ? true : access_denied\n end", "def api_auth\n\t\tauth ::UApi\n\tend", "def authorization_mode; end", "def authenticate\n\tlogged_in? ? true : access_denied \n end", "def require_authenticated_user\n return if authenticate_or_request_with_http_basic do |ident_string, secret_string|\n ident_string == 'karl' && secret_string.to_s.crypt(ident_string)\n end\n render :text => \"You must be logged in to view this site\", :layout => false, :status => status\n end", "def web_auth\n\t\tauth ::UWeb\n\tend", "def auth_level\n fail 'sub-class to implement'\n end" ]
[ "0.7825281", "0.7579807", "0.7579807", "0.7325686", "0.7305579", "0.70795125", "0.6983063", "0.6935456", "0.6875348", "0.6857479", "0.685348", "0.6807214", "0.68011004", "0.68010664", "0.6797936", "0.6796126", "0.6796126", "0.67555845", "0.67438596", "0.67290306", "0.67207974", "0.67167383", "0.6698292", "0.66633534", "0.66584045", "0.6619777", "0.6619777", "0.6611978", "0.66044605", "0.6602096", "0.65887", "0.6584728", "0.6583033", "0.657995", "0.6577903", "0.657565", "0.65682065", "0.65673083", "0.65573776", "0.65566117", "0.65522504", "0.6549084", "0.6546252", "0.6546252", "0.6536718", "0.65365463", "0.6534676", "0.6534506", "0.65333426", "0.6518225", "0.65122056", "0.65095145", "0.65076077", "0.65054333", "0.6500764", "0.649832", "0.6497513", "0.6492065", "0.64872956", "0.64784104", "0.64702433", "0.6452772", "0.6440537", "0.6437395", "0.64311165", "0.6418039", "0.63900316", "0.6377206", "0.6366715", "0.63615537", "0.63470113", "0.6345482", "0.633706", "0.63340527", "0.63256377", "0.632542", "0.6325168", "0.63188773", "0.6317935", "0.6304231", "0.62984073", "0.6295362", "0.6294606", "0.62933797", "0.62918293", "0.6289295", "0.6289295", "0.6285978", "0.62830716", "0.6271987", "0.62710613", "0.6270945", "0.6268673", "0.6264167", "0.6262679", "0.62592417", "0.62591964", "0.62583655", "0.6253441", "0.62428206", "0.6236614" ]
0.0
-1
========================================================================== auth required ADMIN ==========================================================================
def destroy @story = Story.find(params[:id]) if @story.destroy flash[:notice] = "Artigo apagado" else flash[:error] = "Houve um problema ao apagar o artigo" end redirect_to stories_path end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def admin_auth\n\t\tif signed_out?\n deny_access \"You must sign in first.\"\t\t\t\n\t\telse\n\t deny_access \"You must be an admin to perform that action.\" unless current_user.admin\n\t\tend\n end", "def require_admin\n not_authorized(\"Invalid credentials.\") unless is_admin?\n end", "def authenticate_admin!\n access_denied! unless current_user.admin?\n end", "def authenticated_admin\n\t authenticated\n\t error!('401 Unauthorized', 401) unless is_admin?\n\t end", "def authorize_admin\n\t\tauthorize( ADMIN_USER_LEVEL ) \n\tend", "def require_admin\n unless !current_user.nil? && current_user.admin?\n render file: 'public/401.html', status: :unauthorized\n end\n end", "def authorize_as_admin\n create_admin_user\n login_into_alchemy\n end", "def authenticate_admin!\n current_user.is_admin? \n end", "def authenticate_admin\n unless current_user.admin?\n redirect_to site_path, alert: 'You do not have permission to access that page.' and return\n end\n end", "def authorize_admin!\n unless admin?\n flash[:alert] = 'Unauthorized access'\n redirect_to home_path\n false\n end\n end", "def admin_auth\n user = User.find_by(id: params[:user_id])\n if ! user\n \trender json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n return\n end \n if user.is? :admin\n render json: {}, status: 201\n else\n render json: {\n \"error\" => \"Unauthorized\"\n }, status: 401\n end \n end", "def authenticate_admin_user!\n raise SecurityError unless current_user.is_admin \n end", "def verify_admin\n render_401 unless current_user.is_admin?\n end", "def authorize_admin\n return unless !current_admin\n redirect_to root_path, alert: 'Admins only!'\n end", "def authenticate_admin!\n render_404 unless current_user.try(:admin?) && current_user\n end", "def ensure_admin!\n authorize! :read, :admin_dashboard\n end", "def ensure_admin!\n authorize! :read, :admin_dashboard\n end", "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end", "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end", "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end", "def require_admin!\n authenticate_user!\n\n if current_user && !current_user.admin?\n redirect_to root_path\n end\n end", "def authenticate_admin!\n raise SecurityError unless current_user.try(:admin?)\n end", "def authorize_admin\r\n unless session[:user_id] and\r\n User.find(session[:user_id]).level == 2\r\n session[:original_uri] = request.request_uri\r\n flash[:notice] = Resource.get(\"access_denied\")\r\n redirect_to(:controller => \"welcome\", :action => \"signin\")\r\n end\r\n end", "def authorize_admin!\n redirect_to login_path unless current_user\n end", "def require_admin\n if !logged_in? or !current_user.admin?\n redirect_to login_path, :alert => \"Access denied.\"\n end\n end", "def authorized\n\t unless admin?\n\t redirect_to root_path\n\t end\n end", "def authorize_admin\n return unless !current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end", "def authorize_admin\n return unless !current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end", "def require_admin\n grant_access?(\"index\", \"users\")\n #position?('admin')\n end", "def authorizeAdmin\n redirect_to '/adminlogin' unless admin_user\n end", "def adminprotected!\n if authorized? == true and isuseradmin? == true\n return\n else redirect '/denied'\n end\n end", "def authenticate_admin_user!\n raise SecurityError unless current_user.try(:admin?)\n end", "def authorize_admin\n return unless current_user.admin?\n redirect_to root_path, alert: 'Admins only!'\n end", "def require_admin\n deny_wrong_user if !admin?\n end", "def authenticate_admin_user!\n raise SecurityError unless current_admin_user.try(:is_admin?)\n end", "def authenticate_admin_user!\n unless current_user && current_user.admin?\n redirect_to login_path, alert: t(:please_log_in_as_admin)\n end\n end", "def admin_authorize\n unless admin?\n unauthorized_access\n end\n end", "def authorize_admin!\n\t\tredirect_to new_admin_session_path unless current_admin\n\tend", "def authenticate_admin_user!\r\n redirect_to new_user_session_path unless current_user.try(:is_admin?)\r\n end", "def check_admin\n if current_user && current_user.admin\n logger.info \"[auth] Allowed for #{current_user.email}\"\n true\n else\n logger.info (\"[auth] Access Denied\")\n redirect_to new_user_session\n end\n end", "def authenticate_admin!\n redirect_to new_user_session_path unless current_user && current_user.admin?\n end", "def authenticate_admin!\n redirect_to new_user_session_path unless current_user && current_user.admin?\n end", "def admin_required\n if current_user && current_user.admin\n return\n end\n redirect_to \"/login\", notice: 'Logga in som administratör.'\n end", "def admin_check\n render_401 && return unless current_user\n render_403 && return unless current_user.admin?\n end", "def authenticate_admin!\n unless current_user.admin?\n flash[:danger] = \"Sorry, you don't have premissions for this action.\"\n redirect_to root_path\n else\n true\n end\n end", "def authorize_admin\n redirect_to root_path, flash: {:error => \"User don't have admin privileges\"} unless isAdmin?\n end", "def admin_required\n if not admin?\n redirect \"/login?#{env[\"REQUEST_PATH\"]}\"\n end\n end", "def auth_admin\n if !current_user.admin\n redirect_back\n end\n end", "def auth_admin\n if !current_user.admin\n redirect_back\n end\n end", "def auth_admin\n if !current_user.admin\n redirect_back\n end\n end", "def authorize_admin!\n unless current_user && current_user.admin?\n # session[:redirected_from] = request.original_url\n redirect_to signin_path, error: 'You need to sign in'\n end\n end", "def require_admin\n unless current_user.admin\n flash[:notice] = \"Need admin account.\"\n redirect_to(\"/login\")\n end\n end", "def admin_authenticate\n authenticate and return if @logged_in.nil?\n unauthorized if !@sso_groups.include?(\"Admin\")\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def admin_access_required\n access_denied unless admin?\n end", "def authenticate_active_admin_user!\n authenticate_user!\n unless current_user.admin?\n flash[:alert] = \"Unauthorized Access!\"\n redirect_to root_path\n end\n end", "def authorize_admin\n redirect_to '/librarians/denied' unless current_user && current_user.admin?\n end", "def authenticate_admin_user!\n load_user\n unless @current_user && @current_user.admin?\n redirect_to(root_url)\n end\n end", "def authenticate_admin\n if !admin_is_signed_in?\n raise ActionController::RoutingError.new('Not Found')\n end\n # deny_access if !admin_is_signed_in?\n end", "def admin_user\n unless current_user.admin?\n format.json {render json: 'Bad credentials', status: 401}\n end\n end", "def authorize_admin!\n redirect_to home_path unless current_user&.admin\n end", "def w000thenticate_admin!\n check_token\n authenticate_user!\n raise AbstractController::ActionNotFound unless current_user.admin?\n end", "def authorize_as_admin\n raise(ExceptionHandler::AuthenticationError, Message.unauthorized) unless !current_user.nil? && current_user.is_admin?\n end", "def authenticate_admin_user!\n redirect_to(root_url, :alert => I18n.t('unauthorized.default')) unless current_user.try(:access_admin_section?)\n end", "def require_admin!\n # return if current token found and active\n return if current_admin\n\n # render error\n respond_with_error :unauthorized, I18n.t('not_authorized')\n end", "def authorize_admin\n redirect_to root_path, notice: \"You don't have access to admin pages.\" if !current_user.admin?\n end", "def check_admin\n if not ensure_admin\n redirect_to root_url, alert: \"you are not authorized\"\n end # end if\n end", "def authorize_admin\n redirect_to :login unless current_user.permission.manage_app ||\n current_user.permission.manage_attrs ||\n current_user.permission.manage_achievement_categories ||\n current_user.permission.manage_talent_trees ||\n current_user.permission.manage_talents ||\n current_user.permission.manage_quests ||\n current_user.permission.manage_skills ||\n current_user.permission.manage_achievements ||\n current_user.permission.manage_items ||\n current_user.permission.manage_titles\n end", "def authorise_admin\n redirect_to root_path, alert: \"You are not authorised to access that page\" if current_user.try(:admin?) != true\n end", "def autenticathe_admin!\n unless someone_is_logged_in? && is_admin_user?(current_user)\n redirect_to root_path\n end\n end", "def admin_only\n deny_access(\"Necesitas tener privilegios de administrador para entrar.\") unless signed_in_as_admin?\n end", "def check_admin\n\t\tif current_user && current_user.role == 2\n\t\telsif current_user && current_user.role != 2\n\t\t\tredirect_to buildings_url, notice: 'You are not authorized'\n\t\telse\n\t\t\tredirect_to buildings_url, notice: 'You are not logged in'\n\t\tend\n\tend", "def checkauth?\n unless is_admin?\n flash[:privileges]=\"Not enough privileges\"\n redirect_to root_path\n end\n end", "def admin_required\n current_user.is_admin? || access_denied\n end", "def authenticate_admin\n if authenticate_user!\n # if current_user\n unless current_user\n redirect_to root_path, alert: \"You are not authorised to perform that Operation\"\n # end\n end\n else\n redirect_to new_user_session_path, alert: \"You need to be signed !\"\n end\n\n end", "def require_admin\n unless @current_user.is_admin?\n set_notification_messages(\"authentication.permission_denied\", :error)\n redirect_or_popup_to_default_sign_in_page\n return\n end\n end", "def authenticate_admin\n unless current_user && current_user.admin?\n redirect_to(root_path) and return\n else\n return true\n end\n end", "def authorize_admin\n if user = User.find_by_id(session[:user_id])\n unless user.role == \"admin\"\n redirect_to login_url, :notice => \"You don't have permissions to view this page\"\n end\n end\n end", "def authenticate_admin!\n return redirect_to new_user_session_path if current_user.blank?\n redirect_to frontend_url unless current_user.admin?\n end", "def authenticate_admin!\n redirect_to words_path, :alert => \"You need to sign in as admin user.\" unless current_user.admin?\n end", "def authenticate_user!\n current_user.is_admin?\n end", "def authenticate\n\t\tunless admin?\n\t\t\tflash[:error] = 'unauthorized access'\n\t\t\tredirect_to home_path\n\t\tend\n\tend", "def authorize_admin\n redirect_to(:controller => 'main', :action => 'index') and return false unless @logged_in_user.is_admin?\n end", "def require_admin\n if user_signed_in?\n unless current_user.is_admin?\n redirect_to root_path\n end\n end\n end", "def show\n # authorize Admin\n end", "def admin_only\n if !Volt.current_user.admin\n redirect_to '/login'\n end\n end", "def require_authorization\n if user_signed_in?\n redirect_to root_url, :notice => \"Access Denied\" unless current_user.admin?\n else\n redirect_to root_url, :notice => \"Please Sign In\"\n end\n end", "def authorize_admin\n redirect_to root_path unless current.user.immortal?\n end", "def authenticate_admin!\n if self.class.name =~ /Admin/ && current_user.is_mod?\n redirect_to admin_flagged_replies_path\n false\n elsif self.class.name =~ /Admin/ && !current_user.is_admin?\n flash[:alert] = t('flash.application.should_be_admin')\n (redirect_to :back rescue redirect_to root_path)\n false\n else\n true\n end\n end", "def require_admin\n #byebug\n redirect_to user_path(current_user) unless current_user.role === \"Admin\"\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin') || access_denied\n end", "def authenticate_admin\n unless current_user.admin?\n redirect_to merge_default_redirect_params(site_path, scpbr: params[:scpbr]), alert: 'You do not have permission to access that page.' and return\n end\n end", "def authenticate_admin\n unless current_user.admin?\n redirect_to merge_default_redirect_params(site_path, scpbr: params[:scpbr]), alert: 'You do not have permission to access that page.' and return\n end\n end", "def require_admin\n if logged_in? and !current_user.admin?\n #flash[:danger] = 'Only admin users can perform that action'\n redirect_to root_path\n end\n end", "def authorize\n unless admin?\n flash[:error] = \"unauthorized access\"\n redirect_to home_path\n false\n end\n end", "def require_admin\n if logged_in? and !current_user\n flash[:danger] = \"Only admin users can perform that action.\"\n redirect_to root_path\n end\n end", "def authorize_admin\n return if current_customer.admin?\n redirect_to root_path, alert: 'Admins only!' unless current_customer and current_customer.admin?\n end", "def authenticate_admin_hr\n unless current_user && (get_loging_permission !=1 || get_loging_permission !=2)\n redirect_to sign_in_path\n return \n end\n end", "def admin_required\n self.current_user != :false && \n self.current_user.is_admin? ? true : access_denied\n end", "def check_admin_authentication\n if session[:user] and is_admin?\n return true\n end\n # call overwriteable reaction to unauthorized access\n access_denied\n return false \n # unless session[:user] and is_admin?\n # session[:intended_action] = action_name\n # session[:intended_controller] = '/admin/' + controller_name\n # session[:intended_id] = params[:id]\n # flash[:error] = 'You must be logged in as an administrator to access this resource.'\n # redirect_to :controller => '/account', :action => 'login'\n # end\n end" ]
[ "0.82346433", "0.81284076", "0.7978326", "0.78942806", "0.78402317", "0.7836018", "0.7776646", "0.77433765", "0.77412987", "0.77393734", "0.77345943", "0.76695806", "0.7664144", "0.76613647", "0.76588535", "0.76515394", "0.76515394", "0.76496047", "0.76496047", "0.7649247", "0.7648973", "0.76343906", "0.76340854", "0.7630826", "0.76083356", "0.76071584", "0.7603134", "0.7603134", "0.7596698", "0.7595039", "0.7591506", "0.75908256", "0.75777555", "0.75702596", "0.75651467", "0.7563943", "0.7561063", "0.7558524", "0.75566876", "0.75458366", "0.7543468", "0.7543468", "0.75418466", "0.7521725", "0.7519921", "0.7512378", "0.7510763", "0.75086313", "0.75086313", "0.75086313", "0.7505433", "0.74966633", "0.74883395", "0.74856585", "0.74856585", "0.74856585", "0.7468161", "0.7464819", "0.7463807", "0.7460851", "0.744641", "0.7443884", "0.7442653", "0.7440863", "0.7436749", "0.7431699", "0.74311215", "0.7421251", "0.74173915", "0.7416781", "0.7414102", "0.7407559", "0.73964965", "0.7383517", "0.73833776", "0.73683417", "0.73601", "0.7357995", "0.7355138", "0.7348785", "0.7347785", "0.73430824", "0.7341909", "0.733539", "0.7320199", "0.7319811", "0.7311976", "0.73078185", "0.7304471", "0.73020875", "0.73011744", "0.7300217", "0.7292984", "0.7292984", "0.7291606", "0.72812223", "0.72806233", "0.72659326", "0.726585", "0.7259398", "0.7256349" ]
0.0
-1
GET /portal_grades GET /portal_grades.xml
def index # PUNDIT_REVIEW_AUTHORIZE # PUNDIT_CHECK_AUTHORIZE # authorize Portal::Grade # PUNDIT_REVIEW_SCOPE # PUNDIT_CHECK_SCOPE (did not find instance) # @grades = policy_scope(Portal::Grade) @portal_grades = Portal::Grade.all respond_to do |format| format.html # index.html.erb format.xml { render :xml => @portal_grades } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_grades\r\n grade_nodes = BankNodestructure.grade_gather(params[:subject])\r\n render json: grade_nodes.to_json\r\n end", "def get_grades(user_id, course_id, use_source_domain = nil)\r\n relative_url = Path::USERS_COURSES_GRADEBOOK_USERGRADEBOOKITEMS \r\n\t if !use_source_domain.nil?\r\n\t\trelative_url = get_grades_url(use_source_domain)\r\n\t end\r\n\t relative_url = relative_url % [user_id, course_id]\t \r\n\t get(relative_url)\r\n end", "def show\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @grade\n @portal_grade = Portal::Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @portal_grade }\n end\n end", "def new\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_grade }\n end\n end", "def index\n @grades = Grade.all\n end", "def index\n @grades = Grade.all\n end", "def index\n @grades = Grade.all\n end", "def index\n @grades = Grade.all\n end", "def grades\n @learn_grades\n end", "def index\n @grades = Grade.all\n render json: {data: @grades, status: \"SUCCESS\"}, :status => 200\n end", "def show\n @staffgrade = Staffgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end", "def index\n @member_grades = MemberGrade.all\n end", "def view_grades\n @course = Course.find(params[:id])\n end", "def show\n @ms_offgrade = MsOffgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ms_offgrade }\n end\n end", "def index\n @portal_learners = Portal::Learner.search(params[:search], params[:page], nil)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @portal_learners }\n end\n end", "def create\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new(params[:portal_grade])\n\n respond_to do |format|\n if @portal_grade.save\n flash[:notice] = 'Grade was successfully created.'\n format.html { redirect_to(@portal_grade) }\n format.xml { render :xml => @portal_grade, :status => :created, :location => @portal_grade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n items_per_page = 20\n if params[:grade]\n @courses = Course.with_grade_level(params[:grade]).paginate(page: params[:page], per_page: items_per_page)\n @grade = GradeLevel.where(id: params[:grade])\n else\n @courses = Course.paginate(page: params[:page], per_page: items_per_page)\n end\n end", "def show\n render json: @grade\n end", "def show\n \n begin\n @topic_activity_summaries = \n TopicActivitySummary.find_all_by_student_id_and_grade(params[:id], params[:grade])\n rescue Exception => e \n respond_to do |format|\n format.xml { render :xml => errorRsp( e.message) }\n end\n return\n end\n\t \n respond_to do |format|\n format.xml { render :xml => @topic_activity_summaries.to_xml(:dasherize => false) }\n end\n end", "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end", "def index\n @final_grades = FinalGrade.all\n end", "def index\n @grade_calcs = GradeCalc.all\n end", "def new\n @staffgrade = Staffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end", "def get_gradebook_item_grades(course_id, gradebook_item_id,\r\n graded_student_ids = nil,\r\n use_source_domain = nil,\r\n expand_user = nil)\r\n relative_url = Path::COURSES_GRADEBOOKITEMS_GRADES % [course_id, gradebook_item_id]\r\n if use_source_domain.nil?\r\n relative_url = update_gradebook_item_grade_relative_url(relative_url,\r\n graded_student_ids,\r\n use_source_domain,\r\n expand_user)\r\n end\r\n\r\n get(relative_url)\r\n end", "def index\n @degrees = Degree.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @degrees }\n end\n end", "def show_grades(grades, format)\n puts 'Assessment\\'s grades'\n puts AssessmentSerializer::serialize_grades(grades, format)\n puts\n end", "def index\n @gradeworks_id = params[:idGrade] #No Almacena nada....\n p @gradeworks_id\n @gradeworks = Gradework.all\n @juries = User.users_jury\n @directors = User.users_director\n @students = User.users_student\n @grad_jury = User.jury_gradework(1).joins(:roles).where(roles: {name: \"Jury\"})\n @grad_director = User.jury_gradework(1).joins(:roles).where(roles: {name: \"Director\"})\n @grad_student = User.jury_gradework(1).joins(:roles).where(roles: {name: \"Student\"})\n end", "def index\n @assessments = @location.assessments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assessments }\n end\n end", "def index\n @criterion_grades = CriterionGrade.all\n end", "def index\n @assignments = @user.assignments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assignments }\n end\n end", "def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end", "def show\n @student_grade_personality = StudentGradePersonality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @student_grade_personality }\n end\n end", "def index\n @labs = @course.labs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @labs }\n end\n end", "def index\n @average_grades = AverageGrade.all\n end", "def student_report\n offering_id = params[:id]\n offering = Portal::Offering.find(offering_id)\n authorize offering\n student_id = current_visitor.portal_student.id\n report = DefaultReportService::default_report_for_offering(offering)\n raise ActionController::RoutingError.new('Default Report Not Found') unless report\n next_url = report.url_for_offering(offering, current_visitor, request.protocol, request.host_with_port, { student_id: student_id })\n redirect_to next_url\n end", "def index\n @catgrades = Catgrade.all\n end", "def get_grade(user_id, course_id, gradebook_item_id, use_source_domain = nil)\r\n relative_url = Path::USERS_COURSES_GRADEBOOK_GRADEBOOKITEMS_GRADE\r\n if !use_source_domain.nil?\r\n relative_url = get_grade_url(use_source_domain)\r\n end\r\n relative_url = relative_url % [user_id, course_id, gradebook_item_id]\r\n get(relative_url)\r\n end", "def index\n @measures = current_user.account.measures.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @measures }\n end\n end", "def show\n @course = Course.includes(:teachers, :students).find(params[:id])\n current_user_enrollment = @course.enrollments.where(:user_id => current_user.id).first\n @grade = Grade.new(current_user_enrollment.grade) if current_user_enrollment\n @average_grade = Grade.new(@course.average_gradepoint) if can? :manage, @course\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def index\n @assignments = Assignment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assignments }\n end\n end", "def show\n @studentgrade = Studentgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @studentgrade }\n end\n end", "def index\n @title = t 'view.grades.index_title'\n @searchable = true\n @grades = @grades.filtered_list(params[:q]).page(params[:page]).uniq('id')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grades }\n end\n end", "def show\n @graded_component = GradedComponent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graded_component }\n end\n end", "def index\n @ratgrades = Ratgrade.all\n respond_to do |format|\n format.html\n format.js # index.html.erb\n format.xml { render :xml => @ratgrades }\n end\n end", "def show\n @grade = Grade.find(params[:id])\n respond_to do |format|\n format.html \n format.json { render :json => @grade.as_json(:include => :assignment) }\n end\n end", "def new\n @student = Student.new\n @grade = { '6' => '6', '5' => '5', '4' => '4', '3' => '3', '2' => '2', '1' => '1' }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def index\n if params[:assignment_id] && current_user.teacher?\n @assignment = Assignment.find(params[:assignment_id])\n @grades = @assignment.grades\n elsif params[:id] && current_user.teacher?\n @user = User.find(params[:id])\n elsif current_user.teacher?\n @assignments = current_user.assignments\n else\n @user = current_user\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @assignment.to_json(:include => :grades ) } \n end\n end", "def index\n @pledges = current_user.pledges\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pledges }\n end\n end", "def download_grades\n @course = Course.find(params[:id])\n book = Spreadsheet::Workbook.new\n sheet = book.create_worksheet :name => 'All Student Grades'\n\n fmt = Spreadsheet::Format.new :number_format => '0.0'\n sheet.column(2).default_format = fmt\n\n head = Spreadsheet::Format.new :weight => :bold, :size => 24, :horizontal_align => :center, :vertical_align => :middle\n sheet.merge_cells(0,0,2,2)\n sheet.row(0).default_format = head\n sheet.row(0).push @course.name + \" Grades\"\n\n top = Spreadsheet::Format.new :weight => :bold, :size => 18, :horizontal_align => :center\n sheet.row(3).default_format = top\n sheet.row(3).push \"First Name\", \"Last Name\"\n\n row = 4\n @course.users.each do |name|\n if not name.has_local_role? :grader, @course\n sheet.row(row).push name.first_name, name.last_name\n row += 1\n end\n end\n\n col = 2\n @course.assignments.each do |assignment|\n sheet.row(3).push assignment.name\n sheet.column(col).width = 15\n row = 4\n @course.users.each do |name|\n if not name.has_local_role? :grader, @course\n submission = assignment.submissions.select { |s| s.user == name }.first\n sheet.row(row).push submission.grade\n row += 1\n end\n end\n col += 1\n end\n\n sheet.column(0).width = 30\n sheet.column(1).width = 30\n\n blob = StringIO.new\n book.write blob\n send_data blob.string, :filename => @course.name + \"_grades.xls\", :type => \"application/xls\"\n end", "def show\n\t\t@grade = Grade.find_by_assignment_id_and_user_id(@assignment.id, @current_user.id)\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @assignment }\n\t\tend\n\tend", "def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @guides }\n end\n end", "def new\n @ratgrade = Ratgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ratgrade }\n end\n end", "def get_grades(student, school)\t\t\t\t\t\t\t\t\t\t\t\t\t#a. create method to return student's grade\n\tschool[:students].each do |s|\n\t\tputs s[:grade] if s[:name] == student\n\tend\nend", "def index\n check_authorization\n #@badges = Badge.find(:all, :conditions => [\"organization_id = ? and segment_id = ?\", @organization.id, @segment.id ] )\n @badges = Badge.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @badges }\n end\n end", "def new\n @ms_offgrade = MsOffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ms_offgrade }\n end\n end", "def index\n @grades_tournaments = GradesTournament.all\n end", "def index\n @graduates = Graduate.all\n end", "def index\n @department = Department.find(params[:department_id])\n @degree_programs = DegreeProgram.search(params[:search], params[:page],params[:department_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @degree_programs }\n end\n end", "def index\n @my_badges = current_account.my_badges \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_my_badges }\n end\n end", "def get_gradebook_item_grade(course_id, gradebook_item_id, grade_id,\r\n graded_student_ids = nil, use_source_domain = nil,\r\n expand_user = nil)\r\n relative_url = Path::COURSES_GRADEBOOKITEMS_GRADES_ % [course_id,\r\n gradebook_item_id,\r\n grade_id]\r\n if use_source_domain.nil?\r\n relative_url = update_gradebook_item_grade_relative_url(relative_url,\r\n graded_student_ids,\r\n use_source_domain,\r\n expand_user)\r\n end\r\n\r\n get(relative_url)\r\n end", "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "def show\n @student_graduatedship = StudentGraduatedship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @student_graduatedship }\n end\n end", "def grade\n @grade\n end", "def show\n @graduation = Graduation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graduation }\n end\n end", "def index\n @best_laps = BestLap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @best_laps }\n end\n end", "def show\n @ability_score = AbilityScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ability_score }\n end\n end", "def multiple_choice_report\n @portal_learner = Portal::Learner.find(params[:id])\n \n respond_to do |format|\n format.html # report.html.haml\n end\n end", "def new\n @portal_learner = Portal::Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_learner }\n end\n end", "def show\n @graduate_school_ranking = GraduateSchoolRanking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graduate_school_ranking }\n end\n end", "def show\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def grades\n @grade_entry_form = GradeEntryForm.find(params[:id])\n end", "def index\n @upgrades = Upgrade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @upgrades }\n end\n end", "def index\n @graduations = Graduation.all\n end", "def index\n @achievements = Achievement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @achievements }\n end\n end", "def index\n @student_goal_evaluations = StudentGoalEvaluation.all\n end", "def index\n @ganglia_graphs = GangliaGraph.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ganglia_graphs }\n end\n end", "def new\n @student_graduatedship = StudentGraduatedship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_graduatedship }\n end\n end", "def index\n @graduate_school_rankings = GraduateSchoolRanking.all.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @graduate_school_rankings }\n end\n end", "def show\n @course_degree = CourseDegree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @course_degree }\n end\n end", "def show\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def show\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def index\n @goals = Goal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @goals }\n end\n end", "def index\n @certs = Cert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @certs }\n end\n end", "def abilities\n get('/ability/')\n end", "def get_current_grades(course_id, student_ids = nil, offset = nil, limit = nil)\r\n if offset.nil?\r\n relative_url = get_current_grades_without_offset_url(course_id, student_ids)\r\n elsif !student_ids.nil?\r\n relative_url = get_current_grades_with_offset_url(course_id, student_ids, offset, limit)\r\n else\r\n relative_url = Path::COURSES_GRADEBOOK_ROSTERCOURSEGRADESTODATE_OFFSET_LIMIT_ % [course_id,\r\n offset.to_s,\r\n limit.to_s]\r\n end\r\n get(relative_url)\r\n end", "def show\n @assignment = @school.assignments.find(params[:id])\n @grade = @assignment.grades.where(\"user_id = ?\",current_user.id).first\n @checker = User.find(@grade.staff_id) if @grade and @grade.staff_id\n respond_to do |format|\n format.html\n end\n end", "def new\n @student_grade_personality = StudentGradePersonality.new\n @student = Student.find(params[:student_id])\n @student_grade_field = StudentAdditionalGradeField.find(params[:field_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_grade_personality }\n end\n end", "def index\n @education_levels = EducationLevel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @education_levels }\n end\n end", "def index\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Learner\n # PUNDIT_REVIEW_SCOPE\n # PUNDIT_CHECK_SCOPE (did not find instance)\n # @learners = policy_scope(Portal::Learner)\n @portal_learners = Portal::Learner.search(params[:search], params[:page], nil)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @portal_learners }\n end\n end", "def show\n #@grade_book = Gradebook.all\n end", "def index\n @academic_degrees = AcademicDegree.all\n end", "def bundle_report\n @portal_learner = Portal::Learner.find(params[:id])\n \n respond_to do |format|\n format.html # report.html.haml\n end\n end", "def index\n @referrals = Referral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @referrals }\n end\n end", "def rights_overview\n\t\t@survey = Survey.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html \n\t\t\tformat.xml { render :xml => @survey }\n\t\tend\n\tend", "def getSalesReport(year, month)\n #url = sprintf('https://market.android.com/publish/salesreport/download?report_date=%04d_%02d', year, month)\n url = sprintf('https://play.google.com/apps/publish/salesreport/download?report_date=%04d_%02d&report_type=payout_report&dev_acc=%s', year, month, @dev_acc)\n try_get(url)\n return @agent.page.body\n end", "def index\n nodes = DifficultLevel.all\n respond_to do |format|\n format.html { render :index, locals: { nodes: nodes } }\n end\n end", "def get_gradebook_items(course_id)\r\n get(Path::COURSES_GRADEBOOKITEMS % [course_id])\r\n end", "def index\n @grade_sections = GradeSectionHistory.all\n end", "def index\n @giving_groups = GivingGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @giving_groups }\n end\n end", "def index\n @course_registrants = CourseRegistrant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @course_registrants }\n end\n end" ]
[ "0.6848463", "0.6273877", "0.6213627", "0.6159683", "0.60664153", "0.60664153", "0.60664153", "0.60664153", "0.60399175", "0.59853023", "0.5867989", "0.5865154", "0.58452487", "0.57138264", "0.56874514", "0.5670687", "0.5666528", "0.56659317", "0.56618047", "0.565782", "0.5650671", "0.5641703", "0.56402636", "0.5639042", "0.56370384", "0.5630309", "0.55907255", "0.55695707", "0.5565723", "0.5554991", "0.55404943", "0.5536964", "0.55182856", "0.5511516", "0.5487003", "0.54849297", "0.546913", "0.5462784", "0.54481", "0.5445062", "0.5442573", "0.54364824", "0.5427251", "0.54103816", "0.54065055", "0.5401034", "0.53947204", "0.53861886", "0.53763735", "0.53738403", "0.5372328", "0.5367485", "0.5365752", "0.5363782", "0.53412825", "0.5340503", "0.533815", "0.5335447", "0.53266275", "0.53259534", "0.5321898", "0.5308539", "0.529337", "0.529214", "0.5287314", "0.5284118", "0.52750164", "0.52689344", "0.5263793", "0.525797", "0.52560216", "0.52517074", "0.5251283", "0.52509815", "0.5247628", "0.5234655", "0.52267486", "0.52231866", "0.5223072", "0.52218395", "0.52218395", "0.5212536", "0.5208092", "0.52032286", "0.5194902", "0.5188548", "0.5185069", "0.5182255", "0.517828", "0.51761603", "0.51710874", "0.51706785", "0.5163309", "0.5161723", "0.5160201", "0.516008", "0.5149799", "0.5148725", "0.51401407", "0.51357335" ]
0.67424566
1
GET /portal_grades/1 GET /portal_grades/1.xml
def show # PUNDIT_REVIEW_AUTHORIZE # PUNDIT_CHECK_AUTHORIZE (did not find instance) # authorize @grade @portal_grade = Portal::Grade.find(params[:id]) respond_to do |format| format.html # show.html.erb format.xml { render :xml => @portal_grade } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n # PUNDIT_REVIEW_SCOPE\n # PUNDIT_CHECK_SCOPE (did not find instance)\n # @grades = policy_scope(Portal::Grade)\n @portal_grades = Portal::Grade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @portal_grades }\n end\n end", "def get_grades\r\n grade_nodes = BankNodestructure.grade_gather(params[:subject])\r\n render json: grade_nodes.to_json\r\n end", "def new\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_grade }\n end\n end", "def show\n @staffgrade = Staffgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end", "def show\n \n begin\n @topic_activity_summaries = \n TopicActivitySummary.find_all_by_student_id_and_grade(params[:id], params[:grade])\n rescue Exception => e \n respond_to do |format|\n format.xml { render :xml => errorRsp( e.message) }\n end\n return\n end\n\t \n respond_to do |format|\n format.xml { render :xml => @topic_activity_summaries.to_xml(:dasherize => false) }\n end\n end", "def show\n @ms_offgrade = MsOffgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ms_offgrade }\n end\n end", "def new\n @staffgrade = Staffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end", "def index\n @grades = Grade.all\n end", "def index\n @grades = Grade.all\n end", "def index\n @grades = Grade.all\n end", "def index\n @grades = Grade.all\n end", "def view_grades\n @course = Course.find(params[:id])\n end", "def get_grades(user_id, course_id, use_source_domain = nil)\r\n relative_url = Path::USERS_COURSES_GRADEBOOK_USERGRADEBOOKITEMS \r\n\t if !use_source_domain.nil?\r\n\t\trelative_url = get_grades_url(use_source_domain)\r\n\t end\r\n\t relative_url = relative_url % [user_id, course_id]\t \r\n\t get(relative_url)\r\n end", "def create\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new(params[:portal_grade])\n\n respond_to do |format|\n if @portal_grade.save\n flash[:notice] = 'Grade was successfully created.'\n format.html { redirect_to(@portal_grade) }\n format.xml { render :xml => @portal_grade, :status => :created, :location => @portal_grade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def show\n @student_grade_personality = StudentGradePersonality.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @student_grade_personality }\n end\n end", "def index\n @grades = Grade.all\n render json: {data: @grades, status: \"SUCCESS\"}, :status => 200\n end", "def new\n @ratgrade = Ratgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ratgrade }\n end\n end", "def show\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end", "def show\n @graded_component = GradedComponent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graded_component }\n end\n end", "def student_report\n offering_id = params[:id]\n offering = Portal::Offering.find(offering_id)\n authorize offering\n student_id = current_visitor.portal_student.id\n report = DefaultReportService::default_report_for_offering(offering)\n raise ActionController::RoutingError.new('Default Report Not Found') unless report\n next_url = report.url_for_offering(offering, current_visitor, request.protocol, request.host_with_port, { student_id: student_id })\n redirect_to next_url\n end", "def new\n @student = Student.new\n @grade = { '6' => '6', '5' => '5', '4' => '4', '3' => '3', '2' => '2', '1' => '1' }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def index\n @degrees = Degree.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @degrees }\n end\n end", "def index\n @assignments = @user.assignments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assignments }\n end\n end", "def new\n @ms_offgrade = MsOffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ms_offgrade }\n end\n end", "def index\n @labs = @course.labs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @labs }\n end\n end", "def index\n @portal_learners = Portal::Learner.search(params[:search], params[:page], nil)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @portal_learners }\n end\n end", "def index\n @member_grades = MemberGrade.all\n end", "def index\n @assignments = Assignment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assignments }\n end\n end", "def rest_get(uri)\n \n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n return doc\n \n end\n \nend", "def show\n @student_graduatedship = StudentGraduatedship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @student_graduatedship }\n end\n end", "def index\n @gradeworks_id = params[:idGrade] #No Almacena nada....\n p @gradeworks_id\n @gradeworks = Gradework.all\n @juries = User.users_jury\n @directors = User.users_director\n @students = User.users_student\n @grad_jury = User.jury_gradework(1).joins(:roles).where(roles: {name: \"Jury\"})\n @grad_director = User.jury_gradework(1).joins(:roles).where(roles: {name: \"Director\"})\n @grad_student = User.jury_gradework(1).joins(:roles).where(roles: {name: \"Student\"})\n end", "def index\n @assessments = @location.assessments\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assessments }\n end\n end", "def grades\n @learn_grades\n end", "def show\n @graduation = Graduation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graduation }\n end\n end", "def index\n @guides = Guide.all\n #@guide = Guide.find(params[:guide]) rescue nil\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @guides }\n end\n end", "def show\n @graduate_school_ranking = GraduateSchoolRanking.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graduate_school_ranking }\n end\n end", "def show\n render json: @grade\n end", "def show\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def new\n @student_graduatedship = StudentGraduatedship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_graduatedship }\n end\n end", "def show\n @studentgrade = Studentgrade.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @studentgrade }\n end\n end", "def new\n @portal_learner = Portal::Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_learner }\n end\n end", "def show\n @ability_score = AbilityScore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ability_score }\n end\n end", "def index\n items_per_page = 20\n if params[:grade]\n @courses = Course.with_grade_level(params[:grade]).paginate(page: params[:page], per_page: items_per_page)\n @grade = GradeLevel.where(id: params[:grade])\n else\n @courses = Course.paginate(page: params[:page], per_page: items_per_page)\n end\n end", "def index\n @measures = current_user.account.measures.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @measures }\n end\n end", "def index\n @grade_calcs = GradeCalc.all\n end", "def show\n @course_degree = CourseDegree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @course_degree }\n end\n end", "def show\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def show\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def index\n @department = Department.find(params[:department_id])\n @degree_programs = DegreeProgram.search(params[:search], params[:page],params[:department_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @degree_programs }\n end\n end", "def download_grades\n @course = Course.find(params[:id])\n book = Spreadsheet::Workbook.new\n sheet = book.create_worksheet :name => 'All Student Grades'\n\n fmt = Spreadsheet::Format.new :number_format => '0.0'\n sheet.column(2).default_format = fmt\n\n head = Spreadsheet::Format.new :weight => :bold, :size => 24, :horizontal_align => :center, :vertical_align => :middle\n sheet.merge_cells(0,0,2,2)\n sheet.row(0).default_format = head\n sheet.row(0).push @course.name + \" Grades\"\n\n top = Spreadsheet::Format.new :weight => :bold, :size => 18, :horizontal_align => :center\n sheet.row(3).default_format = top\n sheet.row(3).push \"First Name\", \"Last Name\"\n\n row = 4\n @course.users.each do |name|\n if not name.has_local_role? :grader, @course\n sheet.row(row).push name.first_name, name.last_name\n row += 1\n end\n end\n\n col = 2\n @course.assignments.each do |assignment|\n sheet.row(3).push assignment.name\n sheet.column(col).width = 15\n row = 4\n @course.users.each do |name|\n if not name.has_local_role? :grader, @course\n submission = assignment.submissions.select { |s| s.user == name }.first\n sheet.row(row).push submission.grade\n row += 1\n end\n end\n col += 1\n end\n\n sheet.column(0).width = 30\n sheet.column(1).width = 30\n\n blob = StringIO.new\n book.write blob\n send_data blob.string, :filename => @course.name + \"_grades.xls\", :type => \"application/xls\"\n end", "def new\n @student_grade_personality = StudentGradePersonality.new\n @student = Student.find(params[:student_id])\n @student_grade_field = StudentAdditionalGradeField.find(params[:field_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_grade_personality }\n end\n end", "def multiple_choice_report\n @portal_learner = Portal::Learner.find(params[:id])\n \n respond_to do |format|\n format.html # report.html.haml\n end\n end", "def index\n @ratgrades = Ratgrade.all\n respond_to do |format|\n format.html\n format.js # index.html.erb\n format.xml { render :xml => @ratgrades }\n end\n end", "def index\n @final_grades = FinalGrade.all\n end", "def index\n @upgrades = Upgrade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @upgrades }\n end\n end", "def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def show\n @portal = Portal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @portal }\n end\n end", "def show_grades(grades, format)\n puts 'Assessment\\'s grades'\n puts AssessmentSerializer::serialize_grades(grades, format)\n puts\n end", "def index\n check_authorization\n #@badges = Badge.find(:all, :conditions => [\"organization_id = ? and segment_id = ?\", @organization.id, @segment.id ] )\n @badges = Badge.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @badges }\n end\n end", "def show\n\t\t@grade = Grade.find_by_assignment_id_and_user_id(@assignment.id, @current_user.id)\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @assignment }\n\t\tend\n\tend", "def index\n @best_laps = BestLap.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @best_laps }\n end\n end", "def index\n @certs = Cert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @certs }\n end\n end", "def show\n @grade = Grade.find(params[:id])\n respond_to do |format|\n format.html \n format.json { render :json => @grade.as_json(:include => :assignment) }\n end\n end", "def show\n @course = Course.includes(:teachers, :students).find(params[:id])\n current_user_enrollment = @course.enrollments.where(:user_id => current_user.id).first\n @grade = Grade.new(current_user_enrollment.grade) if current_user_enrollment\n @average_grade = Grade.new(@course.average_gradepoint) if can? :manage, @course\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @course }\n end\n end", "def index\n @ganglia_graphs = GangliaGraph.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ganglia_graphs }\n end\n end", "def show\n @lab = @course.labs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @lab }\n end\n end", "def show\n @ganglia_graph = GangliaGraph.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ganglia_graph }\n end\n end", "def show\n @assignment = @school.assignments.find(params[:id])\n @grade = @assignment.grades.where(\"user_id = ?\",current_user.id).first\n @checker = User.find(@grade.staff_id) if @grade and @grade.staff_id\n respond_to do |format|\n format.html\n end\n end", "def show\n @required_degree = RequiredDegree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @required_degree }\n end\n end", "def show\n @best_lap = BestLap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @best_lap }\n end\n end", "def index\n @criterion_grades = CriterionGrade.all\n end", "def index\n @graduate_school_rankings = GraduateSchoolRanking.all.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @graduate_school_rankings }\n end\n end", "def bundle_report\n @portal_learner = Portal::Learner.find(params[:id])\n \n respond_to do |format|\n format.html # report.html.haml\n end\n end", "def show\n @enrollment = Enrollment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @enrollment }\n end\n end", "def rights_overview\n\t\t@survey = Survey.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html \n\t\t\tformat.xml { render :xml => @survey }\n\t\tend\n\tend", "def new\n @graduate_school_ranking = GraduateSchoolRanking.new\n\t@college_lists = CollegeList.find_by_sql(\"select name_en, id from college_lists order by name_en\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graduate_school_ranking }\n end\n end", "def show\n @evaluate_course = EvaluateCourse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evaluate_course }\n end\n end", "def index\n @algorithms = Algorithm.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @algorithms }\n end\n end", "def index\n @title = t 'view.grades.index_title'\n @searchable = true\n @grades = @grades.filtered_list(params[:q]).page(params[:page]).uniq('id')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grades }\n end\n end", "def index\n @catgrades = Catgrade.all\n end", "def get_gradebook_item_grades(course_id, gradebook_item_id,\r\n graded_student_ids = nil,\r\n use_source_domain = nil,\r\n expand_user = nil)\r\n relative_url = Path::COURSES_GRADEBOOKITEMS_GRADES % [course_id, gradebook_item_id]\r\n if use_source_domain.nil?\r\n relative_url = update_gradebook_item_grade_relative_url(relative_url,\r\n graded_student_ids,\r\n use_source_domain,\r\n expand_user)\r\n end\r\n\r\n get(relative_url)\r\n end", "def show\n set_grade_list\n set_sex_list\n @student = Student.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @student }\n end\n end", "def show\n @lr70 = Lr70.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lr70 }\n end\n end", "def index\n if params[:assignment_id] && current_user.teacher?\n @assignment = Assignment.find(params[:assignment_id])\n @grades = @assignment.grades\n elsif params[:id] && current_user.teacher?\n @user = User.find(params[:id])\n elsif current_user.teacher?\n @assignments = current_user.assignments\n else\n @user = current_user\n end\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @assignment.to_json(:include => :grades ) } \n end\n end", "def index\n @goals = Goal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @goals }\n end\n end", "def index\n @course_registrants = CourseRegistrant.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @course_registrants }\n end\n end", "def index\n @my_badges = current_account.my_badges \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_my_badges }\n end\n end", "def index\n @average_grades = AverageGrade.all\n end", "def index\n @referrals = Referral.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @referrals }\n end\n end", "def show\n @title = t 'view.grades.show_title'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grade }\n end\n end", "def show\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @guide }\n end\n end", "def new\n @graded_component = GradedComponent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graded_component }\n end\n end", "def index\n @distributions = @foyer.distributions\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @distributions }\n end\n end", "def allergies\n raise UserNotAuthenticated unless access_token\n\n get('records/allergies')\n end", "def show\n @lookup_demographichandedness = LookupDemographichandedness.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @lookup_demographichandedness }\n end\n end", "def show\n @education = Education.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @education }\n end\n end", "def show\n @degree_program = DegreeProgram.find(params[:id])\n @department = Department.find(@degree_program.department.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @degree_program }\n end\n end", "def get_grade(user_id, course_id, gradebook_item_id, use_source_domain = nil)\r\n relative_url = Path::USERS_COURSES_GRADEBOOK_GRADEBOOKITEMS_GRADE\r\n if !use_source_domain.nil?\r\n relative_url = get_grade_url(use_source_domain)\r\n end\r\n relative_url = relative_url % [user_id, course_id, gradebook_item_id]\r\n get(relative_url)\r\n end", "def index\n @giving_groups = GivingGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @giving_groups }\n end\n end", "def index\n @dataset_researchers = Lien.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dataset_researchers }\n end\n end" ]
[ "0.6540596", "0.64612347", "0.6276824", "0.6136176", "0.6041952", "0.59894603", "0.5937578", "0.58220696", "0.58220696", "0.58220696", "0.58220696", "0.58079284", "0.57962537", "0.5779074", "0.576844", "0.5750988", "0.57370013", "0.570172", "0.5696609", "0.5673538", "0.56657434", "0.563261", "0.5620692", "0.56147623", "0.5610292", "0.56091297", "0.5597132", "0.5592646", "0.5575561", "0.5573377", "0.5565433", "0.55490565", "0.55405945", "0.55397785", "0.5536937", "0.5536226", "0.5510754", "0.55031073", "0.55025053", "0.55011934", "0.5500269", "0.5498288", "0.54930854", "0.5492589", "0.54722947", "0.5469876", "0.54644805", "0.54644805", "0.5458927", "0.5410332", "0.54053503", "0.54024017", "0.5400309", "0.5392329", "0.53885376", "0.53844345", "0.5378681", "0.53734016", "0.5369332", "0.5368128", "0.536041", "0.53588927", "0.534736", "0.5345819", "0.53450406", "0.53348476", "0.5333526", "0.53218174", "0.5317756", "0.5309606", "0.53089815", "0.53081656", "0.5306612", "0.53052604", "0.52992743", "0.52976066", "0.52883536", "0.5284126", "0.526927", "0.52608263", "0.5253536", "0.5244769", "0.5239994", "0.52392614", "0.52365077", "0.52354634", "0.52354133", "0.52329105", "0.5230556", "0.5225255", "0.52235335", "0.5221683", "0.52156144", "0.52133095", "0.52094185", "0.5200865", "0.51993877", "0.5198006", "0.5194983", "0.5194374" ]
0.63284624
2
GET /portal_grades/new GET /portal_grades/new.xml
def new # PUNDIT_REVIEW_AUTHORIZE # PUNDIT_CHECK_AUTHORIZE # authorize Portal::Grade @portal_grade = Portal::Grade.new respond_to do |format| format.html # new.html.erb format.xml { render :xml => @portal_grade } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n @staffgrade = Staffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end", "def new\n @ratgrade = Ratgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ratgrade }\n end\n end", "def create\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new(params[:portal_grade])\n\n respond_to do |format|\n if @portal_grade.save\n flash[:notice] = 'Grade was successfully created.'\n format.html { redirect_to(@portal_grade) }\n format.xml { render :xml => @portal_grade, :status => :created, :location => @portal_grade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @ms_offgrade = MsOffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ms_offgrade }\n end\n end", "def new\n @portal = Portal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal }\n end\n end", "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end", "def new\n @portal_learner = Portal::Learner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_learner }\n end\n end", "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html { render :layout => false }\n format.json { render json: @grade }\n end\n end", "def new\n @enrollment = Enrollment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @enrollment }\n end\n end", "def new\n @enrollment = Enrollment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @enrollment }\n end\n end", "def new\n @graded_component = GradedComponent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graded_component }\n end\n end", "def new\n @title = t 'view.grades.new_title'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end", "def new\n @studentgrade = Studentgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studentgrade }\n end\n end", "def new\n @student = Student.new\n @grade = { '6' => '6', '5' => '5', '4' => '4', '3' => '3', '2' => '2', '1' => '1' }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @assignment = @user.assignments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assignment }\n end\n end", "def new\n @assignment = Assignment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assignment }\n end\n end", "def new\n @best_lap = BestLap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @best_lap }\n end\n end", "def new\n @trial = Trial.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trial }\n end\n end", "def new\n @administration = Administration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administration }\n end\n end", "def new\n @student_graduatedship = StudentGraduatedship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_graduatedship }\n end\n end", "def new\n @ability_score = AbilityScore.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ability_score }\n end\n end", "def new\n @assessment = Assessment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assessment }\n end\n end", "def new\n @visit = Visit.new\n @visit.enrollments << Enrollment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visit }\n end\n end", "def new\n @upgrade = Upgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @upgrade }\n end\n end", "def new\n @degree = Degree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @degree }\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 @degree = Degree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @degree }\n end\n end", "def new\n @graduation = Graduation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graduation }\n end\n end", "def new\n @goal = Mg::Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @goal }\n end\n end", "def new\n @lablocational = Lablocational.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lablocational }\n end\n end", "def new\n @lease = Lease.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lease }\n end\n end", "def new\n authorize! :create, Course\n @course = Course.new(:grading_rule => GradingRule.new)\n @course.semester = AcademicCalendar.next_semester\n @course.year = AcademicCalendar.Date.today.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course }\n end\n end", "def new\n @badge = Badge.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @badge }\n end\n end", "def new\n @administrator = Administrator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administrator }\n end\n end", "def new\n @administrator = Administrator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @administrator }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @compliance }\n end\n end", "def new\n @plantilla = Plantilla.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plantilla }\n end\n end", "def new\n @course_degree = CourseDegree.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @course_degree }\n end\n end", "def new\n @lr70 = Lr70.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lr70 }\n end\n end", "def new\n @semester = Semester.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @semester }\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 @sellerring = Sellerring.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sellerring }\n end\n end", "def new\n @guide = Guide.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @guide }\n end\n end", "def new\n @gtfs_agency = GtfsAgency.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gtfs_agency }\n end\n end", "def create\n @title = t 'view.grades.new_title'\n\n respond_to do |format|\n if @grade.save\n format.html { redirect_to [@institution, @grade], notice: t('view.grades.correctly_created') }\n format.json { render json: @grade, status: :created, location: @grade }\n else\n format.html { render action: 'new' }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @lb202556 = Lb202556.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lb202556 }\n end\n end", "def new\n @lookup_demographichandedness = LookupDemographichandedness.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_demographichandedness }\n end\n end", "def new\n @assignmentstatus = Assignmentstatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assignmentstatus }\n end\n end", "def new_rest\n @item_usage = ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_usage }\n end\n end", "def new\n @evaluate_course = EvaluateCourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evaluate_course }\n end\n end", "def new\n @lookup_set = LookupSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_set }\n end\n end", "def new\n @lr40 = Lr40.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lr40 }\n end\n end", "def new\n @lien = Lien.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lien }\n end\n end", "def new\n @lookup_eligibilityoutcome = LookupEligibilityoutcome.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_eligibilityoutcome }\n end\n end", "def new\n\t\t@grade = Grade.new\n\t\t\n\t\trespond_to do |format|\n\t\t\t# Prevent the user from creating grades for disabled assignments\n\t\t\tif @assignment.isDisabled(@current_user)\n\t\t\t\tformat.html {redirect_to root_path, notice: \"Cannot create a grade for a disabled assignment.\"}\n\t\t\t\t\n\t\t\t# Users must be in the course to add a grade\n\t\t\telsif @current_user.courses.include?(@course)\n\t\t\t\tformat.html # new.html.erb\n\t\t\t\tformat.json { render json: @grade }\n\t\t\telse\n\t\t\t\tformat.html {redirect_to root_path, notice: \"Access Denied\"}\n\t\t\tend\n\t\tend\n\tend", "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @school }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @school }\n end\n end", "def new\n @bookfair = Bookfair.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @bookfair }\n end\n end", "def new\n @beta_signup = BetaSignup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @beta_signup }\n end\n end", "def new\n @dashboard = Dashboard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dashboard }\n end\n end", "def new\n @dashboard = Dashboard.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dashboard }\n end\n end", "def new\n @education = Education.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @education }\n end\n end", "def new\n @staffemployscheme = Staffemployscheme.new\n 5.times { @staffemployscheme.staffemploygrades.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffemployscheme }\n end\n end", "def new\n submenu_item 'agents-new'\n @agent = Agent.new(:host_id => params[:host_id])\n dictionary\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @agent }\n end\n end", "def new\n @lek = Lek.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lek }\n end\n end", "def new #:nodoc:\n @academic_level = AcademicLevel.new\n\n respond_to do |format|\n format.html # new.html.haml\n # format.xml { render :xml => @academic_level }\n end\n end", "def new\n @allcourse = Allcourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @allcourse }\n end\n end", "def new\n @student_grade_personality = StudentGradePersonality.new\n @student = Student.find(params[:student_id])\n @student_grade_field = StudentAdditionalGradeField.find(params[:field_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_grade_personality }\n end\n end", "def new\n @school = School.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @school }\n end\n end", "def new\n @service_request = ServiceRequest.new\n\t@servicegrades = ServiceGrade.all\n\t@curr_menu = \"layouts/hostfamily_menu\"\n\t@curr_layout = \"layouts/user_layout\"\n\t\t\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @service_request }\n end\n end", "def new\n @renewal = Renewal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @renewal }\n end\n end", "def new\n @agent = Agent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @agent }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def new\n @grade_scale = GradeScale.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @grade_scale }\n end\n end", "def new\n @probe = Probe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @probe }\n end\n end", "def create\n @staffgrade = Staffgrade.new(params[:staffgrade])\n\n respond_to do |format|\n if @staffgrade.save\n flash[:notice] = 'Staffgrade was successfully created.'\n format.html { redirect_to(@staffgrade) }\n format.xml { render :xml => @staffgrade, :status => :created, :location => @staffgrade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @staffgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @professional = Professional.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @professional }\n end\n end", "def new\n @lookup_scantask = LookupScantask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_scantask }\n end\n end", "def new\n @schooling = Schooling.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @schooling }\n end\n end", "def new\n @snap = Snap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @snap }\n end\n end", "def new\n @gemm = Gemm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @gemm }\n end\n end", "def new\n @assistance_list = AssistanceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @assistance_list }\n end\n end", "def new\n @research = Research.new\n @page_title = \"Request research from White House 2 members\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @research.to_xml(:except => [:email]) }\n end\n end", "def create\n @ratgrade = Ratgrade.new(params[:ratgrade])\n\n respond_to do |format|\n if @ratgrade.save\n format.html { redirect_to(@ratgrade, :notice => 'Ratgrade was successfully created.') }\n format.xml { render :xml => @ratgrade, :status => :created, :location => @ratgrade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ratgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @lookup_rad = LookupRad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_rad }\n end\n end", "def new\n @staffcourse = Staffcourse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffcourse }\n end\n end", "def new\n @lesson = Lesson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lesson }\n end\n end", "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @licence }\n end\n end", "def new\n @addition = Addition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @addition }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @student = Student.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def new\n @lookup_eligibility_ineligibility = LookupEligibilityIneligibility.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lookup_eligibility_ineligibility }\n end\n end", "def new\n @report = Mg::Report.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @report }\n end\n end", "def new\n @graduate_school_ranking = GraduateSchoolRanking.new\n\t@college_lists = CollegeList.find_by_sql(\"select name_en, id from college_lists order by name_en\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graduate_school_ranking }\n end\n end", "def new\n @experience = Experience.new(:goal_id => params[:goal_id])\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @experience }\n end\n end", "def new\n @college = College.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @college }\n end\n end", "def new\n @student_profile = StudentProfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_profile }\n end\n end", "def new\n @score = Score.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @score }\n end\n end", "def new\n @score = Score.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @score }\n end\n end" ]
[ "0.73631287", "0.72598237", "0.7080281", "0.69860333", "0.6914125", "0.68992996", "0.6819383", "0.6804884", "0.6765627", "0.6765627", "0.6713686", "0.6680785", "0.6654715", "0.6653923", "0.6646789", "0.6636223", "0.66305894", "0.6623268", "0.6617407", "0.6612715", "0.65941685", "0.6585681", "0.65846163", "0.6581264", "0.65691143", "0.6567253", "0.6566643", "0.65620226", "0.65591425", "0.65527934", "0.6549699", "0.6545703", "0.654417", "0.6543186", "0.6543186", "0.6532646", "0.65290684", "0.65147895", "0.6513466", "0.6499643", "0.6488319", "0.6484887", "0.64822185", "0.64810586", "0.6479598", "0.6479215", "0.6479192", "0.64730686", "0.6471566", "0.64548653", "0.64455897", "0.6443967", "0.6442143", "0.6437168", "0.6435903", "0.64324075", "0.6427663", "0.6425587", "0.6419402", "0.64187264", "0.64187264", "0.641677", "0.6414203", "0.6413823", "0.6409746", "0.64085805", "0.6405753", "0.64036715", "0.64030993", "0.63965297", "0.6393755", "0.6392063", "0.6391684", "0.63914496", "0.63897926", "0.63827395", "0.63823795", "0.63767916", "0.63737124", "0.6373384", "0.6371283", "0.6371257", "0.63701034", "0.6368921", "0.6366136", "0.6360459", "0.6359377", "0.6359102", "0.6356807", "0.6356807", "0.6356807", "0.6356807", "0.6354583", "0.6353185", "0.63525623", "0.63509184", "0.635056", "0.6344885", "0.63441044", "0.63441044" ]
0.7378837
0
POST /portal_grades POST /portal_grades.xml
def create # PUNDIT_REVIEW_AUTHORIZE # PUNDIT_CHECK_AUTHORIZE # authorize Portal::Grade @portal_grade = Portal::Grade.new(params[:portal_grade]) respond_to do |format| if @portal_grade.save flash[:notice] = 'Grade was successfully created.' format.html { redirect_to(@portal_grade) } format.xml { render :xml => @portal_grade, :status => :created, :location => @portal_grade } else format.html { render :action => "new" } format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @grade = Grade.new(params[:grade])\n respond_to do |format|\n if @grade.save\n @grade.upload_to_scribd!\n format.html { redirect_to \"/assignments/#{@grade.assignment_id}\" }\n format.json { render json: @grade, status: :created, location: @grade }\n else\n puts \"Errors: #{@grade.errors.inspect}\"\n format.html { redirect_to \"/404.html\" }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @staffgrade = Staffgrade.new(params[:staffgrade])\n\n respond_to do |format|\n if @staffgrade.save\n flash[:notice] = 'Staffgrade was successfully created.'\n format.html { redirect_to(@staffgrade) }\n format.xml { render :xml => @staffgrade, :status => :created, :location => @staffgrade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @staffgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_grade }\n end\n end", "def get_grades\r\n grade_nodes = BankNodestructure.grade_gather(params[:subject])\r\n render json: grade_nodes.to_json\r\n end", "def create\n @ratgrade = Ratgrade.new(params[:ratgrade])\n\n respond_to do |format|\n if @ratgrade.save\n format.html { redirect_to(@ratgrade, :notice => 'Ratgrade was successfully created.') }\n format.xml { render :xml => @ratgrade, :status => :created, :location => @ratgrade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ratgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @grade = Grade.new(grade_params)\n\n if @grade.save\n render json: @grade, status: :created, location: @grade\n else\n render json: @grade.errors, status: :unprocessable_entity\n end\n end", "def create\n params.permit!\n @ms_offgrade = MsOffgrade.new(params[:ms_offgrade])\n\n respond_to do |format|\n if @ms_offgrade.save\n format.html { redirect_to(@ms_offgrade, :notice => 'Ms offgrade was successfully created.') }\n format.xml { render :xml => @ms_offgrade, :status => :created, :location => @ms_offgrade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @ms_offgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n if @submission.graded?\n flash[:error] = \"Submission has already been graded by \" + @submission.gradings.last.grader.name\n redirect_to course_assessment_submission_grading_path(@course, @assessment, @submission, @submission.gradings.last)\n return\n end\n\n invalid_assign = false\n @grading.grade = 0\n\n params[:ags].each do |ag|\n @ag = @grading.answer_gradings.build(ag)\n @ag.grader = current_user\n @ag.grader_course = curr_user_course\n unless validate_gradings(@ag, ag)\n invalid_assign = true\n break\n end\n\n @grading.grade += @ag.grade\n end\n\n if @grading.grade > @assessment.max_grade || @grading.exp > @assessment.exp\n invalid_assign = true\n end\n\n @grading.grader = current_user\n @grading.grader_course = curr_user_course\n @grading.student = @submission.std_course\n\n if invalid_assign\n grade_error_response\n elsif @grading.save\n @submission.set_graded\n\n respond_to do |format|\n format.html { redirect_to course_assessment_submission_path(@course, @assessment, @submission),\n notice: \"Grading has been recorded.\" }\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n end\n end\n end", "def create\n @grade = Grade.new(grade_params)\n\n respond_to do |format|\n if @grade.save\n format.html { redirect_to @grade, notice: 'Grade was successfully created.' }\n format.json { render :show, status: :created, location: @grade }\n else\n format.html { render :new }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @title = t 'view.grades.new_title'\n\n respond_to do |format|\n if @grade.save\n format.html { redirect_to [@institution, @grade], notice: t('view.grades.correctly_created') }\n format.json { render json: @grade, status: :created, location: @grade }\n else\n format.html { render action: 'new' }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grade = Grade.new(grade_params)\n\n respond_to do |format|\n if @grade.save\n format.html { redirect_to [\"cal\",@grade], notice: 'Grade was successfully created.' }\n format.json { render :show, status: :created, location: @grade }\n else\n format.html { render :new }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @final_grade = FinalGrade.new(final_grade_params)\n\n respond_to do |format|\n if @final_grade.save\n format.html { redirect_to @final_grade, notice: 'Final grade was successfully created.' }\n format.json { render :show, status: :created, location: @final_grade }\n else\n format.html { render :new }\n format.json { render json: @final_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student = Student.find(params[:student_id])\n @grade = @student.grades.new(grade_params)\n respond_to do |format|\n if @grade.save\n format.html { redirect_to student_grades_path, notice: 'Grade was successfully created.' }\n format.json { render :show, status: :created, location: @grade }\n else\n format.html { render :new }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @average_grade = AverageGrade.new(average_grade_params)\n\n respond_to do |format|\n if @average_grade.save\n format.html { redirect_to @average_grade, notice: 'Average grade was successfully created.' }\n format.json { render :show, status: :created, location: @average_grade }\n else\n format.html { render :new }\n format.json { render json: @average_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @member_grade = MemberGrade.new(member_grade_params)\n\n respond_to do |format|\n if @member_grade.save\n format.html { redirect_to @member_grade, notice: 'Member grade was successfully created.' }\n format.json { render :show, status: :created, location: @member_grade }\n else\n format.html { render :new }\n format.json { render json: @member_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @course = Course.find(params[:course_id])\n @grade = @course.grades.create(grade_params)\n if @course.save\n redirect_to @course,\n notice: ' Grade was added successfully.'\n else\n redirect_to @course,\n alert: 'Error creating grade.'\n end\n end", "def create\t\n\t\t@user_ids = Array.new \n\t\t@gnumber = params[:grade][:number].to_i\n\t\t@ggrade = params[:grade][:grade]\n \n\t\tif @gnumber < 51\tand @gnumber > 0\n\t\t\t@gnumber.times do |number|\n\t\t\t\tnumber+=1\n\t\t\t\tnumber= \"%.2i\" %number\n\t\t\t\t@password= SecureRandom.hex(8)\n\t\t\t\t@user_params = { \"name\" => \"#{@ggrade}_#{number}_2014\", \"first_name\" => \"-\", \"second_name\" => \"-\", \"last_name\" => \"-\", \"grade\" => \"#{@ggrade}\", \"number\" => \"#{number}\", \"password\" => \"#{@password}\" }\n\t\t\t\t@user = User.new(@user_params)\n\t\t\t\t@user.save\t\n\t\t\n\t\t\t\t@user_ids << @user.id \n\t\t\tend\n\t\tend\n\t\t@grade_params = { \"grade\" => \"#{@ggrade}\", \"number\" => \"#{@gnumber}\", \"user_ids\" => \"#{@user_ids}\"}\n\t\t@grade = Grade.new(@grade_params)\n\t\trespond_to do |format|\n if @grade.save\n format.html { redirect_to @grade, notice: \"#{@grade.grade} was successfully created.\" }\n format.json { render action: 'show', status: :created, location: @grade }\n else\n format.html { render action: 'new' }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\t\t\t\n\t\t\t\n end", "def create\n @student_goal_evaluation = StudentGoalEvaluation.new(student_goal_evaluation_params)\n\n respond_to do |format|\n if @student_goal_evaluation.save\n format.html { redirect_to root_path, notice: 'Evalueringen er gemt.' }\n format.json { render :show, status: :created, location: @student_goal_evaluation }\n else\n format.html { render :new }\n format.json { render json: @student_goal_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "def post\n frm.button(:name=>\"post\").click\n AssignmentsList.new(@browser)\n end", "def index\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n # PUNDIT_REVIEW_SCOPE\n # PUNDIT_CHECK_SCOPE (did not find instance)\n # @grades = policy_scope(Portal::Grade)\n @portal_grades = Portal::Grade.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @portal_grades }\n end\n end", "def new\n @staffgrade = Staffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffgrade }\n end\n end", "def create\n @student_grade_personality = StudentGradePersonality.new(params[:student_grade_personality])\n\n respond_to do |format|\n if @student_grade_personality.save\n flash[:notice] = 'StudentGradePersonality was successfully created.'\n format.html { redirect_to :action => \"by_student\", :id => @student_grade_personality.student.id }\n format.xml { render :xml => @student_grade_personality, :status => :created, :location => @student_grade_personality }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student_grade_personality.errors, :status => :unprocessable_entity }\n end\n end\n end", "def mod\n # get the grade params\n grade_params = Hash.new\n params.each{ |key, value|\n begin\n key = key.to_i\n if key.kind_of?(Fixnum) && key != 0\n grade_params[key] = value\n end\n rescue Error\n # ignore\n end\n }\n grade_params.each{ |key,value|\n as = AssignmentsStudents.find(key.to_i)\n as.grade = value\n as.save\n } \n redirect_to :action => 'index', :controller => 'assignments_students'\n end", "def create_grade(user_id, course_id, gradebook_item_id, grade)\r\n relative_url = Path::USERS_COURSES_GRADEBOOK_GRADEBOOKITEMS_GRADE % [user_id, course_id, gradebook_item_id]\r\n post(relative_url, grade)\r\n end", "def create\n @studentgrade = Studentgrade.new(params[:student])\n\n respond_to do |format|\n if @studentgrade.save\n format.html { redirect_to @studentgrade, notice: 'Student was successfully created.' }\n format.json { render json: @studentgrade, status: :created, location: @studentgrade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @studentgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def post\n frm.button(:value=>\"Post\").click\n AssignmentsList.new(@browser)\n end", "def create\n @grantee = Grantee.new(grantee_params)\n\n respond_to do |format|\n if @grantee.save\n format.html { redirect_to @grantee, notice: 'Grantee was successfully created.' }\n format.json { render :show, status: :created, location: @grantee }\n else\n format.html { render :new }\n format.json { render json: @grantee.errors, status: :unprocessable_entity }\n end\n end\n end", "def POST; end", "def grade_params\n params.require(:grade).permit(:number, :grade)\n end", "def create_assignment(name)\n @url = \"http://#{$canvas_host}/api/v1/courses/#{$canvas_course_id}/assignments\"\n puts \"@url is #{@url}\"\n\n @payload={'assignment': { \n 'name': name,\n 'points_possible': '0',\n 'grading_type': 'pass_fail',\n 'published': 'true',\n 'submission_types': [ \"none\" ]\n }\n }\n\n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to create assignment has Response.code #{@postResponse.code} and postResponse is #{@postRepsone}\")\nend", "def create\n\t\t@grade = Grade.new(params[:grade])\n\t\t@grade.assignment_id = params[:assignment_id]\n\t\t@grade.user_id = @current_user.id\n\t\t\n\t\tLogsController.createGrade(@current_user, @grade)\n\n\t\trespond_to do |format|\n\t\t\t# For fast grades (:commit == \"Save\") redirect to the course page\n\t\t\tif params[:commit] == \"Save\" && @grade.save\n\t\t\t\tformat.html { redirect_to course_path(@assignment.course), notice: 'Grade was successfully created.' }\n\t\t\telsif @grade.save\n\t\t\t\tformat.html { redirect_to assignment_path(@assignment), notice: 'Grade was successfully created.' }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\tend\n\t\tend\n\tend", "def new\n @staffemployscheme = Staffemployscheme.new\n 5.times { @staffemployscheme.staffemploygrades.build }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @staffemployscheme }\n end\n end", "def create\n @criterion_grade = CriterionGrade.new(criterion_grade_params)\n\n respond_to do |format|\n if @criterion_grade.save\n format.html { redirect_to @criterion_grade, notice: 'Criterion grade was successfully created.' }\n format.json { render action: 'show', status: :created, location: @criterion_grade }\n else\n format.html { render action: 'new' }\n format.json { render json: @criterion_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @student_graduatedship = StudentGraduatedship.new(params[:student_graduatedship])\n\n respond_to do |format|\n if @student_graduatedship.save\n format.html { redirect_to(@student_graduatedship, :notice => 'Student graduatedship was successfully created.') }\n format.xml { render :xml => @student_graduatedship, :status => :created, :location => @student_graduatedship }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @student_graduatedship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @enrollment = Enrollment.new(params[:enrollment])\n\n respond_to do |format|\n if @enrollment.save\n flash[:notice] = 'Enrollment was successfully created.'\n format.html { redirect_to(department_lecture_path(@enrollment.lecture.department, @enrollment.lecture)) }\n format.xml { render :xml => @enrollment, :status => :created, :location => @enrollment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @enrollment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def grade_params\n params.require(:grade).permit(:activity_id, :section_id, :student_id, :teacher_id, :score)\n end", "def create\n @problem = Problem.new(problem_params)\n #FileUtils::mkdir_p \"grades/#{@problem.id}\"\n \n # puts \"grades/#{Problem.last.id.to_s}\\n\\n\"\n\n respond_to do |format|\n if @problem.save\n populate(@problem.id.to_s)\n format.html { redirect_to @problem, notice: 'Problem was successfully created.' }\n format.json { render :show, status: :created, location: @problem }\n else\n format.html { render :new }\n format.json { render json: @problem.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @grade = Grade.new(grade_params)\n if @grade.save\n flash[:success] = \"Grade was successfully created\"\n redirect_to grades_path\n else\n flash[:errors] = @grade.errors.full_messages.join(' ')\n redirect_to grades_path\n end\n end", "def grade_params\n params.require(:grade).permit(:name, :score, :total, :weight)\n end", "def create\n @grade_calc = GradeCalc.new(grade_calc_params)\n\n respond_to do |format|\n if @grade_calc.save\n format.html { redirect_to @grade_calc, notice: 'Grade calc was successfully created.' }\n format.json { render action: 'show', status: :created, location: @grade_calc }\n else\n format.html { render action: 'new' }\n format.json { render json: @grade_calc.errors, status: :unprocessable_entity }\n end\n end\n end", "def enrollment(params = {})\n scope 'default'\n post('enrollment/', params)\n end", "def create\n @degree = Degree.new(params[:degree])\n @users = User.find :all\n @educational_institutions = EducationalInstitution.find :all\n @educational_qualifications = EducationalQualification.find :all\n @education_concentrations = EducationConcentration.find :all\n @educational_levels = EducationalLevel.find :all\n respond_to do |format|\n if @degree.save\n flash[:notice] = 'Degree was successfully created.'\n format.html { redirect_to(@degree) }\n format.xml { render :xml => @degree, :status => :created, :location => @degree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @grade\n @portal_grade = Portal::Grade.find(params[:id])\n\n respond_to do |format|\n if @portal_grade.update_attributes(params[:portal_grade])\n flash[:notice] = 'Grade was successfully updated.'\n format.html { redirect_to(@portal_grade) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @catgrade = Catgrade.new(catgrade_params)\n\n respond_to do |format|\n if @catgrade.save\n format.html { redirect_to @catgrade, notice: 'Catgrade was successfully created.' }\n format.json { render action: 'show', status: :created, location: @catgrade }\n else\n format.html { render action: 'new' }\n format.json { render json: @catgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @challenge_grade = ChallengeGrade.new(params[:challenge_grade])\n\n respond_to do |format|\n if @challenge_grade.save\n format.html { redirect_to @challenge_grade, notice: 'Challenge score was successfully created.' }\n format.json { render json: @challenge_grade, status: :created, location: @challenge_grade }\n else\n format.html { render action: \"new\" }\n format.json { render json: @challenge_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @required_degree = RequiredDegree.new(params[:required_degree])\n @job_postings = JobPosting.find :all\n @education_concentrations = EducationConcentration.find :all\n @educational_levels = EducationalLevel.find :all\n respond_to do |format|\n if @required_degree.save\n flash[:notice] = 'RequiredDegree was successfully created.'\n format.html { redirect_to(@required_degree) }\n format.xml { render :xml => @required_degree, :status => :created, :location => @required_degree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @required_degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @grade_scale = GradeScale.new(params[:grade_scale])\n\n respond_to do |format|\n if @grade_scale.save\n format.json { render :json => @grade_scale, :status => :created, :location => @grade_scale }\n else\n format.json { render :json => @grade_scale.errors, :status => :unprocessable_entity }\n end\n end\n end", "def grade_params\n params.require(:grade).permit(:user_id, :grade, :course_id, :lesson_id, :lesson_module_id)\n end", "def new\n @ratgrade = Ratgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ratgrade }\n end\n end", "def grade_params\n params.require(:grade).permit(:score, :verify)\n end", "def grade_params\n params.require(:grade).permit(:assignment_name, :grade, :student_id, :teacher_id)\n end", "def new\n @student = Student.new\n @grade = { '6' => '6', '5' => '5', '4' => '4', '3' => '3', '2' => '2', '1' => '1' }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student }\n end\n end", "def grades\n @grade_entry_form = GradeEntryForm.find(params[:id])\n end", "def grade_params\n params.require(:grade).permit(:student_id, :assignment_id, :score)\n end", "def grade_params\n params.require(:grade).permit(:student_id, :course_id, :value)\n end", "def grade_params\n params.require(:grade).permit(:student_has_subject_id, :aplicar_parcial, :grade_type, :calificacion)\n end", "def grade(auto_grading)\n auto_grading.answer.publish!\n auto_grading.answer.grader = User.system\n auto_grading.save\n end", "def grade(assignment_name)\n assignment_row(assignment_name).link(:text=>\"Grade\").click\n AssignmentSubmissionList.new(@browser)\n end", "def create\n @graded_component = GradedComponent.new(params[:graded_component])\n\n respond_to do |format|\n if @graded_component.save\n flash[:notice] = 'GradedComponent was successfully created.'\n format.html { redirect_to(@graded_component) }\n format.xml { render :xml => @graded_component, :status => :created, :location => @graded_component }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @graded_component.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @degree = Degree.new(params[:degree])\n\n respond_to do |format|\n if @degree.save\n format.html { redirect_to(@degree, :notice => 'Degree was successfully created.') }\n format.xml { render :xml => @degree, :status => :created, :location => @degree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @graduation = Graduation.new(params[:graduation])\n\n respond_to do |format|\n if @graduation.save\n format.html { redirect_to(@graduation, :notice => 'Graduation was successfully created.') }\n format.xml { render :xml => @graduation, :status => :created, :location => @graduation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @graduation.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @grass_allocation = GrassAllocation.new(grass_allocation_params)\n\n respond_to do |format|\n if @grass_allocation.save\n format.html { redirect_to @grass_allocation, notice: 'Grass allocation was successfully created.' }\n format.json { render :show, status: :created, location: @grass_allocation }\n else\n format.html { render :new }\n format.json { render json: @grass_allocation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @enrollments = Enrollment.new(enrollment_params)\n\n respond_to do |format|\n if @enrollments.save\n format.html { redirect_to current_user }\n format.json { render :show, status: :created, location: @enrollments }\n else\n format.html { render :new }\n format.json { render json: @enrollments.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def validator_captive_portal(args = {}) \n post(\"/profiles.json/captiveportal/\", args)\nend", "def eligibility(params = {})\n scope 'default'\n post('eligibility/', params)\n end", "def create\n @portal_learner = Portal::Learner.new(params[:learner])\n\n respond_to do |format|\n if @portal_learner.save\n flash[:notice] = 'Portal::Learner was successfully created.'\n format.html { redirect_to(@portal_learner) }\n format.xml { render :xml => @portal_learner, :status => :created, :location => @portal_learner }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @portal_learner.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\n @student_graduatedship = StudentGraduatedship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_graduatedship }\n end\n end", "def create\n course = Course.find(params[:course_id])\n student = Student.find_by(dni: params[:student_id])\n @enroll = Enroll.new( student: student, course: course)\n TestCourse.of(course).each do |tc|\n Score.create( student: student, test_id: tc.test_id, value: -2)\n end\n \n respond_to do |format|\n if @enroll.save\n format.html { redirect_to course_enrolls_path(course), notice: 'Enroll was successfully created.' }\n format.json { render :show, status: :created, location: course_enrolls_path(course) }\n else\n format.html { render :new }\n format.json { render json: @enroll.errors, status: :unprocessable_entity }\n end\n end\n end", "def submit_for_grading\n frm.button(:value=>\"Submit for Grading\").click\n SubmissionSummary.new(@browser)\n end", "def post\n # Make sure cid belongs to user\n if check_id(params[:cid])\n flash[:danger] = \"Try not to post in places that doesn't belong to you\"\n return redirect_to '/'\n end\n\n @grade = Grade.new(:courseItem => params[:courseItem],\n :worth => params[:worth],\n :mark => params[:mark],\n :courseMark => \"%.2f\" % (params[:worth].to_f*(params[:mark].to_f/100)),\n :subject_id => params[:cid])\n\n #Data Validation - Blank values\n if !@grade.valid?\n flash[:danger] = \"Please Input Valid Values\"\n return redirect_to '/'\n elsif @grade.save\n update_subject_grade(Grade.where(subject_id: params[:cid]), params[:cid])\n return redirect_to action: \"show\",\n id:params[:cid]\n else\n flash[:warning] = \"A Random Bug Occured, Please Try Again\"\n return redirect_to '/'\n end\n end", "def grades\n @learn_grades\n end", "def grade_params\n params.require(:pay_grade).permit(:level, :active)\n end", "def new\n @ms_offgrade = MsOffgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ms_offgrade }\n end\n end", "def create\n @degree = Degree.new(params[:degree])\n\n respond_to do |format|\n if @degree.save\n format.html { redirect_to(@degree, :notice => 'La titulacion se ha creado correctamente.') }\n format.xml { render :xml => @degree, :status => :created, :location => @degree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @group_adj = GroupAdj.new(group_adj_params)\n\n respond_to do |format|\n if @group_adj.save\n format.html { redirect_to @group_adj, notice: 'Group adj was successfully created.' }\n format.json { render :show, status: :created, location: @group_adj }\n else\n format.html { render :new }\n format.json { render json: @group_adj.errors, status: :unprocessable_entity }\n end\n end\n end", "def grade!\n uri = URI.parse problem.endpoint.url\n response = Net::HTTP.post_form uri, task: problem.task_name, code: code\n verdict = Verdict.from_endpoint_response response, self\n verdict.save!\n end", "def create\n @gradework = Gradework.new(gradework_params)\n\n if params.has_key?(:students) and params[:students] != [\"\"]\n students = params[:students]\n @gradework.users << User.find(students)\n end\n\n if params.has_key?(:juries) and params[:juries] != [\"\"]\n juries = params[:juries]\n @gradework.users << User.find(juries)\n end\n\n if params.has_key?(:directors) and params[:directors] =! \"\"\n directors = params[:directors]\n @gradework.users << User.find(directors)\n end\n\n respond_to do |format|\n if @gradework.save!\n format.html { redirect_to @gradework, notice: 'La tesis se creó correctamente' }\n format.json { render :show, status: :created, location: @gradework }\n else\n format.html { redirect_to @gradework, notice: 'La tesis no se pudo crear correctamente' }\n format.json { render json: @gradework.errors, status: :unprocessable_entity }\n end\n end\n end", "def grade_params\n params.require(:grade).permit(:cat1, :cat2, :cat3, :exam_id, :score, :grade, :subject_id)\n end", "def new\n @visit = Visit.new\n @visit.enrollments << Enrollment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @visit }\n end\n end", "def new\n\n if @submission.submission_gradings.count > 0\n redirect_to edit_course_mission_submission_submission_grading_path(@course, @mission,@submission, @submission.submission_gradings.first)\n return\n end\n\n @qadata = {}\n\n @mission.get_all_questions.each_with_index do |q,i|\n @qadata[q.id.to_s+q.class.to_s] = { q: q, i: i + 1 }\n end\n\n eval_answer\n @submission.get_all_answers.each do |sa|\n qn = sa.qn\n @qadata[qn.id.to_s + qn.class.to_s][:a] = sa\n #suggest grading for auto grading question\n\n if sa.class == StdCodingAnswer and qn.is_auto_grading?\n results = sa.result_hash[\"evalTests\"]\n evals = results ? results.select {|r| r}.length : 0\n tests = qn.data_hash[\"evalTests\"].length\n tests = tests == 0 ? 1 : tests\n grade = (qn.max_grade * evals / tests).to_i\n ag = AnswerGrading.new\n ag.grade = grade\n @qadata[qn.id.to_s + qn.class.to_s][:g] = ag\n end\n end\n\n @do_grading = true\n end", "def create\n @assignment_upgrade = AssignmentUpgrade.new(assignment_upgrade_params)\n\n respond_to do |format|\n if @assignment_upgrade.save\n format.html { redirect_to @assignment_upgrade, notice: 'Assignment upgrade was successfully created.' }\n format.json { render :show, status: :created, location: @assignment_upgrade }\n else\n format.html { render :new }\n format.json { render json: @assignment_upgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @professional_upgrade = ProfessionalUpgrade.new(professional_upgrade_params)\n\n respond_to do |format|\n if @professional_upgrade.save\n format.html { redirect_to @professional_upgrade, notice: 'Professional upgrade was successfully created.' }\n format.json { render :show, status: :created, location: @professional_upgrade }\n else\n format.html { render :new }\n format.json { render json: @professional_upgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def pay_grade_params\r\n params.require(:pay_grade).permit(:level, :active)\r\n end", "def destroy\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE (did not find instance)\n # authorize @grade\n @portal_grade = Portal::Grade.find(params[:id])\n @portal_grade.destroy\n\n respond_to do |format|\n format.html { redirect_to(portal_grades_url) }\n format.xml { head :ok }\n end\n end", "def new\n @grade = Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grade }\n end\n end", "def create\n @evaluation = Evaluation.new(evaluation_params)\n @evaluation.group_id = params[:group_id]\n @evaluation.student_id = current_student.id\n respond_to do |format|\n if @evaluation.save\n format.html { redirect_to student_dashboard_path, notice: 'Evaluation was successfully created.' }\n format.json { render :show, status: :created, location: student_dashboard_path }\n else\n format.html { render :new }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @assignment = @user.assignments.new(params[:assignment])\n\n respond_to do |format|\n if @assignment.save\n flash[:notice] = 'Committee assignment was successfully created'\n format.html { redirect_to user_assignments_path(@user) }\n format.xml { render :xml => @assignment, :status => :created, :location => @assignment }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @assignment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @nsgrule = Nsgrule.new(nsgrule_params)\n\n respond_to do |format|\n if @nsgrule.save\n format.html { redirect_to @nsgrule, notice: 'Nsgrule was successfully created.' }\n format.json { render :show, status: :created, location: @nsgrule }\n else\n format.html { render :new }\n format.json { render json: @nsgrule.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n newEssay = params[:essay]\n newEssay[:assignment_id] = params[:assignment_id]\n @essay = Essay.new(newEssay)\n \n respond_to do |format|\n if @essay.save\n format.html { redirect_to assignment_essay_url(@essay.assignment_id, @essay.id), notice: 'Essay was successfully created.' }\n format.json { render json: @essay, status: :created, location: @essay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @grade = Grade.find(params[:id])\n if @grade.update_attributes(params[:grade])\n respond_to do |format|\n format.html { redirect_to \"/assignments/#{@grade.assignment_id}/show\" } unless @grade.graded\n format.json { head :ok }\n end\n end\n end", "def create\n @portal = Portal.new(params[:portal])\n\n respond_to do |format|\n if @portal.save\n flash[:notice] = 'Portal was successfully created.'\n format.html { redirect_to(@portal) }\n format.xml { render :xml => @portal, :status => :created, :location => @portal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @portal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend", "def create\n @grades_tournament = GradesTournament.new(grades_tournament_params)\n\n respond_to do |format|\n if @grades_tournament.save\n format.html { redirect_to @grades_tournament, notice: 'Grades tournament was successfully created.' }\n format.json { render :show, status: :created, location: @grades_tournament }\n else\n format.html { render :new }\n format.json { render json: @grades_tournament.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @studentgrade = Studentgrade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @studentgrade }\n end\n end", "def create\n @enrollment = Enrollment.new(params[:enrollment])\n\n respond_to do |format|\n if @enrollment.save\n @log_entry = LogEntry.last\n format.html { redirect_to admin_scheduled_course_url(@enrollment.scheduled_course), :notice => 'A student was successfully enrolled.' }\n #format.xml { render :xml => @enrollment, :status => :created, :location => @enrollment }\n else\n #format.html { render :action => \"new\" }\n #format.xml { render :xml => @enrollment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_new_grading_standard_accounts(account_id,title,grading_scheme_entry__name__,grading_scheme_entry__value__,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n :title,\n :grading_scheme_entry__name__,\n :grading_scheme_entry__value__,\n \n ]\n\n # verify existence of params\n raise \"account_id is required\" if account_id.nil?\n raise \"title is required\" if title.nil?\n raise \"grading_scheme_entry__name__ is required\" if grading_scheme_entry__name__.nil?\n raise \"grading_scheme_entry__value__ is required\" if grading_scheme_entry__value__.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :account_id => account_id,\n :title => title,\n :grading_scheme_entry__name__ => grading_scheme_entry__name__,\n :grading_scheme_entry__value__ => grading_scheme_entry__value__\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{account_id}/grading_standards\",\n :account_id => account_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:post, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:post, path, query_params, form_params, headers)\n page_params_store(:post, path)\n GradingStandard.new(response)\n end", "def final_grade_params\n params.require(:final_grade).permit(:matriculation_id, :value, :state)\n end", "def grades_for_params\n params.require(:grades_for).permit(:section, :user_id)\n end", "def create\n @course_degree = CourseDegree.new(params[:course_degree])\n\n respond_to do |format|\n if @course_degree.save\n format.html { redirect_to(@course_degree, :notice => 'Course degree was successfully created.') }\n format.xml { render :xml => @course_degree, :status => :created, :location => @course_degree }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @course_degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def audit_grade_for_student\n\n # Update these to the proper values that you are interesting in\n student_id = 1272\n module_item_id = 3772\n course_id = 27\n module_name = 'Network Like a Pro'\n\n tag = ContentTag.where(:id => module_item_id, :context_id => course_id, :context_type => 'Course', :content_type => 'WikiPage').first\n page = WikiPage.find(tag.content_id)\n course = Course.find(course_id)\n get_the_page_id = page.id\n participation_assignment = course.assignments.active.where(:title => \"Course Participation - #{module_name}\").first\n user = User.find(student_id)\n puts \"### Auditing participation and mastery score for: username = #{user.name}, userid = #{user.id}, https://portal.bebraven.org/courses/#{course_id}/pages/#{page.url}?module_item_id=#{module_item_id}\"\n \n se = course.student_enrollments.active.where(:user_id => student_id).first\n uid = se.user_id\n submission = participation_assignment.submissions.where(user_id: user.id).first\n names = {}\n missing_names = {}\n wrong_answer_names = {}\n count = 0\n filled_and_correct_count = 0\n selector = 'input[data-bz-retained]:not(.bz-optional-magic-field),textarea[data-bz-retained]:not(.bz-optional-magic-field)'\n page_html = page.body\n doc = Nokogiri::HTML(page_html)\n doc.css(selector).each do |o|\n n = o.attr('data-bz-retained')\n next if names[n]\n mastery_answer = o.attr('data-bz-answer')\n next if o.attr('type') == 'checkbox' && mastery_answer.nil?\n names[n] = true\n count += 1\n found = RetainedData.where(:user_id => uid, :name => n)\n if found.any?\n if !mastery_answer.nil? # The field must have the correct answer to count\n if !mastery_answer.blank? && mastery_answer == found.first.value\n filled_and_correct_count += 1\n puts \"### for #{n}, mastery answer = #{mastery_answer} is correct. Adding 1 step.\" \n elsif mastery_answer.blank? && (found.first.nil? || found.first.value.blank?)\n filled_and_correct_count += 1 # If the checkbox isn't supposed to be checked, make sure it's not\n puts \"### for #{n}, mastery answer = #{mastery_answer} is correct. Adding 1 step.\" \n else\n wrong_answer_names[n] = true\n puts \"### for #{n}, mastery answer = #{mastery_answer} is incorrect. Subtracting 1 step.\" \n end\n else # Just a participation field, count it.\n filled_and_correct_count += 1\n puts \"### for #{n}, participation credit. Adding 1 step.\" \n end\n else\n if mastery_answer.nil?\n missing_names[n] = true\n puts \"### for #{n}, no partcipation. Subtracting 1 step.\" \n else\n if mastery_answer.blank?\n filled_and_correct_count += 1 # If we don't find the name but the answer is blank, that's correct.\n puts \"### for #{n}, mastery answer = #{mastery_answer} is correct. Adding 1 step.\" \n else\n wrong_answer_names[n] = true\n puts \"### for #{n}, mastery answer = #{mastery_answer} is incorrect. Subtracting 1 step.\" \n end\n end\n end\n end\n puts \"### Missing names for this submission: #{missing_names.inspect}\"\n puts \"### Incorrect master answer names for this submission: #{wrong_answer_names.inspect}\"\n step = participation_assignment.points_possible.to_f / count.to_f\n correct_grade = (filled_and_correct_count.to_f / count.to_f) * participation_assignment.points_possible.to_f\n existing_grade = submission.score\n puts \"### AUDIT: step = #{step}, correct_grade = #{correct_grade}, existing_grade = #{existing_grade}\"\n \nend" ]
[ "0.5947724", "0.5840544", "0.5790898", "0.5761745", "0.57548195", "0.57503563", "0.5746813", "0.571952", "0.568838", "0.56789315", "0.5657114", "0.5634986", "0.5504122", "0.5463288", "0.54486215", "0.5370755", "0.5369821", "0.5328143", "0.53201514", "0.530921", "0.53070384", "0.5293251", "0.52838767", "0.52757406", "0.527307", "0.52662206", "0.5215454", "0.52105445", "0.519598", "0.5194935", "0.51700187", "0.51694995", "0.5166706", "0.5164455", "0.5158449", "0.5155149", "0.5155096", "0.51467997", "0.51351506", "0.5133424", "0.51264095", "0.51202404", "0.5116585", "0.5109745", "0.5098013", "0.5089754", "0.5085393", "0.5082288", "0.50747925", "0.50745076", "0.50721675", "0.5069978", "0.506711", "0.5053533", "0.5048778", "0.50468624", "0.5041655", "0.5030833", "0.5029472", "0.5005177", "0.50005305", "0.49997172", "0.49963826", "0.49921638", "0.49844033", "0.49825615", "0.49808484", "0.49718353", "0.4963403", "0.49624085", "0.4936648", "0.49363735", "0.49307457", "0.49247515", "0.49198267", "0.4912776", "0.49098614", "0.49024233", "0.49017024", "0.4900753", "0.48940498", "0.48937005", "0.48866022", "0.48769203", "0.48718837", "0.487168", "0.48692113", "0.4867648", "0.48641124", "0.48617935", "0.4861255", "0.4859098", "0.48588592", "0.48558304", "0.4855388", "0.48546395", "0.4852309", "0.4848833", "0.48438668", "0.48437706" ]
0.6705665
0
PUT /portal_grades/1 PUT /portal_grades/1.xml
def update # PUNDIT_REVIEW_AUTHORIZE # PUNDIT_CHECK_AUTHORIZE (did not find instance) # authorize @grade @portal_grade = Portal::Grade.find(params[:id]) respond_to do |format| if @portal_grade.update_attributes(params[:portal_grade]) flash[:notice] = 'Grade was successfully updated.' format.html { redirect_to(@portal_grade) } format.xml { head :ok } else format.html { render :action => "edit" } format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @grade = Grade.find(params[:id])\n\n if @grade.update(grade_params)\n head :no_content\n else\n render json: @grade.errors, status: :unprocessable_entity\n end\n end", "def update\n @staffgrade = Staffgrade.find(params[:id])\n\n respond_to do |format|\n if @staffgrade.update_attributes(params[:staffgrade])\n flash[:notice] = 'Staffgrade was successfully updated.'\n format.html { redirect_to(@staffgrade) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @staffgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @grade = Grade.find(params[:id])\n if @grade.update_attributes(params[:grade])\n respond_to do |format|\n format.html { redirect_to \"/assignments/#{@grade.assignment_id}/show\" } unless @grade.graded\n format.json { head :ok }\n end\n end\n end", "def update\n params.permit!\n @ms_offgrade = MsOffgrade.find(params[:id])\n\n respond_to do |format|\n if @ms_offgrade.update_attributes(params[:ms_offgrade])\n format.html { redirect_to(@ms_offgrade, :notice => 'Ms offgrade was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ms_offgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @grade = Grade.find(params[:id])\n\n respond_to do |format|\n if @grade.update_attributes(params[:grade])\n format.html { redirect_to @grade, notice: 'Grade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ratgrade = Ratgrade.find(params[:id])\n\n respond_to do |format|\n if @ratgrade.update_attributes(params[:ratgrade])\n format.html { redirect_to(@ratgrade, :notice => 'Ratgrade was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ratgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to [\"cal\",@grade], notice: 'Grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @grade }\n else\n format.html { render :edit }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to grades_path, notice: '成功編輯新的年級' }\n format.json { render :show, status: :ok, location: @grade }\n else\n format.html { render :edit }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to @grade, notice: 'Grade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @studentgrade = Studentgrade.find(params[:id])\n\n respond_to do |format|\n if @studentgrade.update_attributes(params[:studentgrade])\n format.html { redirect_to @studentgrade, notice: 'Student was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @studentgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to @grade, notice: 'Grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @grade }\n else\n format.html { render :edit }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to student_grades_path, notice: 'Grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @grade }\n else\n format.html { render :edit }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end", "def update_rest\n @item_usage = ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @item_usage.update_attributes(params[:item_usage])\n flash[:notice] = 'ItemUsage was successfully updated.'\n format.html { redirect_to(@item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @graded_component = GradedComponent.find(params[:id])\n\n respond_to do |format|\n if @graded_component.update_attributes(params[:graded_component])\n flash[:notice] = 'GradedComponent was successfully updated.'\n format.html { redirect_to(@graded_component) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @graded_component.errors, :status => :unprocessable_entity }\n end\n end\n end", "def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end", "def update\n @gtfs_agency = GtfsAgency.find(params[:id])\n\n respond_to do |format|\n if @gtfs_agency.update_attributes(params[:gtfs_agency])\n format.html { redirect_to(@gtfs_agency, :notice => 'Gtfs agency was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gtfs_agency.errors, :status => :unprocessable_entity }\n end\n end\n end", "def alter\n authorize! :update, AssignmentGrade\n error = false\n\n if !params.has_key?(:grade) || !params.has_key?(:userid) || !params.has_key?(:assignment)\n error = true\n \n else\n @agrade = AssignmentGrade.find_by_user_assignment(params[:userid], params[:assignment])\n\n if(!@agrade)\n @agrade = AssignmentGrade.new();\n @agrade.user_id = params[:userid]\n @agrade.assignment_id=params[:assignment]\n else\n end\n @agrade.grade_value=params[:grade]\n @agrade.comment=params[:comment]\n\n # Sanitize the incoming grade - check grade value\n #if @attendance != nil && Constants::Attendance::List.include?(params[:attendance].to_i)\n #@attendance.attendance = params[:attendance].to_i\n #else\n #error = true\n #end\n end\n\n if(@agrade!=nil)\n\t respond_to do |format|\n\t if @agrade.save\n\t\t format.html {redirect_to assignment_grades_path(:assignment => params[:assignment])}\n\t else\n\t\tformat.html { redirect_to alter_assignment_grades, :notice => 'Invalid grade parameters.' }\n\t end\n\t end\n else\n redirect_to assignment_grades_path and return\n end\n end", "def update\n @supervisor_estagio = SupervisorEstagio.find(params[:id])\n\n respond_to do |format|\n if @supervisor_estagio.update_attributes(params[:supervisor_estagio])\n flash[:notice] = 'Supervisor de Estagio atualizado com sucesso.'\n format.html { redirect_to(@supervisor_estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @supervisor_estagio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def mod\n # get the grade params\n grade_params = Hash.new\n params.each{ |key, value|\n begin\n key = key.to_i\n if key.kind_of?(Fixnum) && key != 0\n grade_params[key] = value\n end\n rescue Error\n # ignore\n end\n }\n grade_params.each{ |key,value|\n as = AssignmentsStudents.find(key.to_i)\n as.grade = value\n as.save\n } \n redirect_to :action => 'index', :controller => 'assignments_students'\n end", "def update\n respond_to do |format|\n if @average_grade.update(average_grade_params)\n format.html { redirect_to @average_grade, notice: 'Average grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @average_grade }\n else\n format.html { render :edit }\n format.json { render json: @average_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n if @gauge.update_attributes(params[:gauge])\n format.html { redirect_to @gauge, notice: 'Gauge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @course = Course.find(@grade.course_id)\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to @course, notice: 'Grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @grade }\n else\n format.html { render :edit }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @final_grade.update(final_grade_params)\n format.html { redirect_to @final_grade, notice: 'Final grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @final_grade }\n else\n format.html { render :edit }\n format.json { render json: @final_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @title = t 'view.grades.edit_title'\n\n respond_to do |format|\n if @grade.update(grade_params)\n format.html { redirect_to [@institution, @grade], notice: t('view.grades.correctly_updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @grade.errors, status: :unprocessable_entity }\n end\n end\n\n rescue ActiveRecord::StaleObjectError\n flash.alert = t 'view.grades.stale_object_error'\n redirect_to edit_institution_grade_url(@institution, @grade)\n end", "def update\n respond_to do |format|\n if @grade_calc.update(grade_calc_params)\n format.html { redirect_to @grade_calc, notice: 'Grade calc was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @grade_calc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student_grade_personality = StudentGradePersonality.find(params[:id])\n\n respond_to do |format|\n if @student_grade_personality.update_attributes(params[:student_grade_personality])\n flash[:notice] = 'StudentGradePersonality was successfully updated.'\n format.html { redirect_to :action => 'by_student', :id => @student_grade_personality.student.id }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_grade_personality.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new(params[:portal_grade])\n\n respond_to do |format|\n if @portal_grade.save\n flash[:notice] = 'Grade was successfully created.'\n format.html { redirect_to(@portal_grade) }\n format.xml { render :xml => @portal_grade, :status => :created, :location => @portal_grade }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @portal_grade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @office.update(office_params)\n head :no_content\n end", "def update\n respond_to do |format|\n if @catgrade.update(catgrade_params)\n format.html { redirect_to @catgrade, notice: 'Catgrade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @catgrade.errors, status: :unprocessable_entity }\n end\n end\n end", "def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend", "def update\n expire_page :action => :index\n expire_page :action => :show\n \n @ganglia_graph = GangliaGraph.get(params[:id])\n\n respond_to do |format|\n if @ganglia_graph.update(params[:ganglia_graph])\n format.html { redirect_to(@ganglia_graph, :notice => 'Ganglia Graph was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ganglia_graph.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_staff_grade\n @staff_grade = StaffGrade.find(params[:id])\n end", "def update\n respond_to do |format|\n if @member_grade.update(member_grade_params)\n format.html { redirect_to @member_grade, notice: 'Member grade was successfully updated.' }\n format.json { render :show, status: :ok, location: @member_grade }\n else\n format.html { render :edit }\n format.json { render json: @member_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @enrollment = Enrollment.find(params[:id])\n\n respond_to do |format|\n if @enrollment.update_attributes(params[:enrollment])\n flash[:notice] = 'Enrollment was successfully updated.'\n format.html { redirect_to(@enrollment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @enrollment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end", "def update\n @challenge_grade = ChallengeGrade.find(params[:id])\n\n respond_to do |format|\n if @challenge_grade.update_attributes(params[:challenge_grade])\n format.html { redirect_to @challenge_grade, notice: 'Challenge score was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @challenge_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @learn = Learn.find(params[:id])\n\n respond_to do |format|\n if @learn.update_attributes(params[:learn])\n flash[:notice] = 'Learn was successfully updated.'\n format.html { redirect_to(@learn) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @learn.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @best_lap = BestLap.find(params[:id])\n\n respond_to do |format|\n if @best_lap.update_attributes(params[:best_lap])\n format.html { redirect_to(@best_lap, :notice => 'Best lap was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @best_lap.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @upgrade = Upgrade.find(params[:id])\n\n respond_to do |format|\n if @upgrade.update_attributes(params[:upgrade])\n format.html { redirect_to(@upgrade, :notice => 'Upgrade was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @upgrade.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n #debugger\n if @enrollment.update(update_params)\n head :no_content\n else\n render json: @enrollment.errors, status: :unprocessable_entity\n end\n end", "def update\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n if @degree.update_attributes(params[:degree])\n format.html { redirect_to(@degree, :notice => 'Degree was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n \n params[:assessment] = {} if !params[:assessment]\n @assessment = Assessment.find(params[:id])\n respond_to do |format| # Update is restricted to the following 4 fields\n if @assessment.update_attributes({:grade => params[:assessment][:grade], :comment_header => params[:assessment][:comment_header], \n :comment_text => params[:assessment][:comment_text], :published => params[:assessment][:published]})\n flash[:notice] = 'Assessment was successfully updated.'\n format.html { redirect_to(@assessment) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @assessment.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @portal = Portal.find(params[:id])\n\n respond_to do |format|\n if @portal.update_attributes(params[:portal])\n flash[:notice] = 'Portal was successfully updated.'\n format.html { redirect_to(@portal) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @portal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @education = Education.where(:resource_id => current_user.id, :id => params[:id]).first\n\n respond_to do |format|\n if @education.update_attributes(params[:education])\n format.html { redirect_to(@education, :notice => 'Education was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @education.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n flash[:success] = 'Your stencil has been updated.' if @stencil.update_attributes(stencil_params)\n respond_with @organization, @stencil\n end", "def update\r\n @salle = Salle.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @salle.update_attributes(params[:salle])\r\n format.html { redirect_to @salle, notice: 'Salle was successfully updated.' }\r\n format.json { head :ok }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @salle.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @student_availability = StudentAvailability.find(params[:id])\n\n respond_to do |format|\n if @student_availability.update_attributes(params[:student_availability])\n format.html { redirect_to @student_availability, notice: 'Student availability was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @student_availability.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @estagio = Estagio.find(params[:id])\n\n respond_to do |format|\n if @estagio.update_attributes(params[:estagio])\n flash[:notice] = 'Estagio was successfully updated.'\n format.html { redirect_to(@estagio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def set_grade\n @grade = Grade.find(params[:id])\n end", "def new\n # PUNDIT_REVIEW_AUTHORIZE\n # PUNDIT_CHECK_AUTHORIZE\n # authorize Portal::Grade\n @portal_grade = Portal::Grade.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portal_grade }\n end\n end", "def update\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n if @degree.update_attributes(params[:degree])\n flash[:notice] = 'Degree was successfully updated.'\n format.html { redirect_to(@degree) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @snap = Snap.find(params[:id])\n\n respond_to do |format|\n if @snap.update_attributes(params[:snap])\n format.html { redirect_to(@snap, :notice => 'Snap was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @snap.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @course_degree = CourseDegree.find(params[:id])\n\n respond_to do |format|\n if @course_degree.update_attributes(params[:course_degree])\n format.html { redirect_to(@course_degree, :notice => 'Course degree was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @course_degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @supaagent.update(supaagent_params)\n format.html { redirect_to edit_supaagent_path(@supaagent.id+1), notice: 'Supaagent was successfully updated.' }\n format.json { render :show, status: :ok, location: @supaagent }\n else\n format.html { render :edit }\n format.json { render json: @supaagent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @agent = Agent.find(params[:id])\n @agent.save!\n respond_to do |format|\n if @agent.update_attributes(params[:agent])\n flash[:notice] = 'Agent was successfully updated.'\n format.html { redirect_to(@agent) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => agent.errors, :status => :unprocessable_entity }\n end\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end", "def update\n @guide = Guide.find(params[:id])\n\n respond_to do |format|\n if @guide.update_attributes(params[:guide])\n flash[:notice] = 'Guide was successfully updated.'\n format.html { redirect_to(@guide) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @guide.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if @grade.save\n flash[:success] = \"Grade was successfully updated\"\n redirect_to grades_path\n else\n flash[:errors] = @grade.errors.full_messages.join(' ')\n redirect_to grades_path\n end\n end", "def update\n @agent = Agent.find(params[:id])\n\n respond_to do |format|\n if @agent.update_attributes(params[:agent])\n format.html { redirect_to(@agent, :notice => 'Agent was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @agent.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def update\n @degree = Degree.find(params[:id])\n\n respond_to do |format|\n if @degree.update_attributes(params[:degree])\n format.html { redirect_to(@degree, :notice => 'La titulacion se modifico correctamente.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @portal_learner = Portal::Learner.find(params[:id])\n\n respond_to do |format|\n if @portal_learner.update_attributes(params[:learner])\n flash[:notice] = 'Portal::Learner was successfully updated.'\n format.html { redirect_to(@portal_learner) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @portal_learner.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @criterion_grade.update(criterion_grade_params)\n format.html { redirect_to @criterion_grade, notice: 'Criterion grade was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @criterion_grade.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_rest\n @page_usage_event = PageUsageEvent.find(params[:id])\n\n respond_to do |format|\n if @page_usage_event.update_attributes(params[:page_usage_event])\n flash[:notice] = 'PageUsageEvent was successfully updated.'\n format.html { redirect_to(@page_usage_event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page_usage_event.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @step = TaskrequestsStep.find(params[:taskrequests_step_id])\n @absence_request = @step.absence_requests.find(params[:id])\n\n respond_to do |format|\n if @absence_request.update_attributes(params[:absence_request])\n format.html { redirect_to(@absence_request, :notice => 'Absence request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @absence_request.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_grade\n grade_entry_form = GradeEntryForm.find(params[:id])\n grade_entry_student =\n grade_entry_form.grade_entry_students.find(params[:student_id])\n grade =\n grade_entry_student.grades.find_or_create_by(grade_entry_item_id: params[:grade_entry_item_id])\n\n grade.update(grade: params[:updated_grade])\n grade_entry_student.save # Refresh total grade\n grade_entry_student.reload\n render plain: grade_entry_student.total_grade\n end", "def update\n @bookfair = Bookfair.find(params[:id])\n\n respond_to do |format|\n if @bookfair.update_attributes(params[:bookfair])\n format.html { redirect_to(@bookfair, :notice => 'Bookfair was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @bookfair.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @manual = Manual.find(params[:id])\n\n respond_to do |format|\n if @manual.update_attributes(params[:manual])\n format.html { redirect_to(@manual, :notice => 'Manual was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @manual.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n if @enterprise.update_attributes(params[:enterprise])\n format.html { redirect_to \"/enterprises\", notice: 'Enterprise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @enterprise.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @thesis_proposal = ThesisProposal.find(params[:id])\n\n respond_to do |format|\n if @thesis_proposal.update_attributes(params[:thesis_proposal])\n format.html { redirect_to(@thesis_proposal, :notice => 'ThesisProposal was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thesis_proposal.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @acquired_energy.update(acquired_energy_params)\n format.html { redirect_to @acquired_energy, notice: 'Acquired energy was successfully updated.' }\n format.json { render :show, status: :ok, location: @acquired_energy }\n else\n format.html { render :edit }\n format.json { render json: @acquired_energy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @enroll.update(enroll_params)\n format.html { redirect_to @enroll, notice: 'Test was successfully updated.' }\n format.json { render :show, status: :ok, location: @enroll }\n else\n format.html { render :edit }\n format.json { render json: @enroll.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @sellerring = Sellerring.find(params[:id])\n\n respond_to do |format|\n if @sellerring.update_attributes(params[:sellerring])\n format.html { redirect_to(@sellerring, :notice => 'Sellerring was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sellerring.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @required_degree = RequiredDegree.find(params[:id])\n\n respond_to do |format|\n if @required_degree.update_attributes(params[:required_degree])\n flash[:notice] = 'RequiredDegree was successfully updated.'\n format.html { redirect_to(@required_degree) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @required_degree.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n flash[:notice] = 'Exam was successfully updated.'\n format.html { redirect_to(@exam) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_rest\n @entry_answer = EntryAnswer.find(params[:id])\n\n respond_to do |format|\n if @entry_answer.update_attributes(params[:entry_answer])\n flash[:notice] = 'EntryAnswer was successfully updated.'\n format.html { redirect_to(@entry_answer) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_answer.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @admin_agency = Admin::Agency.find(params[:id])\n\n respond_to do |format|\n if @admin_agency.update_attributes(params[:admin_agency])\n format.html { redirect_to @admin_agency, notice: 'Agency was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_agency.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @student_graduatedship = StudentGraduatedship.find(params[:id])\n\n respond_to do |format|\n if @student_graduatedship.update_attributes(params[:student_graduatedship])\n format.html { redirect_to(@student_graduatedship, :notice => 'Student graduatedship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_graduatedship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @evaluacione = Evaluacione.find(params[:id])\n\n respond_to do |format|\n if @evaluacione.update_attributes(params[:evaluacione])\n format.html { redirect_to(@evaluacione, :notice => 'Evaluacione was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evaluacione.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @student_improveship = StudentImproveship.find(params[:id])\n\n respond_to do |format|\n if @student_improveship.update_attributes(params[:student_improveship])\n format.html { redirect_to(@student_improveship, :notice => 'Student improveship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @student_improveship.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @faculty.update(faculty_params)\n head :no_content\n end", "def update\n if @education.update(education_params)\n render :show, status: :ok, location: @education\n else\n render json: @education.errors, status: :unprocessable_entity\n end\n end", "def update\n @offlearn = Offlearn.find(params[:id])\n\n respond_to do |format|\n if @offlearn.update_attributes(params[:offlearn])\n flash[:notice] = 'Offlearn was successfully updated.'\n format.html { redirect_to(@offlearn) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @offlearn.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @mt_energy_data = MtEnergyData.find(params[:id])\n\n respond_to do |format|\n if @mt_energy_data.update_attributes(params[:mt_energy_data])\n format.html { redirect_to(@mt_energy_data) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @mt_energy_data.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n if @estudiante.update_attributes(params[:estudiante])\n format.html { redirect_to(@estudiante, :notice => 'Estudiante was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estudiante.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @academic_degree.update(academic_degree_params)\n format.html { redirect_to '/maestricos/prueba?titulo=Grado+Academico&tabla=AcademicDegree' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @academic_degree.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end", "def update\n @allergy = Allergy.find(params[:id])\n\n respond_to do |format|\n if @allergy.update_attributes(params[:allergy])\n format.html { redirect_to(@allergy, :notice => 'Allergy was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @allergy.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @assignment = Assignment.find(params[:assignment_id])\n @essay = Essay.find(params[:id])\n \n respond_to do |format|\n if @essay.update_attributes(params[:essay])\n format.html { redirect_to assignment_essay_url(@essay.assignment_id, @essay.id), notice: 'Essay was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @graduation = Graduation.find(params[:id])\n\n respond_to do |format|\n if @graduation.update_attributes(params[:graduation])\n format.html { redirect_to(@graduation, :notice => 'Graduation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @graduation.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tx_land_grants_special_collection.update(tx_land_grants_special_collection_params)\n format.html { redirect_to @tx_land_grants_special_collection, notice: 'Tx land grants special collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tx_land_grants_special_collection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @grades_tournament.update(grades_tournament_params)\n format.html { redirect_to @grades_tournament, notice: 'Grades tournament was successfully updated.' }\n format.json { render :show, status: :ok, location: @grades_tournament }\n else\n format.html { render :edit }\n format.json { render json: @grades_tournament.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @education_level = EducationLevel.find(params[:id])\n\n respond_to do |format|\n if @education_level.update_attributes(params[:education_level])\n format.html { redirect_to @education_level, :notice => t('controllermessage.update') }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @education_level.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.6365745", "0.6319611", "0.6290411", "0.62235326", "0.6215058", "0.60693717", "0.60411453", "0.603023", "0.6004324", "0.599807", "0.598671", "0.59574413", "0.5932828", "0.58600396", "0.58561796", "0.5842538", "0.58272594", "0.57889843", "0.57829535", "0.5696921", "0.5694922", "0.56942457", "0.5674756", "0.56646484", "0.5655208", "0.5639731", "0.5638398", "0.56319934", "0.5618445", "0.5598163", "0.5596579", "0.55937487", "0.55823565", "0.5576219", "0.5575481", "0.5573299", "0.5571112", "0.5566071", "0.5564833", "0.5559089", "0.5536654", "0.55319107", "0.5531348", "0.5525395", "0.5524459", "0.55217755", "0.55076724", "0.55063045", "0.55052376", "0.5504413", "0.5504413", "0.5504413", "0.5504413", "0.5504413", "0.5504413", "0.5504413", "0.5504413", "0.5503843", "0.5499193", "0.54974943", "0.54962516", "0.54901004", "0.5486354", "0.547729", "0.5476324", "0.54748726", "0.54718363", "0.5471633", "0.54653734", "0.5457499", "0.54564327", "0.5441713", "0.5440169", "0.5439828", "0.5438652", "0.54385686", "0.54377943", "0.5437667", "0.54371583", "0.5435148", "0.5407775", "0.5405288", "0.540445", "0.540444", "0.5397517", "0.5392436", "0.53912264", "0.538907", "0.5386961", "0.53812146", "0.537977", "0.5374108", "0.53728443", "0.5372437", "0.5371725", "0.5367032", "0.5366573", "0.53651845", "0.536309", "0.5356555" ]
0.683574
0
DELETE /portal_grades/1 DELETE /portal_grades/1.xml
def destroy # PUNDIT_REVIEW_AUTHORIZE # PUNDIT_CHECK_AUTHORIZE (did not find instance) # authorize @grade @portal_grade = Portal::Grade.find(params[:id]) @portal_grade.destroy respond_to do |format| format.html { redirect_to(portal_grades_url) } format.xml { head :ok } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @ratgrade = Ratgrade.find(params[:id])\n @ratgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(ratgrades_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @staffgrade = Staffgrade.find(params[:id])\n @staffgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(staffgrades_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @grade.destroy\n\n head :no_content\n end", "def destroy\n @ms_offgrade = MsOffgrade.find(params[:id])\n @ms_offgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(ms_offgrades_url) }\n format.xml { head :ok }\n end\n end", "def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end", "def test_set3_04b_delete_group()\n group = \"test_group\"\n user = \"test_user\"\n \n @test_acl.create_principal(user)\n @test_acl.create_group(group, [\"ALL\"], [user])\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n #puts query\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(1, hits)\n \n @test_acl.delete_principal(group)\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end", "def destroy\n @grade.destroy\n\n respond_to do |format|\n format.html { redirect_to institution_grades_url(@institution) }\n format.json { head :no_content }\n end\n end", "def delete\n\t\tdb.execute{ \"delete edge #{ref_name} #{rrid}\" }\n\tend", "def test_set3_04c_delete_principal()\n user = \"test_user\"\n @test_acl.create_principal(user)\n id = @test_acl.create_ace(user, \"allow\", \"SELECT\", \"test\", \"/db/temporary/testsource\")\n \n @test_acl.delete_principal(user)\n query = \"doc(\\\"#{@col_path}acl.xml\\\")//node()[@id=\\\"#{id}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end", "def destroy\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to cal_grades_path, notice: 'La calificación ha sido eliminada' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grade = Grade.find(params[:id])\n @grade.destroy\n\n respond_to do |format|\n format.html { redirect_to grades_url }\n format.json { head :ok }\n end\n end", "def destroy\n @grade = Grade.find(params[:id])\n @grade.destroy\n\n respond_to do |format|\n format.html { redirect_to grades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @student_grade_personality = StudentGradePersonality.find(params[:id])\n @student_grade_personality.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_grade_personalities_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to grades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @catgrade.destroy\n respond_to do |format|\n format.html { redirect_to catgrades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @portal_learner = Portal::Learner.find(params[:id])\n @portal_learner.destroy\n\n respond_to do |format|\n format.html { redirect_to(portal_learners_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @snap = Snap.find(params[:id])\n @snap.destroy\n\n respond_to do |format|\n format.html { redirect_to(snaps_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end", "def destroy\n @criterion_grade.destroy\n respond_to do |format|\n format.html { redirect_to criterion_grades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @upgrade = Upgrade.find(params[:id])\n @upgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to(upgrades_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @grade_calc.destroy\n respond_to do |format|\n format.html { redirect_to grade_calcs_url }\n format.json { head :no_content }\n end\n end", "def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end", "def destroy\n @helocagree = Helocagree.find(params[:id])\n @helocagree.destroy\n\n respond_to do |format|\n format.html { redirect_to(helocagrees_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @enrollment = Enrollment.find(params[:id])\n @enrollment.destroy\n\n respond_to do |format|\n format.html { redirect_to(enrollment_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to grades_url, notice: '成功刪除以選擇的年級' }\n format.json { head :no_content }\n end\n end", "def destroy\n @studentgrade = Studentgrade.find(params[:id])\n @studentgrade.destroy\n\n respond_to do |format|\n format.html { redirect_to students_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graded_component = GradedComponent.find(params[:id])\n @graded_component.destroy\n\n respond_to do |format|\n format.html { redirect_to(graded_components_url) }\n format.xml { head :ok }\n end\n end", "def delete_course_by_id(org_unit_id)\n path = \"/d2l/api/lp/#{$lp_ver}/courses/#{org_unit_id}\" # setup user path\n # ap path\n _delete(path)\n puts '[+] Course data deleted successfully'.green\nend", "def test_set3_06b_delete_res_object()\n user = \"test_user\"\n priv = \"test_privilege\"\n res_ob_type = \"test\"\n res_ob_adr = \"/db/temporary/testsource\"\n \n @test_acl.create_principal(user)\n @test_acl.create_resource_object(res_ob_type, res_ob_adr, user)\n id = @test_acl.create_ace(user, \"allow\", priv, res_ob_type, res_ob_adr)\n \n @test_acl.delete_res_object(res_ob_type, res_ob_adr)\n query = \"doc(\\\"#{@col_path}acl.xml\\\")//node()[@id=\\\"#{id}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end", "def destroy\n @student_graduatedship = StudentGraduatedship.find(params[:id])\n @student_graduatedship.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_graduatedships_url) }\n format.xml { head :ok }\n end\n end", "def report_delete(id)\r\n\t\tpost= { \"token\" => @token, \"report\" => id } \r\n\t\tdocxml=nessus_request('report/delete', post)\r\n\t\treturn docxml\r\n\tend", "def destroy\n @evaluacione = Evaluacione.find(params[:id])\n @evaluacione.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluaciones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n\t\t@user_ids= @grade.user_ids\n\t\t@user_ids= @user_ids.sub \"[\", \"\"\n\t\t@user_ids= @user_ids.sub \"]\", \"\"\n\t\t@user_ids= @user_ids.split(\",\")\n\t\t\n\t\t@user_ids.each do |user_id|\n\t\t\tif User.find_by_id(user_id)\n\t\t\t\tUser.find_by_id(user_id).destroy\n\t\t\tend\n\t\tend\t\t\n\n\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to grades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @gtfs_agency = GtfsAgency.find(params[:id])\n @gtfs_agency.destroy\n\n respond_to do |format|\n format.html { redirect_to(gtfs_agencies_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @course_degree = CourseDegree.find(params[:id])\n @course_degree.destroy\n\n respond_to do |format|\n format.html { redirect_to(course_degrees_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @graduation = Graduation.find(params[:id])\n @graduation.destroy\n\n respond_to do |format|\n format.html { redirect_to(graduations_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tree_node_ac_rights = TreeNodeAcRight.find(params[:id])\n @tree_node_ac_rights.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_tree_node_tree_node_permissions_path }\n format.xml { head :ok }\n end\n end", "def destroy\n @graduate_applicant = GraduateApplicant.find(params[:id])\n\n gc_authorized(@graduate_applicant.department_id) # Verify Current GC Is Authorized\n\n @graduate_applicant.destroy\n\n respond_to do |format|\n flash[:notice] = 'Graduate Applicant was successfully deleted.'\n format.html { redirect_to(graduate_applicants_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @assessment = Assessment.find(params[:id])\n @assessment.destroy\n \n respond_to do |format|\n format.html { redirect_to(assessments_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @req_breakdown = ReqBreakdown.find(params[:id])\n @req_breakdown.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_req_breakdowns_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to student_grades_path, notice: 'Grade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @education = Education.where(:resource_id => current_user.id, :id => params[:id]).first\n @education.destory\n\n respond_to do |format|\n format.html { redirect_to(educations_url) }\n format.xml { head :ok }\n end\n end", "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end", "def destroy\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to grades_url, notice: 'Grade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "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 @exp = Exp.find(params[:id])\n @exp.destroy\n\n respond_to do |format|\n format.html { redirect_to(exps_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @average_grade.destroy\n respond_to do |format|\n format.html { redirect_to average_grades_url, notice: 'Average grade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @grade.destroy\n respond_to do |format|\n format.html { redirect_to grades_url, notice: \"Grade was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @geocache.destroy\n \n #add score to user rank\n del_score_to_rank('upload')\n \n respond_to do |format|\n format.html { redirect_to(geocaches_url) }\n format.xml { head :ok }\n end\n end", "def delete\n CONNECTION.execute(\"DELETE FROM assignments WHERE id = #{self.id};\")\n end", "def destroy\n @regdb = Regdb.find(params[:id])\n @regdb.destroy\n\n respond_to do |format|\n format.html { redirect_to(regdbs_url) }\n format.xml { head :ok }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to(exams_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @education = @resume.educations.find(params[:id])\n @education.destroy\n\n respond_to do |format|\n format.html { redirect_to(edit_resume_path(@resume)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @guarantor = Guarantor.find(params[:id])\n @guarantor.destroy\n applicant=Applicant.find(@guarantor.applicant_id)\n respond_to do |format|\n format.html { redirect_to(applicant, :notice => 'Guarantor deleted.') }\n format.xml { head :ok }\n end\n end", "def delete\n\n\tend", "def destroy\n @prd_etc = PrdEtc.find(params[:id])\n @prd_etc.destroy\n\n respond_to do |format|\n format.html { redirect_to(prd_etcs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @alfresco = Alfresco.find(params[:id])\n @alfresco.destroy\n\n respond_to do |format|\n format.html { redirect_to(alfrescos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @aisle = Aisle.find(params[:id])\n @aisle.destroy\n\n respond_to do |format|\n format.html { redirect_to(aisles_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @tuple = Tuple.find(params[:id])\n @tuple.destroy\n\n respond_to do |format|\n format.html { redirect_to(tuples_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @atest = Atest.find(params[:id])\n @atest.destroy\n\n respond_to do |format|\n format.html { redirect_to(atests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @degree = Degree.find(params[:id])\n @degree.destroy\n\n respond_to do |format|\n format.html { redirect_to(degrees_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @dbs_deposit = DbsDeposit.find(params[:id])\n @dbs_deposit.destroy\n\n respond_to do |format|\n format.html { redirect_to(dbs_deposits_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student_relation = StudentRelation.find(params[:id])\n @student_relation.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_relations_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @deposit_threshold = DepositThreshold.find(params[:id])\n @deposit_threshold.destroy\n\n respond_to do |format|\n format.html { redirect_to(deposit_thresholds_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @challenge_grade = ChallengeGrade.find(params[:id])\n @challenge_grade.destroy\n\n respond_to do |format|\n format.html { redirect_to challenge_grades_url }\n format.json { head :ok }\n end\n end", "def destroy\n @supervisor_estagio = SupervisorEstagio.find(params[:id])\n @supervisor_estagio.destroy\n\n respond_to do |format|\n format.html { redirect_to(supervisor_estagios_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @graduate = Graduate.find(params[:id])\n @graduate.destroy\n redirect_to admin_graduates_path, notice: \"Egresado Eliminado\"\n end", "def destroy\n @student_referee = StudentReferee.find(params[:id])\n @student_referee.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_referees_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @course = Course.find(@grade.course_id) \n @grade.destroy\n respond_to do |format|\n format.html { redirect_to @course, notice: 'Grade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @degree = Degree.find(params[:id])\n @degree.destroy\n\n respond_to do |format|\n format.html { redirect_to(degrees_url) }\n format.xml { head :ok }\n end\n end", "def delete\n end", "def delete\n Iterable.request(conf, base_path).delete\n end", "def destroy\n @evaluate_course = EvaluateCourse.find(params[:id])\n @evaluate_course.destroy\n\n respond_to do |format|\n format.html { redirect_to(evaluate_courses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @estacion = Estacion.find(params[:id])\n @estacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(estaciones_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @pfs_consultation = PfsConsultation.find(params[:id])\n @pfs_consultation.destroy\n\n respond_to do |format|\n format.html { redirect_to(pfs_consultations_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @college = College.find(params[:id])\n @college.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_colleges_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end", "def destroy\n @agendasalerta = Agendasalerta.find(params[:id])\n @agendasalerta.destroy\n\n respond_to do |format|\n format.html { redirect_to(agendasalertas_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ordendetalle = Ordendetalle.find(params[:id])\n @ordendetalle.destroy\n\n respond_to do |format|\n format.html { redirect_to(ordendetalles_url) }\n format.xml { head :ok }\n end\n end", "def test_delete_assignment\r\n\r\n number_of_assignment = Assignment.count\r\n number_of_duedate = DueDate.count\r\n id = Assignment.first(:conditions => {:instructor_id => users(:instructor3).id}).id\r\n post :delete, :id => id\r\n assert_redirected_to :controller => 'tree_display', :action => 'list'\r\n assert_equal number_of_assignment-1, Assignment.count\r\n assert_raise(ActiveRecord::RecordNotFound){ Assignment.find(id) }\r\n\r\n end", "def destroy\n @allcourse = Allcourse.find(params[:id])\n @allcourse.destroy\n\n respond_to do |format|\n format.html { redirect_to(allcourses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end", "def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end", "def destroy\n @exam_candidate.destroy\n\n respond_to do |format|\n format.html { redirect_to(candidates_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @prd_attribute = PrdAttribute.find(params[:id])\n @prd_attribute.destroy\n\n #delete_rules()\n\n respond_to do |format|\n format.html { redirect_to(prd_attributes_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def destroy\n @guide = Guide.find(params[:id])\n @guide.destroy\n\n respond_to do |format|\n format.html { redirect_to(guides_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @enrollment.destroy\n\n head :no_content\n end", "def destroy\n @dashboard = Dashboard.find(params[:id])\n @dashboard.destroy\n\n respond_to do |format|\n format.html { redirect_to(dashboards_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @student_group_rule = StudentGroupRule.find(params[:id])\n @student_group_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(student_group_rules_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @certificado = Certificado.find(params[:id])\n @certificado.destroy\n\n respond_to do |format|\n format.html { redirect_to(certificados_url) }\n format.xml { head :ok }\n end\n end", "def delete\n \n end", "def destroy #:nodoc:\n @academic_level = AcademicLevel.find(params[:id])\n @academic_level.destroy\n\n respond_to do |format|\n format.html { redirect_to academic_levels_url }\n # format.xml { head :ok }\n end\n end", "def maintenance_delete(statuspage_id, maintenance_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['maintenance_id'] = maintenance_id\n\n request :method => :post,\n :url => @url + 'maintenance/delete',\n :payload => data\n end", "def delete_data\n response = WebPay.client.delete([path, 'data'].join('/'))\n response['deleted']\n end", "def delete\n # Delete the assignment\n Relationship.delete(params[:id])\n\n @active=\"assignments\"\n redirect_to \"/manage\"\n end", "def destroy\n @absence_request = AbsenceRequest.find(params[:id])\n @absence_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(absence_requests_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @member_grade.destroy\n respond_to do |format|\n format.html { redirect_to member_grades_url, notice: 'Member grade was successfully destroyed.' }\n format.json { head :no_content }\n end\n end" ]
[ "0.66639835", "0.66347754", "0.65093625", "0.64378923", "0.6200371", "0.61861765", "0.61788267", "0.61274105", "0.61256903", "0.6082417", "0.607264", "0.6048897", "0.6045539", "0.60418683", "0.60165656", "0.6012558", "0.5996852", "0.59816706", "0.598102", "0.5973938", "0.5955246", "0.5946693", "0.59462976", "0.59363997", "0.5918608", "0.5901233", "0.5896255", "0.58891886", "0.58823675", "0.58809286", "0.58786434", "0.58605635", "0.5860395", "0.585778", "0.58498704", "0.5825256", "0.582437", "0.5818269", "0.58157516", "0.5815177", "0.58109564", "0.5809694", "0.58074987", "0.58010226", "0.5800436", "0.5795077", "0.57947546", "0.5787341", "0.5787282", "0.57843274", "0.57835937", "0.5779826", "0.5779362", "0.5777474", "0.5775882", "0.577568", "0.5774347", "0.5771919", "0.5771586", "0.5763527", "0.57630473", "0.57615757", "0.57582366", "0.575535", "0.57529414", "0.57519054", "0.5751345", "0.57501704", "0.57466507", "0.57444704", "0.57407075", "0.573872", "0.573707", "0.573598", "0.5735917", "0.5735787", "0.5731047", "0.57235163", "0.5718638", "0.5718417", "0.57173216", "0.5715954", "0.57082593", "0.5704202", "0.5700746", "0.56997323", "0.5699463", "0.5699018", "0.569664", "0.5695173", "0.569484", "0.56944126", "0.5694327", "0.56929624", "0.5691453", "0.56910264", "0.56890637", "0.56889623", "0.5686521", "0.56862044" ]
0.68664056
0
going to be REAL MESSY for now..
def extract if @options[:type] == :text @potential_names += @content.split(/\n/) elsif @options[:type] == :html @potential_names += HTMLNameFinder.new(@content).names @potential_names += @nokogiri_doc.css("title, p, li, span, a").map(&:text) end @name_detector = NameDetector.new(@potential_names) @extract = @name_detector.extract_names end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def private; end", "def probers; end", "def schubert; end", "def stderrs; end", "def specie; end", "def specie; end", "def specie; end", "def specie; end", "def anchored; end", "def terpene; end", "def malts; end", "def who_we_are\r\n end", "def formation; end", "def berlioz; end", "def trd; end", "def suivre; end", "def refutal()\n end", "def verdi; end", "def custom; end", "def custom; end", "def operations; end", "def operations; end", "def offences_by; end", "def identify; end", "def weber; end", "def villian; end", "def intensifier; end", "def internal; end", "def jack_handey; end", "def sitemaps; end", "def blg; end", "def dh; end", "def gounod; end", "def upc_e; end", "def schumann; end", "def internship_passed; end", "def celebration; end", "def hiss; end", "def loc; end", "def loc; end", "def loc; end", "def ibu; end", "def r; end", "def r; end", "def implementation; end", "def implementation; end", "def bs; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def pos; end", "def apply\n\t\t\n\tend", "def apply\n\t\t\n\tend", "def sld; end", "def used?; end", "def isolated; end", "def isolated; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def run; end", "def user_os_complex\r\n end", "def hd\n \n end", "def parts; end", "def parts; end", "def parts; end", "def processor; end", "def rassoc(p0) end", "def feruchemist; end", "def rossini; end", "def same; end", "def parslet; end", "def parslet; end", "def parslet; end", "def parslet; end", "def tld; end", "def tld; end", "def ismn; end", "def lsi; end", "def getc() end", "def getc() end", "def getc() end", "def placebo?; false end", "def extra; end", "def surge; end", "def probers=(_arg0); end", "def transformations; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end", "def position; end" ]
[ "0.7257328", "0.68424517", "0.657983", "0.63172513", "0.6181113", "0.6181113", "0.6181113", "0.6181113", "0.60980153", "0.6086525", "0.60734385", "0.6031533", "0.602129", "0.60138106", "0.60123116", "0.60042346", "0.59312266", "0.59071344", "0.5890884", "0.5890884", "0.58875626", "0.58875626", "0.5858817", "0.58516705", "0.5825979", "0.58139396", "0.58037186", "0.5801084", "0.5786278", "0.5782042", "0.5757209", "0.5723432", "0.57218194", "0.56966263", "0.56928486", "0.56884485", "0.5678317", "0.5663248", "0.56598604", "0.56598604", "0.56598604", "0.56550395", "0.5648794", "0.5648794", "0.56465286", "0.56465286", "0.5632696", "0.559152", "0.559152", "0.559152", "0.559152", "0.559152", "0.559152", "0.5588142", "0.5588142", "0.55862594", "0.55789626", "0.5577171", "0.5577171", "0.55595595", "0.55595595", "0.55595595", "0.55595595", "0.55595595", "0.55595595", "0.55595595", "0.55595595", "0.55595595", "0.5548514", "0.5543798", "0.55317765", "0.55317765", "0.55317765", "0.5528492", "0.552303", "0.551614", "0.55151415", "0.55030537", "0.54979867", "0.54979867", "0.54979867", "0.54979867", "0.5494631", "0.5494631", "0.5494603", "0.54910195", "0.54821646", "0.54821646", "0.54821646", "0.5475022", "0.54678315", "0.54647106", "0.5463585", "0.5459696", "0.5457396", "0.5457396", "0.5457396", "0.5457396", "0.5457396", "0.5457396", "0.5457396" ]
0.0
-1
GET /group_members/1 ==> [group_id]
def show @group_members = GroupMember.where(group_id:params[:id]) @users_in_group=[] @group_members.each do |f| @user = User.find(f[:user_id]) @users_in_group.push(@user) end render json: @users_in_group end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_members(id)\n get(\"/groups/#{id}/members\")\n end", "def index\n id = -1 \n if params[:id] \n id = params[:id]\n else \n id = current_user.id \n end \n\n @user = User.find(id)\n @group = UserGroup.find_by(user_id: id, name: params[:group])\n\n if !@group.nil?\n @group_members = get_members(@user, @group)\n end \n\n end", "def index\n @group = Group.find(params[:id])\n @members = GroupUser.where(:group_id => params[:id])\n end", "def members\n @group = Group.find(params[:group_id])\n @members = @group.users\n end", "def index\n if params[:group_id]\n @members = Group.find(params[:group_id]).members\n else\n @members = Member.all\n end\n end", "def show\n @group = Group.find(params[:id])\n @members = Member.find(:all, :conditions => [\"group_id = ? and deleted = 0\", params[:id]])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end", "def group_members(group_id)\n url = \"/groups/#{group_id}/members/\"\n get(url)\n end", "def show\n @group_member = GroupMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group_member }\n end\n end", "def show\n @group_member = GroupMember.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group_member }\n end\n end", "def member_from_group_id(group_id)\n #scrap first page\n begin\n puts \"fetching group ID #{group_id}\"\n members = flickr.groups.members.getList(:group_id => \"#{group_id}\")\n members.each do |m|\n #store member\n save_member(m, group_id)\n end\n #scrap next page\n total_pages = members.pages\n current_page = 2\n while current_page <= total_pages\n begin\n puts \"fetching at current page #{current_page} of group id #{group_id}\"\n members = flickr.groups.members.getList(:group_id => \"#{group_id}\", :page => current_page)\n members.each do |m|\n save_member(m, group_id)\n end\n rescue => e\n write_to_log(e)\n write_to_log(\"fetching at current page #{current_page} of group id #{group_id}\")\n end\n current_page = current_page + 1\n end\n rescue => e\n write_to_log(e)\n end\n end", "def group_members(id, params = {})\n get(\"/groups/#{id}/members\", params)\n end", "def instructor_group_member(id, options = {})\n get \"instructor_group_members/#{id}\", options\n end", "def group_members(group_id, params = {})\n get(\"/v1/groups/#{group_id}/members\", params)\n end", "def show\n save_navi_state(['groups_title', 'browse_groups'])\n begin\n @group = Group.find(params[:id])\n @members = @group.members(session[:cookie]).paginate :page => params[:page], :per_page => per_page\n rescue RestClient::ResourceNotFound => e\n flash[:error] = :group_not_found\n redirect_to groups_path\n rescue ActiveRecord::RecordNotFound => e\n flash[:error] = :group_not_found\n redirect_to groups_path\n end\n end", "def index\n @group_members = @client.group_members\n \n end", "def get_membership(group)\n @uri = URI.parse(\"#{@api_url}/group/#{group}/member\")\n body = make_get_request\n doc = Nokogiri::HTML(body)\n members = []\n doc.xpath('//a[@class=\"member\"]').each do |m|\n members << m.text\n end\n members\n end", "def get_group_members\n\t\tid = params[:id]\n\n #Get the initial call of members in the group\n members_initial = TheCityAdmin::GroupRoleList.new({:group_id => id})\n @total_count = members_initial.total_pages\n @members = Array.new\n\n members_initial.each do |member|\n @members << member\n end\n\n if Rcplugin::DEV_ENV == true\n puts \"CTDEBUG: Total pages to get #{members_initial.total_pages}\"\n puts 'CTDEBUG: Group list for id: ' + id\n puts members_initial.to_json\n end\n\n #If there is more than one page loop through all the pages and then return\n if @total_count > 1\n for i in 2..@total_count\n TheCityAdmin::AdminApi.connect(Rcplugin::CITY_ADMIN_SECRET,Rcplugin::CITY_USER_TOKEN)\n members = TheCityAdmin::GroupRoleList.new({:group_id => id,:page => i})\n members.each do |member|\n @members << member\n end\n end\n end\n\n if Rcplugin::DEV_ENV == true\n puts 'CTDEBUG: Final members list in JSON'\n puts @members.to_json\n end\n\n\t\trender json: @members.to_json\n\tend", "def index\n @group = current_user.groups.find_by(id: params[:group_id]) || @groups.first\n end", "def show\n #logger.info \"GroupsController Get Parameters: #{params}\"\n if @group\n render json: @group.to_json(:include => {:memberships => {:only => [:admin], :include => {:user => {:only => [:id, :first_name, :last_name, :email]}}}})\n else\n render json: {error: \"YOU MUST BE MEMBER OF THIS GROUP TO SEE IT\"}, status: :unprocessable_entity\n end\n end", "def GetMembership id\n\n APICall(path: \"group_memberships/#{id}.json\")\n\n end", "def show\n #@group = Group.find(params[:id])\n \n @users = @group.users\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end", "def index\n @group_members = GroupMember.all\n end", "def show\n @group = Group.find(params[:group_id])\n end", "def retrieve_group\n @group = Group.find(params[:group_id])\n end", "def getUserBy_groupid( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"get\",\"/user/by_groupid\",params)\n end", "def show_group(id)\n get(\"groups/#{id}\")\n end", "def fetch_group\n @group = Group.find(params[:group_id])\n end", "def show\n @group = Group.find(params[:id])\n\n render json: @group.to_json(:include => {:memberships => {:only => [:admin], :include => {:user => {:only => [:id, :first_name, :last_name, :email]}}}})\n end", "def getGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"get\",\"/group\",params)\n end", "def show\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_group }\n end\n end", "def show\n @group = current_user.groups.includes(:group_users).find params[:id]\n end", "def show\n @group = Group.find(params[:id]) #Sicherheitsrisiko ohne @user.groups.find ?\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "def show\n @group = Group.find(params[:id])\n @members = @group.member\n @project = @group.project\n @events = @group.event\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "def members\n set_group \n @members = User.joins(:groups).where(\"group_id = ? and acceptance_status = ?\", params[:id], true) if GroupsController.group_member? current_user.id, params[:id]\n end", "def get_group\n @group = Group.find(params[:id])\n end", "def show\n @group = Group.find(params[:id])\n\n @list_group_subgroups = @group.group_subgroups.paginate :page => params[:subgroups_page], :per_page => 10\n @list_group_members = @group.group_members.paginate :page => params[:members_page], :per_page => 10\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "def show\n @group = Group.find(params[:id])\n end", "def group_info\n group_id_param = params[:group_id]\n\n if group_id_param.nil? || group_id_param.blank?\n render json: { error: 'group_id not specified.' }, status: :bad_request\n return\n end\n\n group = CanvasSpaces.GroupCategory\n .groups\n .where('groups.id = ?', group_id_param)\n .eager_load(:users)\n .first\n if group.nil?\n render json: { error: 'No such group found.' }, status: :not_found\n else\n maillist = get_maillist_for_space(group.id)\n render json: { id: group.id,\n name: group.name,\n description: group.description,\n maillist: maillist,\n leader_id: group.leader_id,\n created_at: group.created_at,\n join_type: display_join_type(group.join_level),\n size: group.users.count\n },\n status: :ok\n end\n end", "def users\n GroupMembers.new(:id => id).get.items\n end", "def show\n @group = Group.find(params[:id])\n return render 'index'\n end", "def GetGroup id\n\n APICall(path: \"groups/#{id}.json\")\n\n end", "def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end", "def show\n @group_user = GroupUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group_user }\n end\n end", "def show\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_group }\n end\n end", "def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end", "def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end", "def show\n if user_signed_in?\n @membership.touch #last_attended_at\n template= 'show'\n else\n @group = Group.publicly_searchable.find( params[:id] )\n template= 'public_show'\n end\n respond_to do |format|\n format.html { render template: \"groups/#{template}\" }\n format.json { render json: @group }\n end\n\n rescue ActiveRecord::RecordNotFound\n redirect_to user_signed_in? ? groups_url : new_user_session_url\n end", "def index\n authorize Group\n render :json => @group.group_memberships\n end", "def im_group_members_with_http_info(group_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: IMGroupsApi.im_group_members ...'\n end\n # verify the required parameter 'group_id' is set\n if @api_client.config.client_side_validation && group_id.nil?\n fail ArgumentError, \"Missing the required parameter 'group_id' when calling IMGroupsApi.im_group_members\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 300\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling IMGroupsApi.im_group_members, must be smaller than or equal to 300.'\n end\n\n # resource path\n local_var_path = '/im/groups/{groupId}/members'.sub('{' + 'groupId' + '}', group_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page_number'] = opts[:'page_number'] if !opts[:'page_number'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'GroupMemberList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IMGroupsApi#im_group_members\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @group }\n end\n end", "def show\n group = Group.find(params[:id])\n\n render json: group\n end", "def test_get_members_of_group_basic_success\n\n client = create_mock_client\n refute_nil client, \"Client object couldn't be created.\"\n\n stub_request(:get, mock_uri('Groups', '17', 'Members'))\n .to_return(status: 200, body: { 'Success' => true,\n 'Message' => \"Operation succeeded\",\n 'ApiId' => API_ID,\n 'Members' => [{ 'Id' => 15,\n 'Name' => 'someone',\n 'Number' => '91XXXXXXXXXX' },\n { 'Id' => 29,\n 'Name' => 'anybody',\n 'Number' => '91XXXXXXYYYY' }] }.to_json)\n\n status, member_list = client.group.get_members_of_group(17)\n refute_nil status, \"No status object returned.\"\n assert status.success, \"Status did not indicate success: \" + status.message.to_s\n refute_nil member_list, \"No member list returned.\"\n assert_equal 2, member_list.length, \"Member list length is not correct.\"\n assert_equal 15, member_list[0].id, \"Member 1 ID is not correct.\"\n assert_equal 'someone', member_list[0].name, \"Member 1 name is not correct.\"\n assert_equal '91XXXXXXXXXX', member_list[0].number, \"Member 1 number is not correct.\"\n assert_equal 29, member_list[1].id, \"Member 2 ID is not correct.\"\n assert_equal 'anybody', member_list[1].name, \"Member 2 name is not correct.\"\n assert_equal '91XXXXXXYYYY', member_list[1].number, \"Member 2 number is not correct.\"\n\n end", "def in_group group_id, options={}, headers={}\n @connection.get \"users/in_group/#{group_id}.json\", options, headers\n end", "def show\n\t\t@group = Hostgroup.find params[:id]\n\t\t@members = Host.find_all_by_hostgroup_id params[:id]\n\tend", "def show_group(id)\n BrickFTP::API::Group.find(id)\n end", "def show_group(id)\n BrickFTP::API::Group.find(id)\n end", "def show\n @group = Group.includes(:users).find(params[:id])\n @group_member = GroupMember.new\n @group_member.group = @group\n\n if params[:from_reading_list]\n @reading_list = ReadingList.find(params[:from_reading_list])\n else\n @reading_list = nil\n end\n\n respond_to do |format|\n if @group.owner == current_user\n format.html\n format.json { render json: @group }\n else\n msg = \"You are not authorized to access group #{params[:id]}.\"\n format.html { redirect_to groups_url, alert: msg }\n format.json { render json: msg }\n end\n end\n end", "def set_group_member\n @groupmember = GroupMember.find(params[:id])\n end", "def show\n @group = Group.find(params[:id])\n @user = current_user\n end", "def view_members()\n a = []\n GroupMember.all.each {|r|\n if r.group_id == @group.id\n a.push(r.username)\n end\n }\n puts a\n end", "def get_group(group_id = 0)\n current_path = \"/api/v1/groups/#{group_id}\"\n @conn.get(current_path)\n end", "def show\n @group = Group.find(params[:id])\n @bc_title = t('bc.Group')\n @page_ancestors = [{:name=>t('bc.Groups'), :url=>groups_path}]\n @subscribed = current_user && GroupMember.find_by_user_id_and_group_id(@current_user.id, @group.id)\n end", "def show\n @group = Group.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n end", "def get_group_members_with_http_info(group_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GroupsApi.get_group_members ...\"\n end\n \n \n # verify the required parameter 'group_id' is set\n fail ArgumentError, \"Missing the required parameter 'group_id' when calling GroupsApi.get_group_members\" if group_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n if opts[:'sort_order'] && !['ascending', 'descending'].include?(opts[:'sort_order'])\n fail ArgumentError, 'invalid value for \"sort_order\", must be one of ascending, descending'\n end\n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/groups/{groupId}/members\".sub('{format}','json').sub('{' + 'groupId' + '}', group_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'pageSize'] = opts[:'page_size'] if opts[:'page_size']\n query_params[:'pageNumber'] = opts[:'page_number'] if opts[:'page_number']\n query_params[:'sortOrder'] = opts[:'sort_order'] if opts[:'sort_order']\n query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if opts[:'expand']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'UserEntityListing')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupsApi#get_group_members\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n # byebug \n @groups = current_user.groups\n @group_members=GroupMember.all\n # @group_members=@group.GroupMember.all\n end", "def team_members(id)\n get \"/teams/#{id}/members\"\n end", "def show\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n\n format.xml { render :xml => @subgroup }\n end\n end", "def show\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end", "def index\n render json: current_user.membered_groups\n end", "def show\n @group = Group.find(params[:id])\n @meetups = Meetup.where(\"group_id = ?\", @group.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n end\n end", "def get_group_by_id(id)\n get(\"/groups/#{id}\")\n end", "def index\n @groups = Group.paginate :page => (params[:page]||1), :order => 'name ASC', :per_page => 10\n \n @self_member_groups = Group.find(User.find(current_user).group_members.map(&:group_id)) \n @self_created_groups = User.find(current_user).groups\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end", "def getName\n\t\t@group = Group.find(params[:id])\n\t\t@group_members =[]\n\t\t@group.group_members.each do |member|\n\t\t\t@group_members.push(User.find(member.user_id));\n\t\tend\n\t \t@group_data = {name: @group.name , members: @group_members}\n\t\trender json: @group_data\n\tend", "def show\n @group_user_rel = GroupUserRel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group_user_rel }\n end\n end", "def index\n @groups = []\n for member in current_user.members\n @groups << member.group\n end\n end", "def group(group_id)\n get(\"/v1/groups/#{group_id}\")\n end", "def members *args\n page, per_page, options = TibbrResource.extract_params(args, 2)\n cache_lookup(MEMBERS, true, page, per_page) do\n TibbrResource.paginate_collection(get(:members, :params => {:include_group_members => options[:include_group_members], :page => page, :per_page => per_page}), User)\n end\n end", "def set_member_group\n @member_group = MemberGroup.find(params[:id])\n end", "def member_user\n if params[:group_id]\n @group = Group.find(params[:group_id])\n else\n @group = Group.find(by_id)\n end\n unless @group.has_member?(current_user)\n flash[:danger] = \"The page you requested is only available to members.\"\n redirect_to @group\n end\n end", "def show\n @group = Group.find(params[:id])\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render :json => @group}\n end\n end", "def show\n # byebug \n @group_members=@group.group_members\n # @group_members\n end", "def show_group\n group_name = params[:name]\n @group = $iam.groups[group_name]\n @users = @group.users\n @policies = @group.policies\n end", "def set_group_member\n @group_member = GroupMember.find_by(group_id:params[:id])\n end", "def show\n @group ||= Group.find_by_path(params[:id])\n end", "def set_group_member\n @group_member = GroupMember.find(params[:id])\n end", "def set_group_member\n @group_member = GroupMember.find(params[:id])\n end", "def show #:nodoc:\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n # format.xml { render :xml => @group }\n end\n end", "def index\n groupname = params[:groupname]\n @groups = Group.all\n @users = User.all\n end", "def show\n @group = @course.groups.find(params[:id])\n end", "def show\n @users = @group.users\n end", "def group_id\n get_info[:groupID]\n end", "def get_a_group_member_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: UsersAndGroupsApi.get_a_group_member ...'\n end\n # resource path\n local_var_path = '/v3/groups/GROUP_ID/members/MEMBER_ID'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n return_type = opts[:return_type] \n\n auth_names = opts[: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 => return_type)\n\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UsersAndGroupsApi#get_a_group_member\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n objid = params[:id]\n obj = ManagingGroup.find_by_id(objid)\n if obj\n render json: {managing_group: obj}, status: 200\n else\n render json: {}, status: 404\n end\n rescue => error\n render json: {}, status: 500\n end", "def show\n\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n format.html do\n redirect_to(\n :controller => :groups,\n :action => :show,\n :id => @user_group.group_id)\n end\n format.xml { render :xml => @user_group }\n end\n end", "def show\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "def show\n @group_members = Membership.where(group_id: @group.id).all\n @members_count = @group_members.count \n @is_member = @group_members.exists?(user_id: current_user.id)\n @is_admin = @group_members.exists?(user_id: current_user.id, admin: true)\n end", "def view_group(group)\n @uri = URI.parse(\"#{@api_url}/group/#{group}\")\n body = make_get_request\n @doc = Nokogiri::HTML(body)\n {\n title: get_title,\n description: get_description,\n name: get_name,\n regid: get_regid,\n contact: get_contact\n }\n end", "def show\n @group = GROUP.first_or_get!(params[:id])\n\n # restrict the groups to the groups of the current user\n # unless the current user is allowed to create groups\n # and need to see all\n unless allowed(:create)\n allowed_groups = current_user.groups\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "def show\n @group = Group.find_by_param(params[:id])\n @title = \"#{@group.name}'s Group\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n format.xml { render xml: @group }\n end\n end" ]
[ "0.806132", "0.80053055", "0.7968689", "0.7826638", "0.7737202", "0.7585207", "0.75556564", "0.744053", "0.744053", "0.7421064", "0.7407898", "0.7395968", "0.73943263", "0.7369341", "0.7352253", "0.7312699", "0.72662914", "0.72488093", "0.7220569", "0.72099614", "0.7141162", "0.70589095", "0.705307", "0.70346385", "0.7032601", "0.6987968", "0.6985716", "0.696829", "0.6961947", "0.69381744", "0.6924824", "0.69176096", "0.69068074", "0.6896144", "0.68745494", "0.6834029", "0.6830263", "0.68289053", "0.68259203", "0.6820247", "0.6779952", "0.67623335", "0.6756951", "0.6744836", "0.6740357", "0.6740357", "0.6736876", "0.6725135", "0.6723841", "0.672303", "0.67223054", "0.6714486", "0.6708854", "0.6706388", "0.6704221", "0.6704221", "0.6692025", "0.66916984", "0.66838783", "0.6679332", "0.6676132", "0.6665661", "0.666396", "0.66631776", "0.66598177", "0.6648411", "0.66409683", "0.66278607", "0.66184133", "0.659476", "0.6594211", "0.6592889", "0.6588755", "0.6579022", "0.6578654", "0.6578285", "0.6566674", "0.65664303", "0.6563513", "0.65626895", "0.65602535", "0.65580815", "0.6556294", "0.65540266", "0.65517795", "0.65517795", "0.6550111", "0.65441656", "0.65438485", "0.65328175", "0.6528244", "0.652311", "0.6517548", "0.651556", "0.65147465", "0.65080726", "0.6505964", "0.6505297", "0.64977425", "0.64972126" ]
0.68238837
39
Use callbacks to share common setup or constraints between actions.
def set_group_member @group_member = GroupMember.find_by(group_id: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
Only allow a trusted parameter "white list" through.
def group_member_params params.require(:group_member).permit(:name, :group_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def expected_permitted_parameter_names; end", "def param_whitelist\n [:role, :title]\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def permitted_params\n []\n end", "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 filtered_parameters; end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n 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 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 [:rating, :review]\n end", "def valid_params?; 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_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 filter_parameters; end", "def filter_parameters; end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def check_params; true; end", "def valid_params_request?; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def list_params\n params.permit(:name)\n end", "def check_params\n true\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n 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 additional_permitted_params\n []\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end", "def allow_params_authentication!; 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 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 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 paramunold_params\n params.require(:paramunold).permit!\n end", "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end", "def quote_params\n params.permit!\n end", "def list_params\n params.permit(:list_name)\n end", "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def all_params; end", "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "def source_params\n params.require(:source).permit(all_allowed_params)\n end", "def user_params\n end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def params; end", "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end", "def permitted_params\n @wfd_edit_parameters\n end", "def user_params\r\n end", "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end", "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend", "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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def params_permit\n params.permit(:id)\n end", "def allowed_params\n params.require(:allowed).permit(:email)\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 filter_params\n params.permit(*resource_filter_permitted_params)\n end", "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end", "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "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 feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\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 argument_params\n params.require(:argument).permit(:name)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\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 sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def parameters\n nil\n end", "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end", "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end", "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\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 special_device_list_params\n params.require(:special_device_list).permit(:name)\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" ]
[ "0.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
Returns the basic auth credentials if available.
def auth @auth ||= Hash.new if !@auth[:username] && @headers['Authorization'] str = Base64.decode64 @headers['Authorization'].split[1] username, password = str.split(":", 2) @auth = {:username => username, :password => password}.merge @auth end @auth end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def basic_auth\n authenticate_or_request_with_http_basic do |username, password|\n username == Rails.application.credentials.basic[:username] && \n password == Rails.application.credentials.basic[:password]\n end\n end", "def auth_credentials\n auth = Rack::Auth::Basic::Request.new(request.env)\n auth.provided? && auth.basic? ? auth.credentials : [nil,nil]\n end", "def basic_auth\n {\n username: @username,\n password: @password\n }\n end", "def credentials\n @credentials ||= begin\n request = Rack::Auth::Basic::Request.new(env)\n request.provided? ? request.credentials : []\n end\n end", "def http_authorization_to_creds\n @auth ||= Rack::Auth::Basic::Request.new request.env\n return unless @auth.provided? && @auth.basic?\n\n @auth.credentials\n end", "def basic_auth\n \"#{username}:#{access_token}\"\n end", "def http_basic_authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == \"mustang\" && password == 'mustang' #\"must@ngs0undm3l0n\"\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == \"admin\" && password == \"123\"\n end\n end", "def require_http_basic_auth\n if APP_CONFIG['perform_authentication']\n authenticate_or_request_with_http_basic do |login, password|\n login==APP_CONFIG['username'] and password == APP_CONFIG['password']\n end\n end\n end", "def authenticate_with_http_basic\n nil\n end", "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n self.username == username && self.password == password\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n username == ENV['USERNAMEV'] && password == ENV['PASSWORDV'] \n end \n end", "def basicauth_enabled?\n true\n end", "def basic_auth(user=nil, password=nil)\n return @basic_auth unless user && password\n @basic_auth = [user, password]\n end", "def basic_auth(user=nil, password=nil)\n return @basic_auth unless user && password\n @basic_auth = [user, password]\n end", "def basic_auth(user=nil, password=nil)\n user and password and @basic_auth = [user, password] or @basic_auth\n end", "def basic_auth_string\n \"Basic \" + Base64.encode64(\"#{@admin_username}:#{@admin_password}\").rstrip\n end", "def authenticate\n authenticate_or_request_with_http_basic(\"algo\") do |username, password|\n username == \"dupa\" && password == \"dupa\"\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n self.username == username && self.password == password\n end\n end", "def basic_auth(username, password)\n @basic_auth = {:username => username, :password => password}\n end", "def basic_auth(username:, password:, realm: 'Instrumentation')\n authenticate_or_request_with_http_basic(realm) \\\n do |given_name, given_password|\n ActiveSupport::SecurityUtils.secure_compare(given_name, username) &\n ActiveSupport::SecurityUtils.secure_compare(\n given_password, password\n )\n end\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def basic_auth_token\n 'Basic ' + [\"#{username}:#{password}\"].pack('m').delete(\"\\r\\n\")\n end", "def auth\n {:basic_auth => {:username => id, :password => password}}\n end", "def authenticate\n env = Figaro.env\n\n head :unauthorized unless auth_configured?(env)\n\n authenticate_or_request_with_http_basic do |username, password|\n # This comparison uses & so that it doesn't short circuit and\n # uses `secure_compare` so that length information\n # isn't leaked.\n ActiveSupport::SecurityUtils.secure_compare(\n username, env.twilio_http_basic_auth_username\n ) & ActiveSupport::SecurityUtils.secure_compare(\n password, env.twilio_http_basic_auth_password\n )\n end\n end", "def basic_auth(username, password)\n @basic_auth = [username, password]\n end", "def get_auth_data \n auth_data = nil\n [\n 'REDIRECT_REDIRECT_X_HTTP_AUTHORIZATION',\n 'REDIRECT_X_HTTP_AUTHORIZATION',\n 'X-HTTP_AUTHORIZATION', \n 'HTTP_AUTHORIZATION'\n ].each do |key|\n if request.env.has_key?(key)\n auth_data = request.env[key].to_s.split\n break\n end\n end\n if auth_data && auth_data[0] == 'Basic' \n return Base64.decode64(auth_data[1]).split(':')[0..1] \n end \n end", "def authenticate\n authenticate_or_request_with_http_basic do |username, password|\n (user = User.find_by_name(username)) != nil \\\n && user.password == Digest::SHA1.hexdigest(password)\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic('Administration') do |username, password|\n username == 'igp' && password == 'ehkra!Q2w#e'\n end\n end", "def basic_auth(opts); end", "def authenticate_user_with_basic_auth!\n @username, @password = ActionController::HttpAuthentication::Basic::user_name_and_password(request)\n\n request_http_basic_authentication(ENV[\"REALM\"], \"An Authentication object was not found in the SecurityContext\") if @username.blank? || @password.blank?\n end", "def authenticate\n authenticate_or_request_with_http_basic(\"Fun!\") do |username, password|\n username == ENV[\"FUN_ADMIN_USER\"] && password == ENV[\"FUN_ADMIN_PASS\"]\n end\n end", "def check_basic_auth_request\n tracker.find_call(:target => nil, :method => :authenticate_or_request_with_http_basic).each do |result|\n if include_password_literal? result\n warn :result => result,\n :code => @include_password,\n :warning_type => \"Basic Auth\",\n :warning_code => :basic_auth_password,\n :message => \"Basic authentication password stored in source code\",\n :confidence => :high\n end\n end\n end", "def get_auth_data\n auth_key = @@http_auth_headers.find { |h| request.env.key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil]\n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end", "def authenticate\n authenticate_or_request_with_http_basic do |name, password|\n name == \"blogmaster\" && password == \"senha\"\n end\n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil] \n end", "def require_basic_auth_maybe\n if Rails.env.staging?\n authenticate_or_request_with_http_basic do |user, password|\n user == \"mamajamas\" && (password == \"mamab1rd\" || password == \"welcome\")\n end\n end\n end", "def get_auth_data\n auth_key = @@http_auth_headers.detect { |h| request.env.has_key?(h) }\n auth_data = request.env[auth_key].to_s.split unless auth_key.blank?\n return auth_data && auth_data[0] == 'Basic' ? Base64.decode64(auth_data[1]).split(':')[0..1] : [nil, nil]\n end", "def authenticate\n if defined?(APPWALL_USERNAME)\n authenticate_or_request_with_http_basic do |username, password|\n !(APPWALL_USERNAME.blank?) && username == APPWALL_USERNAME && \n Digest::MD5.hexdigest(password) == APPWALL_PASSWORD_HASH\n end\n end\n end", "def authenticate\n if defined?(APPWALL_USERNAME)\n authenticate_or_request_with_http_basic do |username, password|\n !(APPWALL_USERNAME.blank?) && username == APPWALL_USERNAME && \n Digest::MD5.hexdigest(password) == APPWALL_PASSWORD_HASH\n end\n end\n end", "def authenticate\n authenticate_or_request_with_http_basic do |user_name, password|\n # Change these to username and password required\n user_name == \"shitlister\" && password == \"letmein\"\n end\n end", "def authenticate\n authed = true\n if(resource.respond_to?(:authenticate, true))\n authed = false\n uname = nil\n password = nil\n if(request.env['HTTP_AUTHORIZATION'])\n auth = Rack::Auth::Basic::Request.new(request.env)\n if(auth.basic? && auth.credentials)\n uname = auth.credentials[0]\n password = auth.credentials[1]\n end\n end\n authed = resource.send(:authenticate, uname, password)\n end\n raise Unauthorized unless authed\n end", "def basic_auth(*args, &block); end", "def authenticate_on_production\n return if Rails.env.development? || Rails.env.test?\n authenticate_or_request_with_http_basic do |username, password|\n username == \"crowdscore\" && password == \"denver\"\n end\n end", "def credentials\n auth_hash['credentials']\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 login_using_basic_auth\n @request.env['HTTP_AUTHENTICATION'] = ActionController::HttpAuthentication::Basic.encode_credntials(\"\", \"\")\nend", "def auth\n \"Basic #{Base64.strict_encode64(\"#{config.uuid}:#{config.key}\")}\"\n end", "def http_authenticate\n if Rails.env.staging?\n authenticate_or_request_with_http_basic do |username, password|\n (username == Brevidy::Application::HTTP_AUTH_USERNAME && password == Brevidy::Application::HTTP_AUTH_PASSWORD) ||\n (username == Brevidy::Application::HTTP_AUTH_ZEN_USERNAME && password == Brevidy::Application::HTTP_AUTH_ZEN_PASSWORD)\n end\n end\n end", "def basic_credentials\n {\n 'x_login' => @x_login,\n 'x_tran_key' => @x_trans_key,\n 'x_delim_char' => @x_delim_char,\n 'x_test_request' => @x_test_request,\n 'x_response_format' => @x_response_format\n }\n end", "def get_auth_data\n user, pass = nil, nil\n # extract authorisation credentials \n if request.env.has_key? 'X-HTTP_AUTHORIZATION' \n # try to get it where mod_rewrite might have put it \n authdata = request.env['X-HTTP_AUTHORIZATION'].to_s.split \n elsif request.env.has_key? 'HTTP_AUTHORIZATION' \n # this is the regular location \n authdata = request.env['HTTP_AUTHORIZATION'].to_s.split \n end \n \n # at the moment we only support basic authentication \n if authdata && authdata[0] == 'Basic' \n user, pass = Base64.decode64(authdata[1]).split(':')[0..1] \n end \n return [user, pass] \n end", "def credentials\n return nil if username.nil? || password.nil?\n \"#{username}:#{password}\"\n end", "def login_from_basic_auth\nauthenticate_with_http_basic do |username, password|\nself.current_user = User.authenticate(username, password)\nend\nend", "def header_basic_auth(username=@username, password=@password)\n { \"Authorization\" => \"Basic #{Base64.encode64(username.to_s + \":\" + password.to_s).gsub(\"\\n\", \"\")}\" }\n end", "def authenticate\n authenticate_or_request_with_http_basic do |email, password| \n User.authenticated?(email, password, request.remote_ip)\n end\n end", "def basic_auth(u, p)\n @auth = {:username => u, :password => p}\n end", "def basic_auth_header(username,password)\n auth_str = username.to_s + \":\" + password.to_s\n auth_str = \"Basic \" + Rex::Text.encode_base64(auth_str)\n end", "def basic_auth!(user = :username, pass = :password)\n @authenticates = :basic_auth\n @credentials = [user, pass]\n end", "def admin_auth\n authenticate_or_request_with_http_basic do |username, password|\n username == \"ga\" && password == \"ga\"\n end\n end", "def credentials\n @credentials ||= Rugged::Credentials::UserPassword.new({\n :username => \"x-oauth-basic\",\n :password => ENV[\"GITHUB_TOKEN\"]\n })\n end", "def basic_auth(account, password)\n @header.merge!({ 'Authorization' => \"Basic #{[\"#{account}:#{password}\"].pack('m').delete(\"\\r\\n\")}\" })\n end", "def basic_authentication usr, pwd\n\t\t#str = Base64.encode64(\"#{usr}:#{pwd}\")\n\t\t#str = \"Basic #{str}\"\n \n\t\t#@request_headers[\"Authorization\"]= str\n @request_headers[\"Authorization\"]= 'Basic ' + [\"#{usr}:#{pwd}\"].pack('m').delete(\"\\r\\n\")\n\tend", "def basic_auth(user, password, domain = T.unsafe(nil)); end", "def initialize\n super('Basic')\n @cred = nil\n @auth = {}\n @force_auth = false\n end", "def basic_auth_header(user, password)\n b64 = Base64.encode64(\"#{user}:#{password}\").delete(\"\\r\\n\")\n \"Basic #{b64}\"\n end", "def http_basic_authorize!(realm, username, password)\n auth = Rack::Auth::Basic::Request.new(request.env)\n unless auth.provided? && auth.basic? && auth.credentials &&\n auth.credentials == [username, password]\n response['WWW-Authenticate'] = %(Basic realm=\"#{realm}\")\n request.halt(401)\n end\n end", "def http_basic_authorize!(realm, username, password)\n auth = Rack::Auth::Basic::Request.new(request.env)\n unless auth.provided? && auth.basic? && auth.credentials &&\n auth.credentials == [username, password]\n response['WWW-Authenticate'] = %(Basic realm=\"#{realm}\")\n throw(:halt, 401)\n end\n end", "def authenticate\n @shoonga = authenticate_or_request_with_http_basic do |username, password|\n username == \"4vght\" && password == \"we8vds\"\n end\nend", "def basic_auth(*args_or_proc)\n return @basic_auth unless args_or_proc\n @basic_auth = args_or_proc\n end", "def process_basic_auth(auth)\n case auth\n when String\n self.username, self.password = auth.split(':', 2)\n when Hash\n self.username = auth[:username]\n self.password = auth[:password]\n end\n end", "def credential\n authorizer.get_credentials('default')\n end", "def get_auth()\n\t\t\tfind_attributes(\"auth\").first\n\t\tend", "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n self.current_user = User.authenticate(login, password)\n end\n end", "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n self.current_user = User.authenticate(login, password)\n end\n end", "def set_basic_auth(config, options)\n if (login = options['login']) && (password = options['password'])\n \"#{login}:#{password}\"\n elsif (login = config.fetch('user.login') && (password = config.fetch('user.password')))\n \"#{login}:#{password}\"\n else\n nil\n end\n end", "def basic_auth(url, username, password, _include_data = true)\n # This block is to ensure that only urls are encoded if they need it.\n # This is to prevent already encoded urls being re-encoded, which can lead to % being replaced with %25.\n begin\n URI.parse(url)\n rescue URI::InvalidURIError\n url = Addressable::URI.escape(url)\n end\n\n begin\n auth_params = {}\n auth_params[:http_basic_authentication] = [username, password] unless username.nil? && password.nil?\n\n URI.open(url, auth_params) do |f|\n # FIXME: need to handle full range of 2xx success responses, in particular where the response is only partial\n if f.status[0] == '200'\n result = { content_type: f.content_type, filename: determine_filename(f) }\n result = cache f, result, url, username, password\n return result\n else\n fail DownloadException.new(\"Problem fetching data from remote site - response code #{thing.status[0]}, url: #{url}\")\n end\n end\n rescue OpenURI::HTTPError => error\n raise DownloadException.new(\"Problem fetching data from remote site - response code #{error.io.status[0]}, url:#{url}\")\n end\n end", "def fetch_credentials\n service = @application.services.find_service FILTER\n service['credentials']\n end", "def auth\n basic_auth(env) { |user, pass| yield(user, pass) }\n end", "def authenticate\n authenticate_or_request_with_http_basic do |name, password|\n if m=Member.find_by_name(name) \n if (m.authenticate(password) && m.role == \"administrator\")\n\t\t true\n\t\telse\n\t\t false\n\t\tend\n else\n false\n end\n end\n\tname=\"\"\n\tpassword=\"\"\n end", "def full_credentials\n basic_credentials.merge(\n 'x_method' => @x_method,\n 'x_version' => @x_version,\n 'x_duplicate_window' => @x_duplicate_window\n )\n end", "def authenticate_if_needed\n # Disable this extra authentication in test mode\n return true if Rails.env.test?\n if (is_hidden || is_staging) && !is_api_or_pdf\n authenticate_or_request_with_http_basic do |username, password|\n username == \"samvera\" && password == \"hyku\"\n end\n end\n end", "def authorization_header\n \"Basic #{Base64.encode64(\"#{@username}:#{@password}\").chomp!}\"\n end", "def authenticate_user\n if I18nEditor.configuration.authentication_user.present? and I18nEditor.configuration.authentication_password.present?\n authenticate_or_request_with_http_basic do |username, password|\n username == I18nEditor.configuration.authentication_user && password == I18nEditor.configuration.authentication_password\n end\n end\n end", "def require_http_auth\n if `hostname` =~ /soykaf|lanpartei/i \n if auth = APP_CONFIG['http_auth']\n authenticate_or_request_with_http_basic do |user_name, password|\n user_name == auth['name'] && password == auth['password']\n end \n end\n end\n end", "def basic_authenticate(req, url, param_string = \"\")\n params = parse_quoted_wwwauth(param_string)\n\n user, pass = username_and_password_for_realm(url, params[:realm])\n\n req.basic_auth user, pass\n end", "def login_from_basic_auth\n authenticate_with_http_basic do |login, password|\n self.current_user = User.authenticate(login, password)\n end\n end" ]
[ "0.8200519", "0.800249", "0.7944771", "0.76405627", "0.7587219", "0.75267756", "0.7490856", "0.7394724", "0.73705405", "0.73670924", "0.7299923", "0.7291651", "0.7265955", "0.7255012", "0.7255012", "0.7251365", "0.72361594", "0.72281146", "0.7191428", "0.71753514", "0.7160841", "0.7145626", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.714333", "0.71432465", "0.71037745", "0.7087716", "0.7076489", "0.7046305", "0.70241934", "0.7024107", "0.7023249", "0.69609994", "0.6952727", "0.69341654", "0.691554", "0.69057155", "0.69055355", "0.6874969", "0.6871244", "0.68557286", "0.6840307", "0.6840307", "0.6835118", "0.67963684", "0.6749333", "0.67192614", "0.6680752", "0.6671334", "0.6658007", "0.66361517", "0.6626349", "0.66111237", "0.6595319", "0.659382", "0.65828735", "0.6580494", "0.6572082", "0.6570121", "0.65699005", "0.6565265", "0.6563162", "0.65478307", "0.65403533", "0.65268993", "0.652602", "0.6520161", "0.6516982", "0.6514705", "0.6502444", "0.6481213", "0.64725804", "0.6464786", "0.6460426", "0.6448301", "0.6447055", "0.6447055", "0.6428084", "0.6411001", "0.64077896", "0.6402098", "0.63990164", "0.6396083", "0.6386671", "0.6373635", "0.6369291", "0.6369133", "0.6363763", "0.6353559" ]
0.0
-1
Assigns the cookie string.
def cookie= cookie_str @headers['Cookie'] = cookie_str if @use_cookies end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_cookie(name, value)\n @cookies[\"flexi_#{@id}_#{name}\"] = value\n return value\n end", "def set_cookie(name, value)\n test_cookies[name] = value\n end", "def set_cookie(name, value, attributes = {})\n cookie = Webmachine::Cookie.new(name, value, attributes).to_s\n case headers['Set-Cookie']\n when nil\n headers['Set-Cookie'] = [cookie]\n when Array\n headers['Set-Cookie'] << cookie\n end\n end", "def set_cookie(cookie=nil)\n self.headers[\"Cookie\"] = cookie\n end", "def cookie\n self[HttpClient::SET_COOKIE]\n end", "def set_cookie(src, dst)\n if str = src['set-cookie']\n cookies = []\n str.split(/,\\s*/).each{|token|\n if /^[^=]+;/o =~ token\n cookies[-1] << \", \" << token\n elsif /=/o =~ token\n cookies << token\n else\n cookies[-1] << \", \" << token\n end\n }\n dst.cookies.replace(cookies)\n end\n end", "def set_cookie(name, value, options = {})\n @_options_lookup[name] = options\n self[name] = value\n end", "def store_cookie variable_name\r\n command 'storeCookie', variable_name\r\n end", "def set_cookies(response)\n cookie_str = response.header['set-cookie']\n return if cookie_str.nil?\n\n fields = cookie_str.split(\"; \").inject({}) { |h, field|\n key, value = field.split(\"=\")\n h[key] = value\n\n h\n }\n\n # This is obviously not a generalized cookie implementation. Heh.\n fields.delete('path')\n @cookies = fields\n end", "def []=(name, value)\n if value.is_a?(Hash)\n value = value.collect {|key, val| \"#{key}=#{val.gsub('=', '^^')}\" }.join('|')\n end\n options = { :value => value }\n\n options[:path] = \"/\" unless options.has_key?(:path)\n super(name.to_s, options[:value])\n @controller.response.set_cookie(name, options)\n end", "def set_cookie options\n options ||= {}\n \n @header[\"Set-Cookie\"] = options.collect{|key,value|\"#{key}=#{value}\"}.join(\"; \")\n end", "def set_cookie name, value=nil, opts={}\n if Hash === value\n opts = value\n else\n opts[:value] = value\n end\n\n @response.set_cookie name, opts\n end", "def set_cookie(name, value, expires)\n (headers['Set-Cookie'] ||=[]) << (Merb::Const::SET_COOKIE % [\n name.to_s, \n ::Merb::Request.escape(value.to_s), \n # Cookie expiration time must be GMT. See RFC 2109\n expires.gmtime.strftime(Merb::Const::COOKIE_EXPIRATION_FORMAT)\n ])\n end", "def value=( cookie_octets )\n\t\t# self.log.debug \"Setting cookie value to: %p\" % [ cookie_octets ]\n\t\traise Strelka::CookieError,\n\t\t\t\"invalid cookie value; value must be composed of non-control us-ascii characters \" +\n\t\t\t\"other than SPACE, double-quote, comma, semi-colon, and backslash. \" +\n\t\t\t\"Use #base64_value= for storing arbitrary data.\" unless\n\t\t\tcookie_octets =~ /^#{COOKIE_VALUE}$/\n\n\t\t@value = cookie_octets\n\tend", "def cookie_value\n \"#{@name}=#{Scanner.quote(@value.to_s)}\"\n end", "def encode_to_cookie h, cookie\n cookie[@name] = encode h\n end", "def set_cookie(cookie_name, value, expires, encrypt=false)\n cookie_obj = (encrypt == true) ? cookies.encrypted : cookies\n cookie_obj[cookie_name.to_sym] = {\n value: value,\n expires: expires,\n domain: request.host,\n http_only: true,\n secure: !(Rails.env.development? || Rails.env.staging?),\n same_site: :strict\n }\n end", "def set_cookie(response)\n response.set_cookie(Webmetrics::Config.cookie_name, {\n :value => self.id,\n :path => \"/\",\n :expires => Time.now+Webmetrics::Config.cookie_expiration\n })\n end", "def cookie_named(name); end", "def set_cookie(key, value)\n ::Rack::Utils.set_cookie_header!(@_headers, key, value)\n end", "def set_cookie(key, value)\n ::Rack::Utils.set_cookie_header!(@_headers, key, value)\n end", "def set_cookie(response)\n\t\ttest_cookie = response.get_fields('set-cookie')\n\n\t\tif @cookie_array.include? test_cookie\n\t\t\t@cookies\n\t\telse\n\t\t\t@cookie_array << test_cookie\n \t\t\t@cookies = @cookie_array.join('; ')\n \t\tend\n\t\t#@cookies = response.get_fields('set-cookie')\n\tend", "def set_cookie(cookie_name, value, expires)\n cookies[cookie_name.to_sym] = {\n value: value,\n expires: expires,\n domain: GlobalConstant::Base.cookie_domain,\n http_only: true,\n secure: Rails.env.production?,\n same_site: :strict\n }\n end", "def set_cookie_value\n cookie_value = User.using_client_shard(client: @client).get_cookie_value(@user.id, @user.password, @browser_user_agent)\n success_with_data({cookie_value: cookie_value, user_token_sale_state: @user.get_token_sale_state_page_name})\n end", "def set_WithCookie(value)\n set_input(\"WithCookie\", value)\n end", "def set_cookie(cookie, uri = nil)\n cookie_jar.merge(cookie, uri)\n end", "def []= key, val\n return if confined?\n @response.set_cookie key, val\n end", "def set(resource)\n @cookies.signed[cookie_name] = {value: [resource.id, Time.now.to_i]}.merge(cookie_options)\n end", "def cookie\n { :value => Crypt.encrypt(cookie_value), :expires => 1.year.from_now }\n end", "def set_cookie(options) #:doc:\n options[\"path\"] = \"/\" unless options[\"path\"]\n cookie = CGI::Cookie.new(options)\n @controller.logger.info \"Cookie set: #{cookie}\" unless @controller.logger.nil?\n @controller.response.headers[\"cookie\"] << cookie\n end", "def cookie=(val)\n @xmlrpc.cookie = val\n end", "def set_uuid_cookie\n uuid = cookies[:uuid] || UUIDTools::UUID.random_create.to_s\n cookies[:uuid] = { value: uuid, expires: 5.years.from_now }\n end", "def send_cookie(name, value = nil)\n @context.add_cookie(name, value)\n end", "def set_cookie\n puts \"hello\"\n # puts @order.as_json\n puts \"-==-=-=-\"\n puts \"-==-=-=-\"\n puts cookies[:name] = current_admin.name\n puts \"-==-=-=-\"\n puts \"-==-=-=-\"\n end", "def manually_set_cookie(value, expire_in)\n expire_date = expire_in.from_now.gmtime.strftime('%a, %d %b %Y %H:%M:%S GMT')\n response['Set-Cookie'] =\n \"cookiePermissions=#{value}; Expires=#{expire_date}; Path=/; SameSite=Lax\"\n end", "def cookie\n # 'frontend=aaa'\n nil\n end", "def set_cookie(env, headers, cookie)\n Utils.set_cookie_header!(headers, @key, cookie)\n end", "def http_cookie=(content)\n logger.debug { content ? \"Setting Cookie: #{content}\" : 'Clearing Cookie' }\n http.cookie = content\n end", "def []=( name, value )\n\t\tvalue = Strelka::Cookie.new( name.to_s, value ) unless value.is_a?( Strelka::Cookie )\n\t\traise ArgumentError, \"cannot set a cookie named '%s' with a key of '%s'\" %\n\t\t\t[ value.name, name ] if value.name.to_s != name.to_s\n\n\t\tself << value\n\tend", "def create_cookie name_value_pair, options_string\r\n command 'createCookie', name_value_pair, options_string\r\n end", "def set_cookie!\n cookies[:user_session] = {\n :value => token,\n :secure => controller.request.ssl?,\n :httponly => true,\n :expires => self.expires_at\n }\n end", "def encode_set_cookie h, secure\n secure = @secure unless @secure.nil?\n expire = (Time.now + @expire).gmtime.rfc2822 if @expire\n # NOTE +encode h+ may return empty value, but it's still fine\n \"Set-Cookie: #{@name}=#{encode h}; Path=/; HttpOnly#{'; Secure' if secure}#{\"; Expires=#{expire}\" if expire}\\r\\n\"\n end", "def set_cookie\n self.current_user.remember\n cookies[:auth_token] = { \n :value => self.current_user.remember_token, \n :expires => self.current_user.remember_token_expires_at }\n end", "def set_cookie(name, value, path = '/', httponly = true, secure = true)\n \n cookie = WEBrick::Cookie.new(name, value)\n cookie.path = path\n cookie.httponly = httponly\n cookie.secure = secure\n \n # add cookie to response header\n @header['Set-Cookie'] = cookie.to_s\n end", "def set_cookie_name(name=nil)\n if name.class == String && !block_given?\n @j_del.java_method(:setCookieName, [Java::java.lang.String.java_class]).call(name)\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling set_cookie_name(name)\"\n end", "def cookie_jar=(cookie_jar); end", "def store(fortune_cookie_text)\n hash = msg(fortune_cookie_text)\n puts \"Stored cookie: #{fortune_cookie_text}\"\n puts \"Cookie ID: #{hash}\"\n return hash\n end", "def parse_set_cookie(all_cookies_string)\n cookies = Hash.new\n \n # if all_cookies_string.present?\n # single cookies are devided with comma\n all_cookies_string.split(',').each {\n # @type [String] cookie_string\n |single_cookie_string|\n # parts of single cookie are seperated by semicolon; first part is key and value of this cookie\n # @type [String]\n cookie_part_string = single_cookie_string.strip.split(';')[0]\n # remove whitespaces at beginning and end in place and split at '='\n # @type [Array]\n cookie_part = cookie_part_string.strip.split('=')\n # @type [String]\n key = cookie_part[0]\n # @type [String]\n value = cookie_part[1]\n\n # add cookie to Hash\n cookies[key] = value\n }\n \n cookies\n end", "def cookie_value; end", "def do_write!(cookie_name, spec)\n @controller.write_cookie! cookie_name, spec.merge(same_site: self.class.cookie_same_site)\n @controller.write_cookie! \"#{cookie_name}_legacy\", spec\n end", "def install_persistent_cookie(name, cookie)\n cookies[name] = {\n :value => cookie,\n :expires => 10.years.from_now\n }\n end", "def set_acting_user(email)\n `$.cookie('acting_user', #{email}, { path: '/' })`\n end", "def set_userid(id)\n response.set_cookie('userid', id)\n end", "def stash_cookie\n cookies[self.class.els_options['cookie']] = {\n :value => @els_identity.token_id,\n :domain => request.env[\"SERVER_NAME\"],\n :path => '/',\n :expires => Time.now + 24.hours\n }\n end", "def cookie_path=(_arg0); end", "def path=(path)\n\t\t# {{{\n\t\tunless path.class == String || path == nil\n\t\t\traise TypeError, \"The path of a cookie must be nil or a string\", caller\n\t\tend\n\t\t@path = path\n\t\t# }}}\n\tend", "def cookie_jar=(_arg0); end", "def cookie_jar=(_arg0); end", "def cookie_name\n super\n end", "def serialize_into_cookie(record); end", "def setCookies(cookies)\n @fields['cookies'] = cookies\n self\n end", "def setCookies(cookies)\n @fields['cookies'] = cookies\n self\n end", "def set_cookie(uri, sc)\n cookie = Cookie.new\n name, sc = sc.split '=', 2\n value, sc = sc.split ';', 2\n cookie.name, cookie.value = CGI::unescape(name), CGI::unescape(value)\n \n opts = {}\n sc && sc.split(';').each do |opt|\n opt, optval = opt.split '=', 2\n opts[opt.downcase] = (optval && CGI::unescape(optval)) || true\n end\n \n # restrict by domain-- not spec-compliant and possibly unsafe (allows \n # infinite levels of subdomains)\n if opts['domain'] && opts['domain'] != uri.host\n if opts['domain'].end_with?('.'+uri.host)\n cookie.domain = opts['domain']\n else\n return false\n end\n else\n cookie.domain = uri.host\n end\n \n if opts['path']\n cookie.path = opts['path']\n else\n # the resource path is the \"directory\" containing the request path\n ri = uri.path.rindex '/'\n cookie.path = ri ? uri.path[0..ri] : '/'\n end\n \n if opts['expires']\n begin\n cookie.expires = DateTime.parse opts['expires']\n rescue ArgumentError; end\n end\n \n cookie.secure = opts.has_key?('secure')\n \n @jar << cookie\n return true\n end", "def cookie_string\n cookies.collect { |name, val| \"#{name}=#{val}\" }.join(', ')\n end", "def set_cookie_name(opts)\n opts = check_params(opts,[:cookie_names])\n super(opts)\n end", "def hubssolib_set_secure_cookie_data(name, value)\n if (@hubssolib_have_written_cookie)\n raise \"HubSsoLib: Attmept to set cookie '#{name}' more than once\"\n end\n\n @hubssolib_have_written_cookie = true\n\n # Using cookies.delete *should* work but doesn't. Set the\n # cookie with nil data instead.\n\n data = value.nil? ? nil : HubSsoLib::Crypto.encode_object(value, request.remote_ip)\n\n # No expiry time; to aid security, use session cookies only.\n\n cookies[name] = {\n :value => data,\n :path => HUBSSOLIB_COOKIE_PATH,\n :secure => true\n }\n end", "def cookie(name, value = nil, duration = 15)\n if value\n response.set_cookie name, { \n :value => value,\n :expires => Time.now + (60 * duration),\n :path => \"/\",\n :httponly => true,\n :secure => production?\n }\n else\n request.cookies[name]\n end\n end", "def []=(name, options)\n if options.is_a?(Hash)\n options = options.inject({}) { |options, pair| options[pair.first.to_s] = pair.last; options }\n options[\"name\"] = name.to_s\n else\n options = { \"name\" => name.to_s, \"value\" => options }\n end\n\n set_cookie(options)\n end", "def set_cookies_for_user(resource)\n cookies[:c_user] = {value: resource.email, expires: 2.year.from_now}\n end", "def save_cookie(requested_lang)\n cookies[:lang] = {\n :value => requested_lang,\n :expires => 1.month.from_now,\n :path => root_path\n }\n end", "def set_cookie(email=nil, nav=false)\n if nav\n cookies[\"bunch__nav\"] = {\n value: \"open\", \n expires: 365.days.from_now\n }\n end\n end", "def get_cookie\n resp = @cookie\n if @atl_token != \"\"\n resp = resp + \"; atl.xsrf.token=#{@atl_token}\"\n end\n puts \"Using cookie: #{resp}\".yellow\n resp\n end", "def cookie_jar= cookie_jar\n @agent.cookie_jar = cookie_jar\n end", "def set_cooky\n @cooky = Cookie.find(params[:id])\n end", "def set_cooky\n @cooky = Cookie.find(params[:id])\n end", "def set_cooky\n @cooky = Cookie.find(params[:id])\n end", "def set_data_in_cookie(data)\n cookies[:merged_response] = {\n :value => data,\n :expires => 1.hour.from_now,\n \n }\n end", "def set_cookie(env, headers, cookie)\n request = Rack::Request.new(env)\n if request.cookies[@key] != cookie[:value] || cookie[:expires]\n Utils.set_cookie_header!(headers, @key, cookie)\n end\n end", "def save_cookie(cookie)\n dputs __method__.to_s\n File.open($CONF['cookie'], \"w\") do |fc|\n fc.write(cookie)\n end\nend", "def comment=(comment)\n\t\t# {{{\n\t\tunless comment.class == String || comment == nil\n\t\t\traise TypeError, \"The comment of a cookie must be a string or nil\", caller\n\t\tend\n\t\t@comment = comment\n\t\t# }}}\n\tend", "def add_cookie(key,value)\n $LOG.info \"adding cookie with key => #{key} and value => #{value}\"\n begin\n $driver.manage.add_cookie(:name => \"#{key}\", :value => \"#{value}\")\n rescue Exception => e\n $LOG.error \"Add Cookie can't be completed \"+e.message\n raise \"Add Cookie can't be completed \"+e.message\n end\n end", "def cookie_jar str, uri = URI('http://example')\n Mechanize::CookieJar.new.tap do |jar|\n jar.parse str, uri\n end\n end", "def set_login_cookie(crawler_name=nil, crawler_password=nil, ip=nil, date=nil)\n crawler_name ||= @crawler_name\n crawler_password ||= @crawler_password\n ip ||= \"127.0.0.1\"\n date ||= 2.days.from_now\n\n cookie_jar = ActionDispatch::Request.new(Rails.application.env_config.deep_dup).cookie_jar\n cookie_jar.signed[AdsenseCrawlerForPrivate.cookie_name] =\n AdsenseCrawlerForPrivate.cookie_str(crawler_name, crawler_password, date, ip)\n\n cookies[AdsenseCrawlerForPrivate.cookie_name] = cookie_jar[AdsenseCrawlerForPrivate.cookie_name]\n end", "def add_set_cookie *ck\n\t\t\tif ck.length > 0\n\t\t\t\th = (@headers[\"Set-cookie\"] ||= [])\n\t\t\t\tck.each {|c| h << c}\n\t\t\tend\n\t\tend", "def set_cookie(request_uri, set_cookie_value)\n request_uri = URI.parse(request_uri)\n \n CookieStore::Cookie.parse_cookies(request_uri, set_cookie_value) do |cookie|\n # reject as per RFC2965 Section 3.3.2\n return if !cookie.request_match?(request_uri) || !(cookie.domain =~ /.+\\..+/ || cookie.domain == 'localhost')\n \n # reject cookies over the max-bytes\n return if cookie.to_s.size > MAX_COOKIE_LENGTH\n \n add(cookie)\n end\n end", "def update(str_or_hash, defaults = {})\n case str_or_hash\n when String:\n # Get expires part of cookie and remove it from string\n matches = str_or_hash.match(/expires=([^;]+)/i)\n @expires = DateTime.parse(matches[1]) if matches\n str_or_hash.gsub!(/expires=([^;]+);/i, '')\n # Split up the string and get the cookies!\n str_or_hash.split(',').each { |cookie|\n cookie = trim(cookie)\n cookie_name = false\n cookie.split(';').each_with_index { |piece, i|\n piece = trim(piece)\n crumb_name, crumb_val = trim(piece.split('=',2))\n crumb_name.downcase! if i > 0\n\n if i == 0\n cookie_name = crumb_name.downcase\n self[cookie_name] = Cookie.new(crumb_val)\n self[cookie_name]['name'] = crumb_name\n elsif crumb_name == 'secure'\n self[cookie_name].secure = true\n else\n self[cookie_name][crumb_name] = crumb_val\n end\n }\n }\n when Hash:\n # TODO: This really needs to be better.\n begin; @expires = DateTime.parse(str_or_hash.delete(:expires)) if str_or_hash[:expires]; rescue; end\n merge!(str_or_hash)\n end\n\n end", "def add_cookies(response)\n return unless response.key?('set-cookie')\n response.get_fields('set-cookie').each do |cookie|\n (key, val) = cookie.split('; ')[0].split('=', 2)\n cookies[key] = val\n end\n end", "def new\n\t\tcookies[:sign_up] = { value: \"XJ-122\", expires: 1.hour.from_now }\n\t\tsuper\n\tend", "def cookie_name\n \"reviewer_session_#{study.accession}\".to_sym\n end", "def name_and_value\n @cookie.split(\";\").first\n end", "def set_cookies\n session_key = request.session_options[:id]\n\n if(!session_key.nil?)\n # Set the cookie the standard way (Set-Cookie)\n response.set_cookie(MOBILE_KEY, session_key)\n # Set the cookie the way the Android client expects it (set-cookie)\n headers[\"set-cookie\"] = headers[\"Set-Cookie\"]\n end\n end", "def store_session(response)\n attributes = { path: \"/\", value: @cookie.to_json }\n response.set_cookie(APP_NAME, attributes)\n end", "def retrieve_cookie(response, cookie_name)\n value = response.headers['set-cookie'].scan(/#{cookie_name}=[a-zA-Z0-9]+/).first\n value = value[cookie_name.length+1..-1] if value\n end", "def get_cookie(data)\n if data['set-cookie']\n t = []\n data['Set-Cookie'].split(\", \").map{|c|\n tmp = c.scan(/([a-zA-Z0-9_\\-\\.]*=[^;]*)/).flatten\n tmp.delete_if{|cc| cc.downcase.include?(\"path\")}\n tmp.delete_if{|cc| cc.downcase.include?(\"expires\")}\n tmp.delete_if{|cc| cc.downcase.include?(\"domain\")}\n t << tmp\n }\n if t.length == 1\n @cookie = @cookie + t.join(\"; \")\n else\n @cookie = t.join(\"; \")\n end\n end\n end", "def insert_unlogged_uid\n \"Set-Cookie: uid=#{@unlogged_info[0][1]}\"\n end", "def cookie_content\n @cookie_content ||= parse_cookie\n end", "def cookie_content\n @cookie_content ||= parse_cookie\n end", "def set_auth_tkt_cookie(options)\n # get signed cookie string\n tkt_hash = get_tkt_hash(options)\n\n cookie_data = { :value => tkt_hash }\n\n # set domain for cookie, if wanted\n cookie_data[:domain] = options[:domain] if options[:domain]\n\n # store data into cookie\n cookies[:auth_tkt] = cookie_data\n\n # return signed cookie\n return tkt_hash\n end", "def value=(value)\n\t\t# {{{\n\t\tif value.class.superclass == Integer || value.class == Float\n\t\t\tvalue = value.to_s\n\t\telsif value.class != String && value != nil\n\t\t\traise TypeError, \"The value of a cookie must be a string, integer, float or nil\", caller\n\t\tend\n\t\t@value = value\n\t\t# }}}\n\tend" ]
[ "0.70979655", "0.68490267", "0.6825364", "0.6768513", "0.673038", "0.67127407", "0.66908425", "0.6681502", "0.6642656", "0.6594423", "0.6581152", "0.6576023", "0.6573805", "0.65453744", "0.65151227", "0.6514807", "0.65130264", "0.6496046", "0.6489468", "0.648389", "0.648389", "0.6470989", "0.64477354", "0.6428018", "0.64255893", "0.64028937", "0.64012134", "0.63646334", "0.6345291", "0.6341141", "0.6314017", "0.62928057", "0.62255293", "0.62156963", "0.6207808", "0.6180804", "0.61800385", "0.6126799", "0.61143595", "0.6109834", "0.6106464", "0.610002", "0.60997033", "0.6090232", "0.60850954", "0.60783947", "0.60635865", "0.60283536", "0.601273", "0.6003048", "0.5997955", "0.5991233", "0.59850913", "0.5957437", "0.5916794", "0.5916548", "0.5899247", "0.5899247", "0.5898532", "0.5887332", "0.58845747", "0.58845747", "0.5850657", "0.58465827", "0.5844893", "0.58379984", "0.5831547", "0.5808002", "0.5796549", "0.5794293", "0.57870585", "0.57772183", "0.57764834", "0.57499534", "0.57499534", "0.57499534", "0.5737143", "0.5734256", "0.573191", "0.57220507", "0.5667873", "0.5661297", "0.5642632", "0.56323385", "0.5620398", "0.56191075", "0.56168175", "0.56123435", "0.5590599", "0.55837184", "0.5582776", "0.5580597", "0.55764484", "0.55688035", "0.55647886", "0.5556816", "0.5556816", "0.55477625", "0.5544837" ]
0.78433967
1
Assigns the http method.
def http_method= new_verb @http_method = new_verb.to_s.upcase end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_method(v)\n endpoint_info[:http_method] = v\n end", "def http_method(value = nil)\n if value\n @http_method = value\n else\n @http_method\n end\n end", "def http_method\n\t\t\t\treturn @http_method if defined?(@http_method)\n\n\t\t\t\tmethod_from_method =\n\t\t\t\t\tbegin\n\t\t\t\t\t\tparams['_method']\n\t\t\t\t\trescue ArgumentError => e\n\t\t\t\t\t\t## https://github.com/rack/rack/issues/337#issuecomment-48555831\n\t\t\t\t\t\traise unless e.message.include?('invalid %-encoding')\n\t\t\t\t\tend\n\n\t\t\t\t@http_method = (method_from_method || request_method).upcase.to_sym\n\t\t\tend", "def http_method\n @http_method ||= @options[:http_method] || :post\n end", "def http_method\n METHODS[self[:method]]\n end", "def method(method = nil)\n return @method unless method\n case method\n when :get, :post, :put, :delete\n @method = method\n else\n raise \"Unknown HTTP method :#{method}.\"\n end\n end", "def http_method(request)\n raise NotImplementedError\n end", "def http_method(request)\n raise NotImplementedError\n end", "def http_method\n @parser.http_method\n end", "def http_method\n @http_method.to_s.upcase\n end", "def request_type(http_method = nil)\n (http_method || @verb).to_s.upcase\n end", "def parse_http_methods!(req)\n if (method = req.params['_method'])\n if ['delete', 'put', 'patch'].include?(method.downcase)\n req.env['REQUEST_METHOD'] = method.upcase\n end\n end\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 http_method(value = nil, &block)\n __define__(:http_method, value, block)\n end", "def request_method\n @request_method || :get\n end", "def method\n @headers[\"REQUEST_METHOD\"].downcase.to_sym\n end", "def request_method; end", "def method\n @method ||= ( ( ( m = @request.request_method.downcase ) == 'post' and\n ( n = @request['_method'] ) ) ? n.downcase : m ).intern\n end", "def method\r\n@method ||= check_method(env[\"rack.methodoverride.original_method\"] || env['REQUEST_METHOD'])\r\nend", "def request_method(verb)\n Net::HTTP.const_get(verb.to_s.capitalize)\n end", "def method\n self.env['REQUEST_METHOD'].downcase.to_sym\n end", "def request_method_symbol; end", "def request_method\r\n@request_method ||= check_method(env[\"REQUEST_METHOD\"])\r\nend", "def default_method\n case @action.to_s\n when /create/\n :post\n when /update/\n :put\n when /destroy/\n :delete\n else# and when /(index|show|new|edit)/\n :get\n end\n end", "def http_verb(params)\n [:post, :put, :delete].detect { |method_name|\n params.key?(method_name)\n } || :get\n end", "def request_method(query)\n (options[:method] || DEFAULT_METHOD).to_sym\n end", "def method\n @method ||= options[:method]\n end", "def http_method(request)\n request.request_method\n end", "def http_method\n return if request_response_pairs.empty?\n request_response_pairs.first.first.request_method\n end", "def method\n options[:method] || :get\n end", "def method=(value)\n @method = value\n end", "def http(method, url, options = {}, &block)\n case method.to_s.downcase\n when *%w(get put head post delete options patch)\n send method, url, options, &block\n else\n raise \"Invalid method: #{method}\"\n end\n end", "def http_method\n raise \"Implement in child class\"\n end", "def method\n parse_request! if @method.nil?\n @method\n end", "def merge_http_methods!(methods)\n self.http_methods |= methods\n end", "def method\n env.fetch('REQUEST_METHOD')\n end", "def http_method\n return @discovery_document['httpMethod'] || 'GET'\n end", "def api_method\n @_api_method ||= \"#{method_from_class_name}.get\"\n end", "def method\n request.method\n end", "def request_method_symbol\r\nHTTP_METHOD_LOOKUP[request_method]\r\nend", "def request_method\n {:filter => :post,\n :sample => :get,\n :firehose => :get,\n :retweet => :get\n }.fetch(@path, :get)\n end", "def method_symbol\r\nHTTP_METHOD_LOOKUP[method]\r\nend", "def request_method\n @env['REQUEST_METHOD']\n end", "def request_method\n @env['REQUEST_METHOD']\n end", "def protocol\n m = @properties['METHOD']\n m ? m.upcase : m\n end", "def request_method\n @attributes[:request_method]\n end", "def non_get_methods\n [:post, :put, :delete]\n end", "def method\n controller.request.request_method\n end", "def request_method(env)\n env[REQUEST_METHOD]\n end", "def method(method = nil)\n return @method if method.nil?\n\n @method = method.to_s.capitalize\n end", "def allowed_method(method=nil)\n if method.class == Symbol && !block_given?\n @j_del.java_method(:allowedMethod, [Java::IoVertxCoreHttp::HttpMethod.java_class]).call(Java::IoVertxCoreHttp::HttpMethod.valueOf(method))\n return self\n end\n raise ArgumentError, \"Invalid arguments when calling allowed_method(method)\"\n end", "def method_tag\n method = options[:method]\n\n case method\n when /^get$/ # must be case-insensitive, but can't use downcase as might be nil\n options[:method] = 'get'\n ''\n when /^post$/, '', nil\n options[:method] = 'post'\n ''\n else\n options[:method] = 'post'\n Hidden.(value: method, name: '_method').to_s\n end\n end", "def request_method\n if post_tunnel_method_hack?\n params['_method'].upcase\n else\n @env['REQUEST_METHOD']\n end\n end", "def rack_method_override!(options, *methods)\n if methods.include?(options[:method])\n options[:request_headers] ||= {}\n options[:request_headers][\"X-Http-Method-Override\"] = options[:method]\n options[:method] = :post\n end\n end", "def update_request?(http_method = nil)\n http_method = http_method.downcase.to_sym if http_method.is_a?(String)\n %i[put post patch].include?(http_method || @verb)\n end", "def method(method_name)\n \n @_method = method_name.to_s\n \n end", "def get_action request_method\n case request_method\n when 'POST' then 'create'\n when 'GET' then 'read'\n when 'PUT' then 'update'\n when 'DELETE' then 'delete'\n end\n end", "def normalized_request_method\n method = @env[\"REQUEST_METHOD\"]\n method == 'HEAD' ? 'get' : method.downcase\n end", "def http_method\n :get\n end", "def http_methods\n reload if executed_requests['GET'].nil? || executed_requests['GET']['headers'].nil? || executed_requests['GET']['headers'].empty?\n (executed_requests['GET']['headers']['Allow'] || \"GET\").split(/,\\s*/)\n end", "def http=(_arg0); end", "def method(method)\n raise ArgumentError, \"Invalid form method \\\"#{method}\\\"\" unless %i[create update].include?(method)\n\n @form_method = method\n end", "def get_method\n request_object.method\n end", "def parse_action(env, action)\n action = (env['HTTP_X_HTTP_METHOD_OVERRIDE'] || action).strip.downcase\n case action\n when 'delete', 'get', 'head', 'post', 'put', 'patch', 'options'\n action.to_sym\n else\n raise HTTPException.new(501)\n end\n end", "def fallback_method=(fallback_method)\n validator = EnumAttributeValidator.new('String', [\"POST\", \"GET\"])\n unless validator.valid?(fallback_method)\n fail ArgumentError, \"invalid value for \\\"fallback_method\\\", must be one of #{validator.allowable_values}.\"\n end\n @fallback_method = fallback_method\n end", "def method_translator\n operations.each do | op |\n if op['method'].blank? && op['httpMethod']\n op['method']= op.delete('httpMethod')\n swagger[\"__notifications\"] << \"001: replace `httpMethod' with `method'\"\n end\n end\n end", "def halt_method(x = ['GET'])\n if !x.include?(request.request_method)\n halt 405\n end\n end", "def requested_method\n\t\t\t\t# respond to websocket special case\n\t\t\t\treturn :pre_connect if request.upgrade?\n\t\t\t\t# respond to save 'new' special case\n\t\t\t\treturn (self.class.has_method?(:save) ? :save : false) if (request.request_method =~ /POST|PUT|PATCH/i.freeze) && (params[:id].nil? || params[:id] == 'new'.freeze)\n\t\t\t\t# set DELETE method if simulated\n\t\t\t\trequest.request_method = 'DELETE'.freeze if params[:_method] && params[:_method].to_s.downcase == 'delete'.freeze\n\t\t\t\t# respond to special :id routing\n\t\t\t\tparams[:id].to_s.downcase.to_sym.tap { |met| return met if self.class.has_exposed_method?(met) } if params[:id]\n\t\t\t\t#review general cases\n\t\t\t\tcase request.request_method\n\t\t\t\twhen 'GET'.freeze, 'HEAD'.freeze\n\t\t\t\t\treturn (self.class.has_method?(:index) ? :index : false) unless params[:id]\n\t\t\t\t\treturn (self.class.has_method?(:show) ? :show : false)\n\t\t\t\twhen 'POST'.freeze, 'PUT'.freeze, 'PATCH'.freeze\n\t\t\t\t\treturn (self.class.has_method?(:update) ? :update : false)\n\t\t\t\twhen 'DELETE'.freeze\n\t\t\t\t\treturn (self.class.has_method?(:delete) ? :delete : false)\n\t\t\t\tend\n\t\t\t\tfalse\n\t\t\tend", "def method\n options.fetch(:method, nil)\n end", "def method\n @method\n end", "def method\n @method\n end", "def infer_method(action)\n case action\n when 'update' then :put\n when 'create' then :post\n else :get\n end\n end", "def check_method_param(req)\n params = URI.decode_www_form(req.body)\n method_params = params.find { |param| param.first = \"_method\" }\n if method_params\n req.instance_variable_set(:@request_method, method_params[1])\n #!!!!!!!!!!!!!!!!!!!!!!!!!!\n end\n end", "def route\n \"#{@http_verb.to_s.upcase} #{@url}\"\n end", "def http_methods(_path)\n []\n end", "def http; end", "def http_method_modifies_resource?\n ['PUT','POST','PATCH'].include?(method.to_s.upcase)\n end", "def http_methods(path, http_verb, data = '', content_type = 'application/json')\n uri = URI(path.to_s)\n headers = {\n 'Content-Type' => 'application/json'\n }\n case http_verb\n when :get\n http_method = Net::HTTP::Get.new(uri, headers)\n http = Net::HTTP.new(uri.host, uri.port)\n return http.request(http_method)\n # return Net::HTTP.get(uri)\n when :put\n http_method = Net::HTTP::Put.new(uri, headers)\n when :post\n http_method = Net::HTTP::Post.new(uri, headers)\n when :delete\n http_method = Net::HTTP::Delete.new(uri, headers)\n else\n # Throw / log exception\n end\n # Request with body for Post/Put verbs and return response\n http_method.body = data.to_json unless data.nil?\n http = Net::HTTP.new(uri.host, uri.port)\n http.request(http_method)\n end", "def verb\n [\"get\", \"post\"].include?(raw_verb) ? raw_verb : \"post\"\n end", "def create_method\n :http_put\n end", "def create_method\n :http_put\n end", "def people_form_method(person)\n\t\tif person.new_record?\n\t\t\t@method = \"post\"\n\t\telse\n\t\t\t@method = \"put\"\n\t\tend\n\t\t@method\n\tend", "def write_method=(val)\n @write_method = val if %w(:flock :normal).include(val)\n end", "def method=(method)\n\t\tadd_tlv(TLV_TYPE_METHOD, method, true)\n\tend", "def method=(method)\n\t\tadd_tlv(TLV_TYPE_METHOD, method, true)\n\tend", "def method\n @method\n end", "def method\n @attributes[:method]\n end", "def request_method(request)\n return request.request_method if request.request_method != 'POST'\n return request.params['_method'].upcase if request.params['_method']\n request.request_method\n end", "def method_base=(new_method_base)\n @method_base = Addressable::URI.parse(new_method_base)\n @uri_template = nil\n end", "def handlers\n HTTP_METHODS.map do |sym|\n [sym, send(sym)]\n end\n end", "def request(method, path, **kwargs)\n verbs = %w(put get post delete options head move copy patch)\n method = method.to_s.downcase\n raise HTTPBadRequest(\"Unsupported HTTP method #{method}\") unless verbs.include?(method)\n resp = self.class.send(method.to_sym, path, **kwargs)\n if method == 'head'\n handle_response resp, head_instead: true\n else\n handle_response resp\n end\n end", "def method\n @json['method']\n end", "def request_setup request_context\n http_method = case request_context[:method]\n when :get\n Net::HTTP::Get\n when :post\n Net::HTTP::Post\n when :put\n Net::HTTP::Put\n when :delete\n Net::HTTP::Delete\n else\n raise \"Only :get, :post and :delete http method types are allowed.\"\n end\n headers = request_context[:headers] || {}\n setup = http_method.new request_context[:uri].request_uri\n setup.initialize_http_header headers\n setup.basic_auth(request_context[:uri].user, request_context[:uri].password) if request_context[:uri].user && request_context[:uri].password\n setup\n end", "def toggleRequestMethod(request)\n pp [:got_toggleRequestMethod, request] if $DEBUG\n request = request.request if request.kind_of? Java::Burp::IHttpRequestResponse\n request = request.to_java_bytes if request.respond_to? :to_java_bytes\n String.from_java_bytes(__toggleRequestMethod(request))\n end", "def parse_method\n params[:method].gsub!('-', '?') if params[:method].present?\n end", "def parse_method\n params[:method].gsub!('-', '?') if params[:method].present?\n end", "def parse_method\n params[:method].gsub!('-', '?') if params[:method].present?\n end", "def form_method\n\t\t\t\tspecial_method = Webrat::XML.css_search(@element, 'input[name=\"_method\"]').first\n\t\t\t\tunless special_method.nil?\n\t\t\t\t\tspecial_method['value']\n\t\t\t\telse\n\t\t\t\t\tWebrat::XML.attribute(@element, \"method\").blank? ? :get : Webrat::XML.attribute(@element, \"method\").downcase\n\t\t\t\tend\n\t\t\tend", "def build_request(method); end" ]
[ "0.8014927", "0.7979425", "0.78619057", "0.78400034", "0.7651818", "0.7536041", "0.7244738", "0.7244738", "0.72335696", "0.7164667", "0.6886686", "0.6886241", "0.6867984", "0.6851551", "0.6840861", "0.68332154", "0.68193287", "0.68173474", "0.67559063", "0.6743401", "0.67297715", "0.66674155", "0.65759057", "0.65632915", "0.6562986", "0.6559615", "0.65495807", "0.6535978", "0.6521503", "0.65084517", "0.64716303", "0.6456049", "0.6436782", "0.641409", "0.6385316", "0.63726735", "0.6341513", "0.62722856", "0.62565064", "0.6250331", "0.6237721", "0.6226355", "0.6208485", "0.6208485", "0.6133014", "0.6099355", "0.6091843", "0.6089594", "0.6077295", "0.6064157", "0.6063719", "0.60570526", "0.6048363", "0.6044872", "0.6037567", "0.60302585", "0.60251576", "0.5995984", "0.5993806", "0.5981983", "0.59780985", "0.59720474", "0.5957653", "0.5914666", "0.5890574", "0.5889604", "0.58891034", "0.5866564", "0.58551663", "0.58478004", "0.58478004", "0.58205396", "0.58173347", "0.5801127", "0.5800334", "0.57997525", "0.5777824", "0.57742536", "0.5768323", "0.57564664", "0.57564664", "0.57319283", "0.5711068", "0.571031", "0.571031", "0.5695205", "0.5676362", "0.5672313", "0.56564933", "0.5652786", "0.5642375", "0.56415397", "0.5639149", "0.56248784", "0.56228775", "0.56228775", "0.56228775", "0.5621298", "0.5619916" ]
0.80735403
1
Returns the HTTP request object.
def http_request req = VanillaRequest.new @http_method, @uri.request_uri, @headers req.basic_auth @auth[:username], @auth[:password] if @auth && @auth[:username] req end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def http_request\n @http_request ||= begin\n request = request_for_verb\n add_post_data(request)\n add_bearer_token(request)\n add_headers(request)\n request\n end\n end", "def request\n @request ||= Request.new(::Minfraud::HTTPService.configuration)\n end", "def get_request\n # Use our @http_object object's request method to call the\n # Net::HTTP::Get class and return the resulting response object\n @http_object.request(Net::HTTP::Get.new(@url.request_uri))\n end", "def request # :doc:\n @request ||= begin\n environment = Rails.application.env_config.merge(env) if defined?(Rails.application) && Rails.application\n ActionDispatch::Request.new(environment || env)\n end\n end", "def request\n @request ||= ::Lotus::Action::Request.new(@_env)\n end", "def http_request\n req = VanillaRequest.new @http_method, @uri.request_uri, @headers\n\n if @oauth\n req['Authorization'] =\n SimpleOAuth::Header.new(@http_method, @uri, {}, self.oauth).to_s\n elsif @auth && @auth[:username]\n req.basic_auth @auth[:username], @auth[:password]\n end\n\n # Stream Multipart\n if Kronk::Multipart === @body\n req.body_stream = @body.to_io\n\n # Stream IO\n elsif @body.respond_to?(:read)\n req.body_stream = @body\n\n else\n req.body = @body\n end\n\n b = req.body || req.body_stream\n\n if b.respond_to?(:bytesize)\n req['Content-Length'] = b.bytesize.to_s\n elsif b.respond_to?(:size) && b.size\n req['Content-Length'] = b.size.to_s\n elsif b.nil?\n req['Content-Length'] = \"0\"\n end\n\n req['Transfer-Encoding'] = 'chunked' if !req['Content-Length']\n\n req\n end", "def request\n @request ||= Rack::Request.new(@env)\n end", "def request\n @request ||= Rack::Request.new(@env)\n end", "def request\n @request ||= Rack::Request.new(env)\n end", "def request_object\n $REQUEST\n end", "def request\n @_request\n end", "def make_request_object( opts={} )\n\t\tdata = make_request( opts )\n\t\treturn Mongrel2::Request.parse( data )\n\tend", "def request; return @request end", "def request\n @request ||= HTTPI::Request.new\n @request.url = document\n @request\n end", "def get_request\n# Use our @http_object object's request method to call the\n# Net::HTTP::Get class and return the resulting response object\n @http_object.request(Net::HTTP::Get.new(@url.request_uri))\n end", "def request\n @req\n end", "def request\n @@request\n end", "def request\n @request ||= Request.find request_id\n end", "def request\n @request\n end", "def request\n WebRequest.create(build_request_url)\n end", "def create_new_http_request\n # Create a new HTTP request instance\n request_spec = @data[:request][:instance]\n http_class = \"Net::HTTP::#{request_spec.verb._camelize}\"\n http_request = http_class._constantize::new(request_spec.path)\n # Set the request body\n if request_spec.is_io?\n http_request.body_stream = request_spec.body\n else\n http_request.body = request_spec.body\n end\n # Copy headers\n request_spec.headers.each { |header, value| http_request[header] = value }\n # Save the new request\n request_spec.raw = http_request\n # Set user-agent\n if @data[:options].has_key?(:connection_user_agent)\n http_request['user-agent'] ||= @data[:options][:connection_user_agent]\n end\n http_request\n end", "def generate_request(request)\n\n\t\t\trequest_uri = request[:uri].request_uri\n\n\t\t\tcase request[:method]\n\t\t\twhen :get\n\t\t\t\treq = Net::HTTP::Get.new request_uri\n\t\t\twhen :post\n\t\t\t\treq = Net::HTTP::Post.new request_uri, {'Content-Type' => \"application/json\"}\n\t\t\t\treq.body = request[:body]\n\t\t\t\treq\n\t\t\twhen :put\n\t\t\t\treq = Net::HTTP::Put.new request_uri, {'Content-Type' => \"application/json\"}\n\t\t\t\treq.body = request[:body]\n\t\t\t\treq\n\t\t\twhen :patch\n\t\t\t\treq = Net::HTTP::Patch.new request_uri, {'Content-Type' => \"application/json\"}\n\t\t\t\treq.body = request[:body]\n\t\t\t\treq\n\t\t\twhen :delete\n\t\t\t\treq = Net::HTTP::Delete.new request_uri\n\t\t\tend\n\t\tend", "def build_net_http_request request\n\n # Net::HTTP adds a content-type header automatically unless its set\n # and this messes with request signature signing. Also, it expects\n # all header values to be strings (it call strip on them).\n headers = { 'content-type' => '' }\n request.headers.each_pair do |key,value|\n headers[key] = value.to_s\n end\n\n request_class = case request.http_method\n when 'GET' then Net::HTTP::Get\n when 'PUT' then Net::HTTP::Put\n when 'POST' then Net::HTTP::Post\n when 'HEAD' then Net::HTTP::Head\n when 'DELETE' then Net::HTTP::Delete\n else raise \"unsupported http method: #{request.http_method}\"\n end\n\n net_http_req = request_class.new(request.uri, headers)\n net_http_req.body = request.body\n net_http_req\n\n end", "def make_request\n response = @http.request(@request)\n end", "def req\n return @req\n end", "def request\n OpenStruct.new\n end", "def request\n @@request\n end", "def request\n response.request\n end", "def request\n EventMachine::HttpRequest.new(url)\n end", "def request\n @_context[:request]\n end", "def request\n double(ActionDispatch::Request, { path: \"/\" })\n end", "def request\n @request.full\n end", "def request # :nodoc:\n @request ||= PayPal::ExpressCheckout::Request.new\n end", "def request\n req = connection\n \n req.body = with if (with && req.request_body_permitted?)\n if (credentials)\n if (credentials.is_a?(OAuth::AccessToken))\n credentials.sign!(req)\n else\n req.basic_auth(credentials[:username], credentials[:password])\n end\n end\n \n headers.each_pair {|key,value| req[key] = value } if headers\n \n req\n end", "def build_request(uri)\n Net::HTTP::Get.new(uri)\n end", "def get()\n return @http.request(@req)\n end", "def setup_request\n return Typhoeus::Request.new(\n endpoint_url,\n method: @method,\n params: @params,\n body: @body,\n headers: @headers)\n end", "def get_request_obj(request_uri)\n\n req_obj = @request_class.new(request_uri)\n\n # Forward cookies\n req_obj['Cookie'] = @cookies.map { |k, v| \"#{k}=#{CGI.escape v.to_s}\" }.join('; ') if @cookies.present?\n\n # Forward headers\n @headers.each do |h, v|\n req_obj[h] = v\n end if @headers.present?\n\n # Attach basic auth\n if GlobalConstant::CompanyApi.basic_auth_user.present?\n req_obj.basic_auth(GlobalConstant::CompanyApi.basic_auth_user, GlobalConstant::CompanyApi.basic_auth_pass)\n end\n\n req_obj\n\n end", "def request\n @request ||= Rack::MockRequest.new(mack_app)\n end", "def make_json_request_object( opts={} )\n\t\tdata = make_json_request( opts )\n\t\treturn Mongrel2::Request.parse( data )\n\tend", "def build_request\n uri = @config[:endpoint]\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n http.start\n request = build_request_stream(uri)\n return http, request\n end", "def request\n @rest_response.request\n end", "def request\n @controller.request\n end", "def request\n @controller.request\n end", "def request\n @controller.request\n end", "def init_request(opts)\n raise ArgumentError, \":uri is for backwards compatibilty and conflicts with :request\" \\\n if opts[:request] && opts[:uri]\n\n # For backwards compatibilty\n if opts[:uri]\n HTTP::Request.new(:uri => opts[:uri], :verb => :get)\n else\n opts.fetch(:request)\n end\n end", "def request(&_)\n if block_given?\n @request ||= Request.new\n yield @request\n end\n @request\n end", "def request(*args)\n Request.new(self).request(*args)\n end", "def connection\n HTTPVerb.new(via).request_class.new(uri.request_uri)\n end", "def build_request\n client.request request_name\n end", "def request\n SharedStorage.get(:request)\n end", "def webRequest (url)\n\tif url =~ /(https)/\n\t\treturn httpsRequest(url)\n\telse\n\t\treturn httpRequest(url)\n\tend\nend", "def make_generic_request(request)\n request_path = path(request)\n\n Puppet::Network::HTTP::Request.new(\n headers(request),\n params(request),\n http_method(request),\n request_path, # path\n request_path, # routing_path\n client_cert(request),\n body(request)\n )\n end", "def get_request(url)\n\n request = Net::HTTP::Get.new(url)\n request['content-type'] = 'application/x-www-form-urlencoded'\n request['accept'] = '*/*'\n return request\nend", "def request(*args)\n Moonrope::Request.new(self, *args)\n end", "def request\n @request ||= ActionDispatch::TestRequest.create.tap do |request|\n request.request_id = SecureRandom.uuid\n end\n end", "def request_for(method, options = {})\n request = {}\n if options[:params]\n case method\n when :post, :put\n request[:body] = options[:params]\n else\n request[:query] = options[:params]\n end\n end\n request\n end", "def get_request(path, params={}, options={})\n request(:get, path, params, options)\n end", "def request\n nil\n end", "def request(options = nil, &block)\n if options.nil? && !block\n Request\n else\n Request.with(options, &block)\n end\n end", "def make_xml_request_object( opts={} )\n\t\tdata = make_xml_request( opts )\n\t\treturn Mongrel2::Request.parse( data )\n\tend", "def make_request(http, request)\n response = http.request(request)\n Response.new(response)\n end", "def create_request(method, uri, data = nil)\r\n method = method.upcase\r\n if(method == 'GET')\r\n return Net::HTTP::Get.new(uri)\r\n elsif(method == 'POST')\r\n request = Net::HTTP::Post.new(uri)\r\n request.body = data.to_json\r\n return request\r\n elsif(method == 'PUT')\r\n request = Net::HTTP::Put.new(uri)\r\n request.body = data.to_json\r\n return request\r\n elsif(method == 'DELETE')\r\n return Net::HTTP::Delete.new(uri)\r\n else\r\n raise CLXException, 'Unknown HTTP method'\r\n end\r\n end", "def create_request(method, path, body = {})\n KintoRequest.new self, method, path, body\n end", "def make_request url, method: ::Rack::GET, body: nil, headers: []\n env = Testing.build_standard_env URI(url), headers\n env[::Rack::REQUEST_METHOD] = method\n env[::Rack::RACK_INPUT] = ::StringIO.new body if body\n ::Rack::Request.new env\n end", "def make_request(req)\n if @http && @http.address == req.uri.host && !@http.started?\n @http.start\n else\n @http = Net::HTTP.new(req.uri.host, req.uri.port)\n @http.use_ssl = req.ssl?\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE if req.ssl?\n @http.set_debug_output($stderr) if req.debug\n @http.start\n end\n @http.request(req.http_request)\n end", "def build_request(req, http_method, path, opts = {})\n opts[:query_params].each_key do |key|\n if opts[:query_params][key].kind_of?(Array)\n opts[:query_params][key] = opts[:query_params][key].join[\",\"]\n end\n end\n if @config.http_request_timeout > 0\n req.options.timeout = @config.http_request_timeout\n end\n req.url path.sub(/^\\/+/, '')\n req.headers = opts[:header_params]\n req.params = opts[:query_params]\n req.body = build_request_body(req.headers, opts[:body], opts[:files])\n set_headers(req.headers)\n if @config.debugging\n @config.logger.debug \"HTTP request\\nMethod: #{req.method}\\nPath: #{req.path}\\nParams: #{req.params}\\nHeaders: #{req.headers}\\nBody: #{req.body}\\n\"\n end\n end", "def create_http_request(http_method,path,*arguments)\n http_method=http_method.to_sym\n if [:post,:put].include?(http_method)\n data=arguments.shift\n end\n headers=(arguments.first.is_a?(Hash) ? arguments.shift : {})\n case http_method\n when :post\n request=Net::HTTP::Post.new(path,headers)\n request[\"Content-Length\"]=0 # Default to 0\n when :put\n request=Net::HTTP::Put.new(path,headers)\n request[\"Content-Length\"]=0 # Default to 0\n when :get\n request=Net::HTTP::Get.new(path,headers)\n when :delete\n request=Net::HTTP::Delete.new(path,headers)\n when :head\n request=Net::HTTP::Head.new(path,headers)\n else\n raise ArgumentError, \"Don't know how to handle http_method: :#{http_method.to_s}\"\n end\n if data.is_a?(Hash)\n request.set_form_data(data)\n elsif data\n request.body=data.to_s\n request[\"Content-Length\"]=request.body.length\n end\n request\n end", "def http\n @http ||= create_http\n end", "def http\n @http ||= create_http\n end", "def request\n socket.request\n end", "def request(req)\n req = Request.new(req) if req.kind_of?(Hash)\n action = if req.kind_of?(Request) then req.action else '(string)' end\n debug(\"#{action}: #{req.inspect}\")\n begin\n res = get_response(req)\n info(\"#{action}: #{res.inspect}\")\n rescue Error::Casual => ex\n info(\"#{action}: (ignored) #{ex.message}\")\n raise if verbose\n res = ex.response\n rescue Error::Fatal => ex\n error(\"#{action}: #{ex.message}\")\n raise\n rescue Errno::ECONNREFUSED => ex\n error(\"#{ex.message} / #{self['host'].inspect}:#{self['port'].inspect}\")\n raise\n end\n return res\n end", "def request\n @source.request\n end", "def do_request()\n uri = URI.parse(API_BASE_URL + build_request_path())\n response = Net::HTTP.get_response(uri)\n response.body\n end", "def request\n stream.request\n end", "def request(method, path, params)\n full_path = format_request_uri(path, params)\n request = VERB_MAP[method.to_sym].new(full_path)\n # TODO - Enable when supporting other HTTP Verbs\n # request.set_form_data(params) unless method == :get\n\n @logger.debug \"#{method.to_s.upcase} #{path}\"\n @http.request(request)\n end", "def get method, params={}\n Request.new(self, :get, method, params)\n end", "def http_request(verb, uri, options = {})\n opts = {\n :form_data => resource[:http_post_form_data],\n :body => resource[:http_request_body],\n :headers => resource[:http_request_headers],\n :content_type => resource[:http_request_content_type],\n :http_user => resource[:http_user],\n :http_pass => resource[:http_pass],\n }.merge(options)\n\n case verb.to_sym\n when :head\n req = Net::HTTP::Head.new(uri.request_uri)\n when :get\n req = Net::HTTP::Get.new(uri.request_uri)\n when :post\n req = Net::HTTP::Post.new(uri.request_uri)\n end\n (opts[:headers] || {}).each do |header, value|\n req[header] = value\n end\n req.body = opts[:body]\n req.content_type = opts[:content_type] || ''\n if not opts[:http_user].nil? or not opts[:http_pass].nil?\n req.basic_auth opts[:http_user], opts[:http_pass]\n end\n req.set_form_data(opts[:form_data] || {}) if verb.to_sym == :post\n req\n end", "def request_content\n @request_content ||= begin\n uri = URI(http_request[:url])\n req = Net::HTTP::Post.new(uri.path, http_request[:headers])\n\n # Add task headers\n req[Cloudtasker::Config::TASK_ID_HEADER] = id\n req[Cloudtasker::Config::RETRY_HEADER] = retries\n\n # Set job payload\n req.body = http_request[:body]\n req\n end\n end", "def new\n @request = Request.new\n end", "def make_request(request, options)\n gather_headers(request, options)\n response = @http.request(request)\n Validators::ResponseValidator.validate!(response)\n JSON.parse(response.body)\n end", "def build_request\n\n uri = URI.parse(@endpoint)\n # add uri\n params = [uri.host, uri.port]\n # add proxy\n params += @proxy.values_at(:host, :port, :user, :pass) unless @proxy.empty?\n\n @http = Net::HTTP.new(*params)\n # add ssl\n if @endpoint.start_with?('https')\n @http.use_ssl = true\n @http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n end\n\n net_http = Kernel.const_get('Net::HTTP::' + @request_method[:method].capitalize)\n @request = add_request_headers(net_http.new(uri.request_uri))\n\n end", "def make_request(request = nil, meth: nil, manifest: nil, **opt)\n request, meth = [nil, request] if request.is_a?(Symbol)\n request ||= pre_flight(meth, manifest, **opt)\n # noinspection RubyMismatchedArgumentType\n SubmissionService.make_request(request, **opt, service: self)\n end", "def build_request(name, args)\n build_args(args) if args\n # build the request & http object\n build_http_request(name)\n # set the content type & request body\n update_content_type(name)\n make_request(@http, @request)\n end", "def http_method(request)\n request.request_method\n end", "def request(http_method, path, params = {})\n response = connection.send(http_method) do |request|\n case http_method\n when :get, :delete\n request.url(path, params)\n when :post, :put\n request.path = path\n request.body = params unless params.empty?\n end\n end\n\n response.body['response']\n end", "def request(*args)\n Request.request(self, *args)\n end", "def request\n self.http_response = http_client.get(url, request_options)\n self\n end", "def build_request(method, path, body, request_options)\n request = {}\n request[:method] = method.downcase\n request[:path] = build_uri_path(path, request_options.params)\n request[:body] = build_body(body, request_options, method)\n request[:headers] = generate_headers(request_options)\n request[:timeout] = request_options.timeout\n request[:connect_timeout] = request_options.connect_timeout\n request\n end", "def make_request\n\t\t\tresponse = nil\n\t\t\tif self.respond_to? :headers\n\t\t\t\turi = URI.parse(request_string)\n\n\t\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\thttp.set_debug_output $stderr if @test_request\n\t\t\t\thttp.use_ssl = true\n\t\t\t\thttp.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n\t\t\t\trequest = Net::HTTP::Get.new(uri.request_uri)\n\t\t\t\theaders.each do |k,v|\n\t\t\t\t\trequest[k] = v\n\t\t\t\tend\n\n\t\t\t\tresponse = http.request(request).body\n\t\t\telse\n\t\t\t\t$stderr.puts(request_string) if @test_request\n\n\t\t\t\tresponse = open(request_string)\n\t\t\tend\n\n\t\t\treturn process_response(response)\n\t\tend", "def post()\n return @http.request(@req)\n end", "def build_request()\n @http = Net::HTTP.new(@uri.host, @uri.port)\n @http.use_ssl = true\n @http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n end", "def request(*a)\n request = Request.new(*a)\n request.node = self\n request\n end", "def request\n @rpc.request\n end", "def request(url,via = :get, &block)\n req = Request.new(url,via)\n yield req if block_given?\n req\n end", "def request_method\n @request_method || :get\n end", "def request(type)\n request = case type\n when :wsdl then Net::HTTP::Get.new @endpoint.request_uri\n when :soap then Net::HTTP::Post.new @soap.endpoint.request_uri, soap_headers.merge(headers)\n end\n\n request.basic_auth(*@basic_auth) if @basic_auth\n yield request if block_given?\n request\n end", "def get_request(request_data = {}, errback = DEFAULT_ERROR, &blk)\n req = create_test_request(request_data).get(request_data)\n hookup_request_callbacks(req, errback, &blk)\n end", "def get_request(uri, token)\n http = build_http(uri)\n request = Net::HTTP::Get.new(uri.request_uri, initheader = build_headers(token))\n return http.request(request)\n end", "def set_request\n $request = request\n end" ]
[ "0.8031314", "0.7869221", "0.78348285", "0.776874", "0.7669509", "0.76209253", "0.7509783", "0.7509783", "0.7473546", "0.74571353", "0.7352305", "0.7310471", "0.7273246", "0.7270176", "0.7265952", "0.72211117", "0.71382", "0.71286505", "0.7107451", "0.7034394", "0.70122355", "0.69632965", "0.69325423", "0.69277436", "0.69201064", "0.6900767", "0.6867906", "0.6830698", "0.67861545", "0.6759241", "0.6736338", "0.6723289", "0.6718992", "0.67134315", "0.6682504", "0.66729456", "0.6669017", "0.66631705", "0.6639524", "0.6610234", "0.658203", "0.65734136", "0.6558197", "0.6558197", "0.6558197", "0.6555811", "0.6516411", "0.650435", "0.6489333", "0.64873314", "0.6476444", "0.64724326", "0.64560103", "0.6444166", "0.6419201", "0.6402447", "0.63898623", "0.6365909", "0.6340104", "0.63320035", "0.62791586", "0.62608755", "0.6242413", "0.6230946", "0.620596", "0.6202579", "0.62014955", "0.6199545", "0.61873716", "0.61873716", "0.6186809", "0.6185743", "0.6184007", "0.617866", "0.6177558", "0.6166657", "0.61645144", "0.6162322", "0.6152624", "0.6147488", "0.6125303", "0.6117823", "0.61142695", "0.61100703", "0.6098357", "0.6090328", "0.608187", "0.60785", "0.60705304", "0.6068366", "0.6045374", "0.60227704", "0.60201764", "0.60053897", "0.6002639", "0.59812814", "0.59792495", "0.59776556", "0.5975722", "0.5968258" ]
0.7142474
16
Assign the use of a proxy. The proxy_opts arg can be a uri String or a Hash with the :address key and optional :username and :password keys.
def http_proxy addr, opts={} return Net::HTTP unless addr host, port = addr.split ":" port ||= opts[:port] || 8080 user = opts[:username] pass = opts[:password] Kronk::Cmd.verbose "Using proxy #{addr}\n" if host Net::HTTP::Proxy host, port, user, pass end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_proxy(opts)\n opts = check_params(opts,[:proxy_info])\n super(opts)\n end", "def proxy(url, opts={})\n @proxies[url] = opts\n end", "def set_proxy address, port, user = nil, password = nil\n @proxy_addr = address\n @proxy_port = port\n @proxy_user = user\n @proxy_pass = password\n\n @agent.set_proxy address, port, user, password\n end", "def configure_proxy(options, env)\n proxy = request_options(env)[:proxy]\n return unless proxy\n\n options[:proxy] = {\n host: proxy[:uri].host,\n port: proxy[:uri].port,\n authorization: [proxy[:user], proxy[:password]]\n }\n end", "def set_proxy proxy, port=nil, user=nil, pwd=nil\n\t\t\n\t\t\n\t\tif !proxy\t\n\t\t\t@proxy_host=@proxy_port=@proxy_user=@proxy_pwd=nil \n\t\t\treturn\n\t\tend\n\n\t\tif proxy.class == String \n\t\t\tif !port && !user && !pwd\n\t\t\t\tproxy = URI.parse(proxy)\n\t\t\telse \n\t\t\t\t@proxy_host= host\n\t\t\t\t@proxy_port= port\n\t\t\t\t@proxy_user= user\n\t\t\t\t@proxy_pwd = pwd\n\t\t\tend\n\t\tend\n\t\t\n\t\tif proxy.class == URI::HTTP \n\t\t\t@proxy_host= proxy.host\n\t\t\t@proxy_port= proxy.port\n\t\t\t@proxy_user= proxy.user\n\t\t\t@proxy_pwd = proxy.password\n\t\tend\n\tend", "def set_proxy(address,port,user=nil,password=nil)\n @proxy_server={:address=>address,:port=>port,\n :user=>user, :password=>password}\n return self\n end", "def proxy=(value)\n Curl.set_option(:proxy, value_for(value, :string), handle)\n end", "def proxy=(val)\n\t\t\tself.options[:proxy] = val\n\t\tend", "def set_proxy(address, port, user = T.unsafe(nil), password = T.unsafe(nil)); end", "def set_proxy(addr, port = T.unsafe(nil), user = T.unsafe(nil), pass = T.unsafe(nil)); end", "def proxy(arg = nil)\n return @proxy if arg.nil?\n warn 'Warning: use of proxy(new_value) to set connection proxy have been DEPRECATED and will be removed in Faraday 1.0'\n @manual_proxy = true\n @proxy = ProxyOptions.from(arg)\n end", "def http_proxy(addr=nil, port = nil)\n default_options[:http_proxyaddr] = addr\n default_options[:http_proxyport] = port\n end", "def setup_proxy(proxy_server, port, user_name = nil, password = nil)\n self.http_proxy_setting = {\n http: {\n server: proxy_server,\n port: port\n }\n }\n if user_name and password\n self.http_proxy_setting[:http][:user_name] = user_name\n self.http_proxy_setting[:http][:password] = password\n end\n end", "def add_proxy(proxy_path, opts={})\n @proxies[proxy_path.to_sym] = HashStruct.new(opts)\n return self\n end", "def initialize(proxy_host, proxy_port = 1080, options = {})\n @proxy_host = proxy_host\n @proxy_port = proxy_port\n @options = options\n end", "def initialize(proxy_host, proxy_port = 1080, options = {})\n @proxy_host = proxy_host\n @proxy_port = proxy_port\n @options = options\n end", "def initialize(proxy_host, proxy_port = 80, options = {})\n @proxy_host = proxy_host\n @proxy_port = proxy_port\n @options = options\n end", "def proxy=(new_value)\n @manual_proxy = true\n @proxy = new_value ? ProxyOptions.from(new_value) : nil\n end", "def initialize( proxy_host, proxy_port=1080, options={} )\n @proxy_host = proxy_host\n @proxy_port = proxy_port\n @options = options\n end", "def set_proxy(host, port)\n #self.agent.set_proxy(host, port)\n end", "def proxy=(new_proxy)\n @proxy = case new_proxy\n when Spidr::Proxy\n new_proxy\n when Hash\n Spidr::Proxy.new(**new_proxy)\n when String, URI::HTTP\n proxy_uri = URI(new_proxy)\n\n Spidr::Proxy.new(\n host: proxy_uri.host,\n port: proxy_uri.port,\n user: proxy_uri.user,\n password: proxy_uri.password\n )\n when nil\n Spidr::Proxy.new\n else\n raise(TypeError,\"#{self.class}#{__method__} only accepts Spidr::Proxy, URI::HTTP, Hash, or nil\")\n end\n end", "def set_proxy(proxy='')\r\n RestClient.proxy = proxy.empty? ? ENV['http_proxy'] : proxy\r\n end", "def set_proxy(proxy='')\r\n RestClient.proxy = proxy.empty? ? ENV['http_proxy'] : proxy\r\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def setProxy(host, port, user_name, password)\n @helper.setProxy(host, port, user_name, password)\n self\n end", "def set_akismet_proxy(proxyHost, proxyPort) \n @proxyPort = proxyPort\n @proxyHost = proxyHost\n end", "def proxy=value\n @proxy=value.is_a?(URI) ? value:URI.parse(value)\n end", "def initialize(options = {})\n @options = {:proxy_host => nil,\n :proxy_port => nil,\n :proxy_user => nil,\n :proxy_pass => nil}.merge(options)\n end", "def initialize(proxy)\n @proxy_uri =\n case proxy\n when :no_proxy then nil\n when nil then get_proxy_from_env\n when URI::HTTP then proxy\n else URI.parse(proxy)\n end\n end", "def proxy=(value)\n\t\t\t@proxy = value\n\t\tend", "def proxyauth=(value)\n Curl.set_option(:proxyauth, value_for(value, :string), handle)\n end", "def set_proxy\n @proxy = Proxy.find(params[:id])\n end", "def configure_proxy(proxy_options)\n if proxy_options.is_a?(Hash)\n set_proxy_attributes proxy_options[:attributes] if proxy_options[:attributes]\n end\n end", "def proxy=(value)\n @proxy = value\n end", "def proxy_address\n proxy? ? @options['proxy_address'] || '127.0.0.1' : nil\n end", "def parse_proxy(uri)\n proxy = URI.parse(uri)\n self.proxy_host = proxy.host\n self.proxy_port = proxy.port\n self.proxy_user = proxy.user\n self.proxy_password = proxy.password\n end", "def http_proxy=(_arg0); end", "def with_proxy(host, port, username, password)\n @proxy = SmartyStreets::Proxy.new(host, port, username, password)\n self\n end", "def use(proxy, options = {}, &block)\n proxy = Moneta.const_get(proxy) if Symbol === proxy\n raise ArgumentError, 'You must give a Class or a Symbol' unless Class === proxy\n @proxies.unshift [proxy, options, block]\n nil\n end", "def use(proxy, options = {}, &block)\n proxy = Moneta.const_get(proxy) if Symbol === proxy\n raise ArgumentError, 'You must give a Class or a Symbol' unless Class === proxy\n @proxies.unshift [proxy, options, block]\n nil\n end", "def setHttpProxy(proxy)\n unless /(?i)^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z0-9]{1,}:\\d+$/.match(proxy)\n raise Error.new(Pdfcrowd.create_invalid_value_message(proxy, \"setHttpProxy\", \"html-to-image\", \"The value must have format DOMAIN_OR_IP_ADDRESS:PORT.\", \"set_http_proxy\"), 470);\n end\n \n @fields['http_proxy'] = proxy\n self\n end", "def set_proxy_config\n http_proxy \"http://127.0.0.1:3128\"\n https_proxy \"http://127.0.0.1:3128\"\n ftp_proxy \"http://127.0.0.1:3128\"\nend", "def setHttpProxy(proxy)\n unless /(?i)^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z0-9]{1,}:\\d+$/.match(proxy)\n raise Error.new(Pdfcrowd.create_invalid_value_message(proxy, \"setHttpProxy\", \"html-to-pdf\", \"The value must have format DOMAIN_OR_IP_ADDRESS:PORT.\", \"set_http_proxy\"), 470);\n end\n \n @fields['http_proxy'] = proxy\n self\n end", "def initialize(options={})\n # Ensure http_proxy env vars are used if no proxy explicitly supplied.\n @options = options\n @http_proxy =\n case @options[:http_proxy]\n when :no_proxy\n false\n when nil\n true\n else\n @options[:http_proxy].to_str\n end\n @fetcher_class = CachedFetcher\n end", "def setHttpProxy(proxy)\n unless /(?i)^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z0-9]{1,}:\\d+$/.match(proxy)\n raise Error.new(Pdfcrowd.create_invalid_value_message(proxy, \"setHttpProxy\", \"image-to-image\", \"The value must have format DOMAIN_OR_IP_ADDRESS:PORT.\", \"set_http_proxy\"), 470);\n end\n \n @fields['http_proxy'] = proxy\n self\n end", "def setHttpProxy(proxy)\n unless /(?i)^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z0-9]{1,}:\\d+$/.match(proxy)\n raise Error.new(Pdfcrowd.create_invalid_value_message(proxy, \"setHttpProxy\", \"image-to-pdf\", \"The value must have format DOMAIN_OR_IP_ADDRESS:PORT.\", \"set_http_proxy\"), 470);\n end\n \n @fields['http_proxy'] = proxy\n self\n end", "def http_proxy\n @http_proxy ||= begin\n proxy = get_env('HTTP_PROXY') || return\n proxy = \"http://#{proxy}\" unless proxy =~ /^https?:/\n uri = URI.parse(proxy)\n uri.user ||= get_env('HTTP_PROXY_USER')\n uri.password ||= get_env('HTTP_PROXY_PASS')\n uri\n end\n end", "def initialize(source_uri, proxy)\n @uri = normalize_uri(source_uri)\n @http_proxy = proxy\n if @http_proxy == true\n\t@http_proxy = ENV['http_proxy'] || ENV['HTTP_PROXY']\n end\n end", "def apply_env_proxy_settings(settings)\n $stderr.puts(\"Using proxy #{settings}\") if ENV[\"DEBUG\"]\n scheme = settings[:protocol].downcase\n java.lang.System.setProperty(\"#{scheme}.proxyHost\", settings[:host])\n java.lang.System.setProperty(\"#{scheme}.proxyPort\", settings[:port].to_s)\n java.lang.System.setProperty(\"#{scheme}.proxyUsername\", settings[:username].to_s)\n java.lang.System.setProperty(\"#{scheme}.proxyPassword\", settings[:password].to_s)\n end", "def setHttpProxy(proxy)\n unless /(?i)^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z0-9]{1,}:\\d+$/.match(proxy)\n raise Error.new(Pdfcrowd.create_invalid_value_message(proxy, \"setHttpProxy\", \"pdf-to-html\", \"The value must have format DOMAIN_OR_IP_ADDRESS:PORT.\", \"set_http_proxy\"), 470);\n end\n \n @fields['http_proxy'] = proxy\n self\n end", "def set_options(opts = {})\n @wsdl = opts[:wsdl] || Settings.session.wsdl\n @endpoint = opts[:endpoint] || Settings.session.endpoint\n @soap_log = opts[:soap_log] || Settings.session.soap_log\n @soap_logger = opts[:soap_logger] || Settings.session.soap_logger\n @soap_log_level = opts[:soap_log_level] || Settings.session.soap_log_level\n @username = opts[:username] || Settings.session.username\n @password = opts[:password] || Settings.session.password\n @auth_cookie = opts[:auth_cookie] || nil\n end", "def initialize(opts={})\n opts = opts.keyword_args(:provider => :required,\n :proxy_root => :optional,\n :persist => :optional,\n :synchronize => {:valid => [:async, true, false], :default => true},\n :max_cache_size => :optional,\n :OTHERS => :optional)\n\n @proxy_root = Pathname.new(opts.delete(:proxy_root)) if opts.proxy_root\n @persist = opts.delete(:persist)\n @synchronize = opts.delete(:synchronize)\n @max_cache_size = opts.delete(:max_cache_size)\n @reserved_proxy_paths = Set.new\n\n @fog_wrapper = FogWrapper.connect(opts)\n\n @proxy_root ||= case\n when defined?(Rails) then Rails.root + \"tmp\"\n else Pathname.new(Dir.tmpdir)\n end + \"defog\" + \"#{provider}-#{location}\"\n\n end", "def proxyport=(value)\n Curl.set_option(:proxyport, value_for(value, :int), handle)\n end", "def faraday_proxy(options)\n return options[:proxy] if options[:proxy]\n\n proxy = options[:options]\n proxy[:http_proxy_uri] if proxy[:http_proxy_uri]\n end", "def setHttpProxy(proxy)\n unless /(?i)^([a-z0-9]+(-[a-z0-9]+)*\\.)+[a-z0-9]{1,}:\\d+$/.match(proxy)\n raise Error.new(Pdfcrowd.create_invalid_value_message(proxy, \"setHttpProxy\", \"pdf-to-text\", \"The value must have format DOMAIN_OR_IP_ADDRESS:PORT.\", \"set_http_proxy\"), 470);\n end\n \n @fields['http_proxy'] = proxy\n self\n end", "def set_proxy_header(opts)\n opts = check_params(opts,[:headers])\n super(opts)\n end", "def proxy_uri\n @proxy_uri ||= URI.parse(config(\"proxy-uri\"))\n end", "def set_proxy_type(opts)\n opts = check_params(opts,[:types])\n super(opts)\n end", "def test_using_proxy_params_hash\n proxy = {\n http: PROXY,\n ssl: PROXY\n }\n\n run_test_with proxy: proxy\n end", "def initialize(opts)\n # Get the options and assign default values:\n @host = opts[:host]\n @port = opts[:port] || 443\n @username = opts[:username]\n @password = opts[:password]\n @insecure = opts[:insecure] || false\n @ca_file = opts[:ca_file]\n @log = opts[:log]\n @debug = opts[:debug] || false\n @proxy_url = opts[:proxy_url]\n @proxy_username = opts[:proxy_username]\n @proxy_password = opts[:proxy_password]\n @timeout = opts[:timeout]\n\n # Create the HTTP client:\n @client = HttpClient.new(\n host: @host,\n port: @port,\n insecure: @insecure,\n ca_file: @ca_file,\n log: @log,\n debug: @debug,\n proxy_url: @proxy_url,\n proxy_username: @proxy_username,\n proxy_password: @proxy_password,\n timeout: @timeout\n )\n end", "def initialize opts={}\n opts[:url] ||= 'http://127.0.0.1:8983/solr'\n @opts = opts\n @uri = URI.parse opts[:url]\n @proxy = URI.parse opts[:proxy] if opts[:proxy]\n end", "def faraday_proxy(options)\n return options[:proxy] if options[:proxy]\n\n proxy = options[:options]\n proxy[:http_proxy_uri] if proxy[:http_proxy_uri]\n end", "def initialize(proxy_addr, proxy_port)\n timeout = ProxyFetcher.config.proxy_validation_timeout\n\n @http = HTTP.follow.via(proxy_addr, proxy_port.to_i).timeout(connect: timeout, read: timeout)\n end", "def initialize(*args)\n super\n useful_variable = PROXY_ENVIRONMENT_VARIABLES.detect {|v| ENV.has_key?(v)}\n if ENV[useful_variable].match(/^[[:alpha:]]+:\\/\\//)\n @proxy = URI.parse(ENV[useful_variable])\n else\n @proxy = URI.parse(\"http://\" + ENV[useful_variable])\n end\n end", "def proxy(prox)\n RestClient.proxy = prox\n end", "def proxysettings=(usage)\r\n\t\t\t`#{BITS::BITSADMIN} /setproxysettings {#{@id}} #{usage}`\r\n\t\tend", "def option_http_proxy\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option http_proxy \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "def http_proxy_uri\n @http_proxy_uri ||= begin\n keys = %w( HTTP_PROXY HTTP_PROXY_USER HTTP_PROXY_PASS )\n env = Hash[ENV.\n map{|k, v| [k.upcase, v]}.\n select{|k, v| keys.include?(k)}.\n reject{|k, v| v.nil? || v.empty?}]\n\n uri = env[\"HTTP_PROXY\"] or return\n uri = \"http://#{uri}\" unless uri =~ /^(https?|ftp|file):/\n uri = URI.parse(uri)\n uri.user ||= env[\"HTTP_PROXY_USER\"]\n uri.password ||= env[\"HTTP_PROXY_PASS\"]\n uri\n end\n end", "def test_using_proxy_params_hash_with_longer_names_httpproxy_sslproxy\n proxy = {\n httpProxy: PROXY,\n sslProxy: PROXY\n }\n\n run_test_with proxy: proxy\n end", "def proxy\n\t\t\tself.options[:proxy]\n\t\tend", "def test_using_proxy_object_from_uri_with_http_scheme\n proxy = Selenium::WebDriver::Proxy.new(\n http: URI(\"http://#{PROXY}\"),\n ssl: URI(\"http://#{PROXY}\")\n )\n\n run_test_with proxy: proxy\n end", "def initialize(options)\n options.each do |key, value|\n next if %w(host port user password).include?(key)\n instance_variable_set(\"@#{key}\", value)\n end\n\n @max_retry = options[\"proxy_max_fail\"] ||\n ProxyEnforce.config.proxy_max_fail\n\n run_hook :after_initialize\n end", "def using_proxy?; end", "def fiddler_proxy()\n '--proxy=127.0.0.1:8888'\n end", "def connect_to(host, port)\n if @proxy_uri\n Net::HTTP::Proxy(@proxy_uri.host, @proxy_uri.port, unescape(@proxy_uri.user), unescape(@proxy_uri.password)).new(host, port)\n else\n Net::HTTP.new(host, port)\n end\n end", "def redirect_to_with_proxy(*args)\n args[0] = request.protocol + url_options[:host] + args.first if args.first.is_a?(String) && !%r{^\\w+://.*}.match(args.first) && !url_options[:host].blank?\n redirect_to_without_proxy(*args)\n end", "def proxytype=(value)\n Ethon.logger.warn(\n \"ETHON: Easy#proxytype= is deprecated. \"+\n \"Please use Easy#proxy= with protocoll handlers.\"\n )\n Curl.set_option(:proxytype, value_for(value, :string), handle)\n end", "def proxyuserpwd=(value)\n Curl.set_option(:proxyuserpwd, value_for(value, :string), handle)\n end", "def remove_proxy(opts)\n opts = check_params(opts,[:proxy_info])\n super(opts)\n end", "def test_using_proxy_object_from_uri_without_http_scheme\n proxy = Selenium::WebDriver::Proxy.new(\n http: URI(\"http://#{PROXY}\"),\n ssl: URI(\"http://#{PROXY}\")\n )\n\n run_test_with proxy: proxy\n end", "def connect_using_proxy(socket); end", "def send_proxy_connect_request(req); end", "def proxy_uri; end", "def proxy_uri; end", "def option_http_use_proxy_header\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option http-use-proxy-header \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "def to_proxy(node)\n addr, port = node.split(\":\")\n\n ProxyFetcher::Proxy.new.tap do |proxy|\n proxy.addr = addr\n proxy.port = Integer(port)\n proxy.country = \"Unknown\"\n proxy.anonymity = \"Unknown\"\n proxy.type = ProxyFetcher::Proxy::HTTP\n end\n end", "def enable_smart_proxy(host=nil, port=nil)\n params = {:enabled => true}\n params[:host] = host unless host.nil?\n params[:port] = port unless port.nil?\n smart_proxy(params)\n end", "def initialize(opts)\n @opts = opts\n uri = URI(opts[:uri])\n @host = uri.host\n @port = uri.port\n end", "def select_http_obj\n if @proxy_server\n http = Net::HTTP::Proxy(@proxy_server[:address],@proxy_server[:port],\n @proxy_server[:user],@proxy_server[:password]).new(@url.host,@url.port)\n else\n http = Net::HTTP.new(@url.host, @url.port)\n end\n http.use_ssl=true if @url.class==URI::HTTPS\n if !@verify_ssl\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE if @url.class==URI::HTTPS\n end\n http\n end", "def initialize(opts)\n @options = DEFAULT_OPTIONS.dup.merge(opts.dup)\n @uri = @options[:uri] ? URI(@options[:uri]) : URI(uri_to_s)\n end", "def get_proxy_options(url=nil)\n options = {}\n if url = url || ENV['HTTPS_PROXY'] || ENV['https_proxy'] || ENV['HTTP_PROXY'] || ENV['http_proxy']\n proxy_uri = URI.parse(url)\n options[:http_proxyaddr] = proxy_uri.host\n options[:http_proxyport] = proxy_uri.port\n options[:http_proxyuser] = proxy_uri.user\n options[:http_proxypass] = proxy_uri.password\n end\n options\n end", "def open(host, port, connection_options = nil)\n build_proxy_command_equivalent(connection_options)\n super\n end", "def test_using_proxy_object\n proxy = Selenium::WebDriver::Proxy.new(\n http: PROXY,\n ssl: PROXY\n )\n\n run_test_with proxy: proxy\n end", "def initialize(*args)\n super\n register_advanced_options([\n OptBool.new('HttpProxyIE', 'Enable use of IE proxy settings', default: true, aliases: ['PayloadProxyIE'])\n ], self.class)\n end", "def connect_to(host, port)\n if @http_proxy\n\tproxy_uri = URI.parse(@http_proxy)\n\tNet::HTTP::Proxy(proxy_uri.host, proxy_uri.port).new(host, port)\n else\n\tNet::HTTP.new(host, port)\n end\n end" ]
[ "0.79281175", "0.77226055", "0.764486", "0.75484395", "0.7518483", "0.72959137", "0.72632235", "0.7262506", "0.7247098", "0.72443813", "0.7212044", "0.7196932", "0.7104773", "0.6890611", "0.6849287", "0.6849287", "0.6808567", "0.680697", "0.6706162", "0.6693766", "0.6685542", "0.6607712", "0.6607712", "0.6597512", "0.6597512", "0.6597512", "0.6597512", "0.6597512", "0.6597512", "0.6597512", "0.65930283", "0.65525985", "0.6540291", "0.6477106", "0.6463834", "0.64630234", "0.64597034", "0.6430041", "0.6410976", "0.636335", "0.6325022", "0.631861", "0.6316147", "0.6296887", "0.6296887", "0.6275305", "0.625018", "0.6249814", "0.62307495", "0.6225612", "0.6217639", "0.62004405", "0.61965036", "0.6192692", "0.61922705", "0.61520624", "0.614268", "0.6140686", "0.61297005", "0.6121925", "0.61169493", "0.6113158", "0.6110709", "0.60979074", "0.6096064", "0.6077305", "0.60729575", "0.603722", "0.6033823", "0.603267", "0.6030884", "0.6018628", "0.599389", "0.59864974", "0.5985147", "0.5983486", "0.5940966", "0.593929", "0.59370434", "0.5917009", "0.5914798", "0.59030807", "0.5901246", "0.58924687", "0.58896625", "0.58539903", "0.5815473", "0.58043176", "0.58043176", "0.5801316", "0.57989407", "0.5767422", "0.5766747", "0.5740921", "0.5714466", "0.57069045", "0.5706525", "0.57009125", "0.5700035", "0.5697438" ]
0.7238561
10
Assign the uri and io based on if the uri is a file, io, or url.
def uri= new_uri @uri = self.class.build_uri new_uri end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def uri= uri_or_string\n if uri_or_string.respond_to?(:host)\n @uri = uri_or_string\n else\n string = uri_or_string =~ /^http/ ? uri_or_string : 'http://' + uri_or_string.to_s\n @uri = URI.parse(string)\n end\n @server = Net::HTTP.new(uri.host, uri.port)\n end", "def uri(path=nil)\n (path and @uri = path) or @uri\n end", "def uri string = nil\n string ? @uri = string : @uri\n end", "def open_uri(uri)\n case uri.scheme\n when \"file\"\n path = URI.decode(uri.path)\n @@logger.debug \"Attempting to open #{path}\"\n raise MissingAssetError unless File.exist?(path)\n io = File.open(path)\n when \"http\", \"https\"\n io = Tempfile.new(\"common_mapping_file\")\n Net::HTTP.start(uri.host, uri.port) do |http|\n http.request_get(uri.path) do |resp|\n raise MissingAssetError, \"Received a #{resp.code} while trying to retrieve #{uri}\" if resp.code != \"200\"\n resp.read_body do |segment|\n io.write(segment)\n end\n end\n end\n io.rewind\n else\n raise NotImplementedError\n end\n io\n end", "def open_uri_or_path(uri, &block)\n if file_uri?(uri)\n open(get_file_uri_path(uri), &block)\n else\n connection_options = {\n \"User-Agent\" => \"RubyGems/#{Gem::RubyGemsVersion} #{Gem::Platform.local}\"\n }\n\n if @proxy_uri\n http_proxy_url = \"#{@proxy_uri.scheme}://#{@proxy_uri.host}:#{@proxy_uri.port}\" \n connection_options[:proxy_http_basic_authentication] = [http_proxy_url, unescape(@proxy_uri.user)||'', unescape(@proxy_uri.password)||'']\n end\n\n uri = URI.parse uri unless URI::Generic === uri\n unless uri.nil? || uri.user.nil? || uri.user.empty? then\n connection_options[:http_basic_authentication] =\n [unescape(uri.user), unescape(uri.password)]\n end\n\n open(uri, connection_options, &block)\n end\n end", "def is_uri?(uri)\n URI::Generic===uri\n end", "def file_uri_scheme=(_arg0); end", "def ensure_uri(uri)\n raise ArgumentError, \"ensure_uri: uri may not be nil\" if uri.nil?\n is_uri?(uri) ? uri : URI.parse(uri)\n end", "def open_uri_or_path(uri, &block)\n require 'rubygems/open-uri'\n if is_file_uri(uri)\n open(get_file_uri_path(uri), &block)\n else\n open(uri,\n \"User-Agent\" => \"RubyGems/#{Gem::RubyGemsVersion}\",\n :proxy => @http_proxy,\n &block)\n end\n end", "def uri=(u)\n # Remove any format extension (.json, .rdf etc.)\n ext = File.extname(u)\n @uri = ext.nil? || ext.empty? ? u : u.rpartition(ext)[0]\n end", "def uri=(value)\n @uri = value\n end", "def uri=(value)\n @uri = value\n end", "def open?(uri); end", "def uri(custom_uri = nil)\n if custom_uri\n @uri = custom_uri\n @http = create_http # yike, oh well. less intrusive this way\n else # if no custom passed, we use existing, which, if unset, is set to site uri\n @uri ||= URI.parse(site)\n end\n end", "def location= uri\n native.open uri\n end", "def uri=(_arg0); end", "def uri=(_arg0); end", "def uri=(_arg0); end", "def uri=(_arg0); end", "def upload_image_from_uri\n if self.image_file_name.nil? && !self.unique_image_file_name.nil?\n uri = URI.parse(self.unique_image_file_name)\n self.image = open_io_uri(uri)\n self.image2 = open_io_uri(uri)\n end\n rescue TypeError\n self.image = open_io_file(self.unique_image_file_name)\n self.image2 = open_io_file(self.unique_image_file_name)\n #rescue SocketError\n # puts \"Not connected to Internet\"\n rescue # catch url errors with validations instead of exceptions (Errno::ENOENT, OpenURI::HTTPError, etc...) \n self.errors[:unique_image_file_name].push \"returned #{$!.inspect}\"\n end", "def initialize(input)\n if input.is_a? String\n if File.exist? input\n @path = input\n elsif input =~ URI::DEFAULT_PARSER.make_regexp\n @uri = URI.parse input\n else\n raise Errno::ENOENT, \"missing file or invalid URI - #{input}\"\n end\n elsif input.respond_to? :read\n @stream = input\n else\n raise TypeError, \"can't read from #{input.class.name}\"\n end\n end", "def initialize(input)\n if input.is_a? String\n if File.exist? input\n @path = input\n elsif input =~ URI::DEFAULT_PARSER.make_regexp\n @uri = URI.parse input\n else\n raise Errno::ENOENT, \"missing file or invalid URI - #{input}\"\n end\n elsif input.respond_to? :read\n @stream = input\n else\n raise TypeError, \"can't read from #{input.class.name}\"\n end\n end", "def uri\n @uri ||= select { |type,value| type == :uri }.map do |(type,value)|\n URI.parse(value)\n end\n end", "def open_io_uri(url)\n io = open(url)\n def io.original_filename; base_uri.path.split('/').last; end\n return io unless io.original_filename.blank?\n self.errors[:unique_image_file_name].push 'does not link to a file'\n return nil\n end", "def process_uri(uri)\n require 'open-uri'\n require 'open_uri_redirections'\n open(uri, :allow_redirections => :safe) do |r|\n r.base_uri.to_s\n end\n end", "def type(uri = nil)\n unless uri.nil?\n @type = case uri\n when RDF::URI\n uri\n else\n raise TypeError, \"Cannot assign type #{uri} (of type #{uri.class}) to #{self}, expected RDF::URI\"\n end\n end\n @type\n end", "def uri=(uri)\n @uri = uri.to_s.dup.freeze\n update_uri_with_version\n end", "def open(uri, options = T.unsafe(nil)); end", "def process_uri(uri)\n # empty --> this is like an abstract class method\n end", "def uri_for(uri_or_path, params = nil)\n if uri_or_path.kind_of? URI\n u = uri_or_path.dup\n\n u.host = @uri.host\n u.port = @uri.port\n u.scheme = @uri.scheme\n else\n u = uri.dup\n u.path = File.join(uri.path, uri_or_path)\n end\n\n u.query = query_string_for(params) if params\n u.to_s\n end", "def process_uri(uri)\n ret = uri\n\n require 'open-uri'\n require 'open_uri_redirections'\n begin\n open(uri, :allow_redirections => :safe) do |r|\n ret = r.base_uri.to_s\n end\n end\n\n ret\n end", "def uri\n @uri ||= URI(url)\n end", "def initialize uri\n self.uri = uri\n end", "def type_to_uri(type)\n case type\n when ::RDF::URI\n type\n when String\n ::RDF::URI(type)\n else\n fail ArgumentError, 'Invalid file type. You must submit a URI or a symbol.'\n end\n end", "def uri\n @_uri ||= URI(@url)\n end", "def uri\n @_uri ||= URI(@url)\n end", "def normalize_options(uri_or_options)\n case uri_or_options\n when String, Addressable::URI then DataObjects::URI.parse(uri_or_options).attributes\n when DataObjects::URI then uri_or_options.attributes\n when Pathname then {:path => uri_or_options}\n else\n uri_or_options[:path] ||= uri_or_options.delete(:config) || uri_or_options.delete(:database)\n uri_or_options\n end\n end", "def open(uri_s, options = T.unsafe(nil), &error_block); end", "def uri(string)\n return if string.blank?\n\n string = URI(string) unless string.is_a?(URI)\n\n # Rewrite host if necessary\n return string unless MetalArchives.config.endpoint\n\n endpoint = URI(MetalArchives.config.endpoint)\n\n string\n .tap { |u| u.host = endpoint.host }\n .tap { |u| u.scheme = endpoint.scheme }\n .tap { |u| u.port = endpoint.port }\n end", "def set_uri(base, path)\n @uri = \"#{base}/#{path}/#{self.identifier}\"\n end", "def fopen(uri, *args, &block)\n\n # should I really care about blocks here ? ...\n\n u = URI.parse uri.to_s\n\n return File.open(uri.to_s, &block) \\\n if u.scheme == nil\n\n return File.open(uri.to_s[5..-1], &block) \\\n if u.scheme == 'file'\n\n if u.scheme == 'http' or u.scheme == 'https'\n\n r = EndPoint.request(:get, [ uri ] + args) \\\n\n if block\n block.call r\n return\n end\n\n class << r\n def read\n self.body\n end\n end unless r.respond_to?(:read)\n\n return r\n end\n\n raise \"can't handle scheme '#{u.scheme}' for #{u.to_s}\"\n end", "def uri_available?(uri)\n open(uri) rescue false\n end", "def retrieve_ontology(uri)\n case uri\n when CPO_URI\n file_path = \"/home/grosscol/workspace/ontologies/cpo/cpo.owl\"\n when PSDO_URI\n file_path = \"/home/grosscol/workspace/ontologies/psdo/psdo.owl\"\n else\n puts \"bad uri\"\n abort\n end\n\n #File.read file_path\nend", "def uri?\n !!@uri\n end", "def uri?\n !!@uri\n end", "def uri_option(uri, config, first=true)\n @protocol.each do |prot|\n begin\n uri, opt = prot.uri_option(uri, config)\n # opt = nil if opt == ''\n return uri, opt\n rescue DRbBadScheme\n end\n end\n if first && (config[:auto_load] != false)\n auto_load(uri, config)\n return uri_option(uri, config, false)\n end\n raise DRbBadURI, 'can\\'t parse uri:' + uri\n end", "def normalize_uri(uri)\n (uri =~ /^(https?|ftp|file):/) ? uri : \"http://#{uri}\"\n end", "def normalize_uri(uri)\n (uri =~ /^(https?|ftp|file):/) ? uri : \"http://#{uri}\"\n end", "def file_uri_scheme; end", "def coerce_uri incoming_uri\n if incoming_uri.is_a? Hash\n Addressable::URI.new deep_hash_normalize(incoming_uri)\n elsif incoming_uri\n Addressable::URI.parse incoming_uri\n end\n end", "def uri=(val)\n self.title = self.class.id_from_uri(val)\n if self.title\n self.title = self.title.titleize \n end\n self.uri_path = self.class.scope_from_uri(val)\n end", "def uri\n @uri ||= URI.parse @url if @url\n @uri\n end", "def actual_uri\n redirects_to or uri\n end", "def uri(the_url)\n case @url_method\n when :graphical\n self.class.uri_graphical(the_url)\n when :text\n case the_url.to_s\n when /^http/\n puts \"USER ACTION: please enter this url in a browser:\\n\"+the_url.to_s.red()+\"\\n\"\n else\n puts \"USER ACTION: open this:\\n\"+the_url.to_s.red()+\"\\n\"\n end\n else\n raise StandardError,\"unsupported url open method: #{@url_method}\"\n end\n end", "def open_resource(url_file_stream_or_string, options)\n options[:handlers] ||= []\n\n if url_file_stream_or_string.respond_to?(:read)\n return url_file_stream_or_string\n\n elsif url_file_stream_or_string == '-'\n return $stdin\n end\n \n # open-uri freaks out if there's leading spaces.\n url_file_stream_or_string.strip!\n \n \n uri = Addressable::URI.parse(url_file_stream_or_string)\n if uri && ['http','https','ftp'].include?(uri.scheme)\n auth = nil\n\n if uri.host && uri.password\n auth = Base64::encode64(\"#{uri.user}:#{uri.password}\").strip\n uri.password = nil\n url_file_stream_or_string = uri.to_s\n end\n\n req_headers = {} \n req_headers[\"User-Agent\"] = options[:agent] || USER_AGENT\n req_headers[\"If-None-Match\"] = options[:etag] if options[:etag]\n \n if options[:modified]\n if options[:modified].is_a?(String)\n req_headers[\"If-Modified-Since\"] = parse_date(options[:modified]).httpdate\n elsif options[:modified].is_a?(Time)\n req_headers[\"If-Modified-Since\"] = options[:modified].httpdate\n elsif options[:modified].is_a?(Array)\n req_headers[\"If-Modified-Since\"] = py2rtime(options[:modified]).httpdate\n end\n end\n \n req_headers[\"Referer\"] = options[:referrer] if options[:referrer]\n req_headers[\"Accept-encoding\"] = 'gzip, deflate' # FIXME make tests\n req_headers[\"Authorization\"] = \"Basic #{auth}\" if auth\n req_headers['Accept'] = ACCEPT_HEADER if ACCEPT_HEADER\n req_headers['A-IM'] = 'feed' # RFC 3229 support \n \n begin\n return open(url_file_stream_or_string, req_headers) \n rescue OpenURI::HTTPError => e\n return e.io\n rescue\n end\n end\n\n # try to open with native open function (if url_file_stream_or_string is a filename)\n begin \n return open(url_file_stream_or_string)\n rescue\n end\n # treat url_file_stream_or_string as string \n return StringIO.new(url_file_stream_or_string.to_s)\n end", "def initialize(uri:)\n @uri = uri\n end", "def open(name, *rest, &block)\n if name.respond_to?(\"open\")\n name.open(*rest, &block)\n elsif name.respond_to?(\"to_str\") && %r{\\A(http|ftp)://} =~ name\n OpenURI.open_uri(name, *rest, &block)\n else\n open_uri_original_open(name, *rest, &block)\n end\n end", "def to_uri(uri, base_uri = nil)\n case base_uri\n when nil, ''\n Utils.normalize_uri(uri.to_s)\n else\n Utils.normalize_uri(base_uri) + Utils.normalize_uri(uri.to_s)\n end\n rescue URI::Error\n nil\n end", "def initialize(uri, env)\n @root = env.root\n @env = env\n uri = uri.to_s\n if uri.include?(\"://\".freeze)\n @scheme, _, @path = uri.partition(\"://\".freeze)\n @scheme << \"://\".freeze\n else\n @scheme = \"\".freeze\n @path = uri\n end\n end", "def initialize(uri)\n raise ArgumentError, \"No blank URI allowed here\" if(uri.to_s.blank?)\n @uri = N::URI.new(uri)\n end", "def URI(url); end", "def file_uri?(uri)\n uri =~ %r{\\Afile://}\n end", "def valid_uri?\n !self.contentable.blank? || !self.uri_path.blank?\n end", "def uri\n raise NotImplementedError\n end", "def open_file(io)\n io.kind_of?(File) ? io : File.open(io)\n end", "def uri\n @uri ||= URI.parse(url)\n end", "def uri_to_file(uri); end", "def uri_to_file(uri); end", "def base_uri=(uri)\n # If the baseUri does not end with a slash, we must add it\n uri += '/' unless uri[-1] == '/'\n @base_uri = uri\n end", "def from_uri(uri, opts = {})\n encoding = opts.fetch(:encoding, nil)\n return from_io(open(uri), encoding: encoding) if encoding\n from_inputstream_or_reader(uri.to_s, opts[:base_uri])\n end", "def initialize(uri, options = nil)\n # lazy-load expensive gem code\n require 'addressable/uri'\n\n @uri = uri\n @uri_obj = parse(uri)\n @options = options || {}\n @options.freeze\n\n if @options['user']\n @user = @options['user']\n end\n\n if @options['password']\n @password = @options['password']\n end\n\n if @options['port']\n @port = @options['port']\n end\n\n if @options['protocol']\n @protocol = @options['protocol']\n end\n\n if @options['host']\n @host = @options['host']\n end\n\n # WARNING: name should never be updated\n @name = @options['name'] || @uri\n end", "def url=(uri)\n @conn = nil\n @url = uri\n end", "def use_uri\n AICType.IntermediateFileSet\n end", "def create_uri\n end", "def build_uri(uri = nil)\n if uri.nil?\n \"#{@path}\"\n else\n [\"#{@path}\", uri].join(\"/\")\n end\n end", "def initialize(uri)\r\n\t\t@uri = clean(uri)\r\n\t\t@uri_xml_encoded_only = REXML::Text.normalize(@uri)\r\n\t\t\r\n\t\t\r\n\t\t@follow_link = true\r\n\tend", "def initialize uri = nil, response = nil, body_io = nil, code = nil\n @uri = uri\n @body_io = body_io\n @code = code\n\n @full_path = false unless defined? @full_path\n\n fill_header response\n extract_filename\n\n yield self if block_given?\n end", "def open? uri\n result = nil\n @change_semaphore.synchronize do\n result = library.open?(uri_to_file(uri))\n end\n result\n end", "def assure_uri(resource)\n resource.retrieve! unless resource['uri']\n raise IncompleteResource, \"#{resource.class}: #{resource['name']} not found\" unless resource['uri']\n end", "def initialize(uri, factory)\n self.factory = factory\n self.uri = uri\n end", "def initialize(uri)\n begin\n unless uri.kind_of? URI\n uri = URI.parse(uri.to_s)\n end\n rescue URI::InvalidURIError\n raise if Gem::Source == self.class\n end\n\n @uri = uri\n @update_cache = nil\n end", "def create_http_connection(uri); end", "def for_uri(uri)\n current_uri = self.class.base_uri\n self.class.base_uri uri\n yield\n self.class.base_uri current_uri\n end", "def uri=(value)\n @uris << value\n end", "def add_uri(force_update_mode, onerror_mode, uri)\n fmode = force_update_mode.nil?\n uri += '&forceUpdateMode=' + force_update_mode unless fmode\n uri += '&onErrorMode=' + onerror_mode unless onerror_mode.nil?\n uri\n end", "def is_file_uri(uri)\n uri =~ %r{\\Afile://}\n end", "def open(io)\n return open_file(io) if file\n \n case io\n when String\n StringIO.new(io)\n when Integer\n IO.open(io)\n else \n io\n end\n end", "def setup_uri_path\n self.uri_path = self.class.scope_from_uri(self.uri)\n end", "def initialize(filename_or_io, content_type, filename = nil, opts = {})\n io = filename_or_io\n local_path = \"\"\n if io.respond_to? :read\n # in Ruby 1.9.2, StringIOs no longer respond to path\n # (since they respond to :length, so we don't need their local path, see parts.rb:41)\n local_path = filename_or_io.respond_to?(:path) ? filename_or_io.path : \"local.path\"\n else\n io = File.open(filename_or_io)\n local_path = filename_or_io\n end\n filename ||= local_path\n\n @content_type = content_type\n @original_filename = File.basename(filename)\n @local_path = local_path\n @io = io\n @opts = opts\n end", "def uri=(url)\n @uri = URI.parse(url)\n if (with && !connection.request_body_permitted?)\n @uri.query = with\n end\n end", "def uri! uri, verb, http_version\n rv = Wrapper.msc_process_uri txn_ptr, (strptr uri), (strptr verb), (strptr http_version)\n rv == 1 or raise Error \"msc_process_uri failed for #{[uri, verb, http_version].inspect}\"\n\n intervention!\n end", "def base_uri(uri = nil)\n @base_uri = uri unless uri.nil?\n @base_uri\n end", "def uri\n @uri ||= if @href then\n begin\n URI.parse @href\n rescue URI::InvalidURIError\n begin\n URI.parse(Addressable::URI.escape(@href))\n rescue Addressable::URI::InvalidURIError\n raise URI::InvalidURIError\n end\n end\n end\n end", "def typecast_to_uri(value)\n URI(value)\n rescue ArgumentError\n nil\n end", "def uri( new_uri=nil )\n\t\tif new_uri\n\t\t\t@uri = URI( new_uri )\n\t\t\t@uri.host ||= self.addresses.first.to_s\n\n\t\t\tself.app_protocol( @uri.scheme )\n\t\t\tself.port( @uri.port )\n\t\tend\n\n\t\treturn @uri.to_s\n\tend", "def data_uri=(uri)\n assign_data_uri(uri)\n @data_uri = uri\n end", "def initialize uri\n\t\tset_proxy ENV['http_proxy'] if ENV['http_proxy']\n\t\t\t\t\t\t\n\t\tif uri.class == String\n\n\t\t\tunless uri =~ /^https?:\\/\\//\n\t\t\t\turi = \"http://#{uri}\"\n\t\t\tend\n\n\t\t\turi = URI.parse uri\n\n\t\tend\n\t\t@uri = uri\n\t\tif !@uri.path || \"\" == @uri.path.strip\n\t\t\t@uri.path=\"/\"\n\t\tend\n\n\n\t\t@request_headers={}\n\t\t@response_headers={}\n\t\t@cookies=[]\n\t\t@response_handlers=RESPONSE_HANDLERS.clone\n\t\t@follow_num_redirects=5\n\n\t\tif @uri.user\n\t\t\tbasic_authentication @uri.user, @uri.password\n\t\tend\n\n\tend", "def migrate_linked_file?(uri)\n host = uri.host.to_s\n path = uri.path.to_s\n if(host == 'www.ctcc.uio.no')\n if(path != '/' and path != '')\n return true\n else\n return false\n end\n elsif(host != '')\n return false\n end\n return super(uri)\n end", "def set_uri\n self.uri ||= \"#{DEFAULT_BUCKET_NAME}/#{DEFAULT_PREFIX_BASE}/#{storable.key_prefix}/#{key}\"\n end", "def into(uri)\n @into = RDF::URI(uri)\n self\n end" ]
[ "0.68373674", "0.67372996", "0.6518025", "0.63698983", "0.6340932", "0.6251896", "0.62003857", "0.61943465", "0.61795276", "0.61668265", "0.6099828", "0.6099828", "0.6078686", "0.6070268", "0.60263735", "0.60109323", "0.60109323", "0.60109323", "0.60109323", "0.5980851", "0.58916533", "0.58916533", "0.5874219", "0.5864544", "0.5834831", "0.5805437", "0.5790179", "0.57326037", "0.57300395", "0.5725097", "0.5722616", "0.5712935", "0.569845", "0.5680319", "0.5679895", "0.5679895", "0.5670536", "0.5660536", "0.56438756", "0.56410706", "0.5635638", "0.5621492", "0.56101274", "0.56039816", "0.56039816", "0.5582548", "0.5580756", "0.55795467", "0.5543906", "0.5543221", "0.55372", "0.5525433", "0.55204946", "0.5514437", "0.55126464", "0.55007744", "0.5482704", "0.5476422", "0.5465501", "0.544464", "0.5418296", "0.54008603", "0.54000235", "0.53992057", "0.53912175", "0.5371511", "0.5368394", "0.5368394", "0.5351982", "0.5348027", "0.5344794", "0.534477", "0.53424364", "0.5327917", "0.53266096", "0.532397", "0.5323846", "0.5316172", "0.5310464", "0.5307137", "0.53030795", "0.5300747", "0.52993816", "0.5291475", "0.5290021", "0.52895045", "0.52887696", "0.52882487", "0.5281499", "0.52734405", "0.52713215", "0.5265744", "0.52587533", "0.5245895", "0.5228065", "0.522724", "0.52265614", "0.5226267", "0.5223198", "0.5221412" ]
0.5810496
25
Decide whether to use cookies or not.
def use_cookies= bool if bool && (!@headers['Cookie'] || @headers['Cookie'].empty?) cookie = Kronk.cookie_jar.get_cookie_header @uri.to_s @headers['Cookie'] = cookie unless cookie.empty? else @headers.delete 'Cookie' end @use_cookies = bool end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def use_cookies= bool\n if bool && (!@headers['Cookie'] || @headers['Cookie'].empty?)\n cookie = Kronk.cookie_jar.get_cookie_header @uri.to_s\n @headers['Cookie'] = cookie unless cookie.empty?\n\n elsif !bool\n @headers.delete 'Cookie'\n end\n\n @use_cookies = bool\n end", "def cookies_enabled\n return true unless cookies[\"cookieTest\"].blank?\n cookies[\"cookieTest\"] = Time.now\n session[:return_to] = request.fullpath\n if cookies[\"cookie_test\"].blank?\n return false\n end\n return true\n end", "def cookies\n test_cookies\n end", "def cookies; end", "def cookies; end", "def cookies; end", "def cookies; end", "def cookies; end", "def cookies; end", "def cookies; end", "def cookies; @cookies ||= CookieJar.new; end", "def cookies # :doc:\n request.cookie_jar\n end", "def cookie_test\n\t\tif cookies[\"cookie_test\"].blank?\n\t\t\tlogger.warn(\"=== cookies are disabled\")\n\t\t\trender :template => \"shared/cookies_required\"\n\t\telse\n\t\t\tredirect_to(building_path)\n\t\tend\n\tend", "def cookies # :doc:\n request.cookie_jar\n end", "def init_cookies\n cookies[:language] = @language.code unless cookies[:language]\n cookies[:logged_in] = (admin? ? 'admin' : logged_in?.to_s) unless cookies[:logged_in]\n cookies.delete( :dont_cache ) if cookies[:dont_cache] and flash.empty? and request.request_uri =~ /^#{cookies[:dont_cache]}/\n end", "def has_auth_cookie?\n raise NotImplementedError\n end", "def has_auth_cookie?\n raise NotImplementedError\n end", "def session_store_type\n \"cookie\"\n end", "def cookies() @_cookies ||= ::Merb::Cookies.new(request.cookies, @_headers) end", "def cookie_jar; end", "def cookie_jar; end", "def cookie_jar; end", "def cookie_jar; end", "def cookies # :doc:\n request.cookie_jar\n end", "def needs_new_cookie?\n @_new_cookie\n end", "def cookies?\n cookies.length > 0\n end", "def cookies_required\n\t\treturn true unless cookies[\"cookie_test\"].blank?\n\t\tcookies[\"cookie_test\"] = Time.now\n\t\tsession[:return_to] = request.original_url\n\t\tredirect_to(cookie_test_path)\n\tend", "def cookies_required\n return true unless cookies[\"cookie_test\"].blank?\n cookies[\"cookie_test\"] = Time.now\n session[:return_to] = request.request_uri\n redirect_to(cookies_test_path)\n end", "def local_cookie?\n if File.exist?($CONF['cookie'])\n return true\n end\n false\nend", "def http_cookie\n http.cookie\n end", "def cookie_redirected?\n params[:cookies].present?\n end", "def cookie_valid?\n cookies[:clickfunnels_auth].present? && session[:user_id].present? && cookies[:clickfunnels_auth].to_s == session[:user_id].to_s\n end", "def cookies_test\n super\n end", "def logged_in?\n\t\tcookies[:cookie_id] ? true : false\n\n\tend", "def test_laptop_has_cookies\n end", "def cookies\n controller.respond_to?(:cookies, true) ? controller.send(:cookies) : nil\n end", "def cookie_jar=(cookie_jar); end", "def needs_new_cookie!\n @_new_cookie = true\n end", "def needs_new_cookie!\n @_new_cookie = true\n end", "def needs_new_cookie!\n @_new_cookie = true\n end", "def cookies\n @cookies_proxy ||= Class.new do\n attr_reader :controller, :response\n\n def initialize controller\n @controller, @response = controller, controller.response\n end\n\n # set cookie header\n #\n # @param [String, Symbol] key\n # @param [String, Hash] val\n # @return [Boolean]\n def []= key, val\n return if readonly?\n response.set_cookie key, val\n end\n\n # get cookie by key\n def [] key\n controller.orig_cookies[key]\n end\n\n # instruct browser to delete a cookie\n #\n # @param [String, Symbol] key\n # @param [Hash] opts\n # @return [Boolean]\n def delete key, opts ={}\n return if readonly?\n response.delete_cookie key, opts\n end\n\n # prohibit further cookies writing\n #\n # @example prohibit writing for all actions\n # before do\n # cookies.readonly!\n # end\n #\n # @example prohibit writing only for :render and :display actions\n # before :render, :display do\n # cookies.readonly!\n # end\n def readonly!\n @readonly = true\n end\n\n def readonly?\n @readonly\n end\n\n def method_missing *args\n controller.orig_cookies.send *args\n end\n end.new @ctrl\n end", "def probably_authenticated?\n request.cookie_jar[:bk_logged_in] == \"true\"\n end", "def session\n if Rails.env.test?\n cookies\n else\n super\n end\n end", "def collect_cookies_from_response; end", "def vote_cookie_for?(question)\n cookies[\"voted_for_#{question.id}\"] == '1'\n end", "def request_cookies\n Util.except!(@request.cookies.dup, *@config.ignored_cookies)\n end", "def logged_in?\n if request.cookies['userid']\n true\n else\n false\n end\n end", "def cookie\n @cookie ||= Coca::AuthCookie.new(cookies, scope)\n end", "def get_useful_cookies res\r\n set_cookie = res.headers['Set-Cookie']\r\n # Parse the Set-Cookie header\r\n parsed_cookies = CGI::Cookie.parse(set_cookie)\r\n\r\n # Clean up the cookies we got by:\r\n # * Dropping Path and Expires from the parsed cookies -- we don't care\r\n # * Dropping empty (reset) cookies\r\n %w(Path Expires).each do |ignore|\r\n parsed_cookies.delete ignore\r\n parsed_cookies.delete ignore.downcase\r\n end\r\n parsed_cookies.keys.each do |name|\r\n parsed_cookies[name].reject! { |value| value == '\"\"' }\r\n end\r\n parsed_cookies.reject! { |name,values| values.empty? }\r\n\r\n # the cookies always seem to start with CFAUTHORIZATION_, but\r\n # give the module the ability to log what it got in the event\r\n # that this stops becoming an OK assumption\r\n unless parsed_cookies.empty?\r\n vprint_status \"Got the following cookies after authenticating: #{parsed_cookies}\"\r\n end\r\n cookie_pattern = /^CF/\r\n useful_cookies = parsed_cookies.select { |name,value| name =~ cookie_pattern }\r\n if useful_cookies.empty?\r\n vprint_status \"No #{cookie_pattern} cookies found\"\r\n else\r\n vprint_status \"The following cookies could be used for future authentication: #{useful_cookies}\"\r\n end\r\n useful_cookies\r\n end", "def show_cookies\n if request.post? || params[:who] == 'peter'\n ls = cookies[LIFESIZE_COOKIE]\n if ls\n @cookie_value = JSON.pretty_generate(JSON.parse(Crypt.decrypt(ls)))\n else\n @cookie_value = \"lifesize cookie not set\"\n end\n @screen_cookie_value = cookies[SCREEN_COOKIE] ? cookies[SCREEN_COOKIE] : \"Screen cookie not set\"\n render :show_cookies\n else\n render :noaccess\n end\n end", "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "def do_not_set_cookie\n request.session_options[:skip] = true\n end", "def cookies\n call_once\n @cookies\n end", "def cookies(cookies); end", "def cookieMe\n if user_signed_in?\n cookies[:user_id] = current_user.id\n cookies[:user_token] = current_user.salt\n cookies[:user_username] = current_user.username\n cookies[:language] = current_user.language\n elsif !user_signed_in?()\n cookies.delete :user_id\n cookies.delete :user_token\n cookies.delete :user_username\n end\n end", "def cookie_domain?(domain, host_only = T.unsafe(nil)); end", "def cookies\n request.cookies\n end", "def cookie_persistence_method\n super\n end", "def fortune_cookie; end", "def cookies\r\n raise NotImplementedError, \"not currently supported by WatirNokogiri\"\r\n end", "def cookieMe\n if user_signed_in?\n cookies[:user_id] = current_user.id\n cookies[:user_token] = current_user.salt\n cookies[:user_username] = current_user.username\n cookies[:language] = current_user.language\n elsif !user_signed_in?()\n cookies.delete :user_id\n cookies.delete :user_token\n cookies.delete :user_username\n end\n end", "def set_cookies?\n ret = FormArray.new()\n self.header_data.each do |x|\n if x[0].upcase == \"SET-COOKIE\"\n ret << x[1].split(\";\").first.split(\"=\",2)\n end\n end\n ret\n end", "def auth_cookie\n cookies[:auth]\n end", "def get_cookies\n if cookies.signed[:name].present? && cookies.signed[:email].present?\n render json: { allow: true, name: cookies.signed[:name], email: cookies.signed[:email] }\n else\n render json: { allow: false }\n end\n end", "def cookies\n HTTY::CookiesUtil.cookies_from_string @headers[COOKIES_HEADER_NAME]\n end", "def warden_cookies\n warn \"warden_cookies was never functional and is going to be removed in next versions\"\n env['warden.cookies'] ||= {}\n end", "def cookie(name, value = nil, duration = 15)\n if value\n response.set_cookie name, { \n :value => value,\n :expires => Time.now + (60 * duration),\n :path => \"/\",\n :httponly => true,\n :secure => production?\n }\n else\n request.cookies[name]\n end\n end", "def accept_cookies\n if has_button_accept_cookies?\n button_accept_cookies.click\n end\n end", "def session_check\n cookies['safari_cookie_fix'] = 'cookie OK'\n true\n end", "def process_response(behavior, _)\n behavior[:cookies] == 'none' ?\n 'unset beresp.http.set-cookie;' :\n '# Allow set-cookie responses.'\nend", "def cookies\n request.cookies\n end", "def safari_cookie_settings\n return @safari_cookie_settings\n end", "def set_cookie(uri, sc)\n cookie = Cookie.new\n name, sc = sc.split '=', 2\n value, sc = sc.split ';', 2\n cookie.name, cookie.value = CGI::unescape(name), CGI::unescape(value)\n \n opts = {}\n sc && sc.split(';').each do |opt|\n opt, optval = opt.split '=', 2\n opts[opt.downcase] = (optval && CGI::unescape(optval)) || true\n end\n \n # restrict by domain-- not spec-compliant and possibly unsafe (allows \n # infinite levels of subdomains)\n if opts['domain'] && opts['domain'] != uri.host\n if opts['domain'].end_with?('.'+uri.host)\n cookie.domain = opts['domain']\n else\n return false\n end\n else\n cookie.domain = uri.host\n end\n \n if opts['path']\n cookie.path = opts['path']\n else\n # the resource path is the \"directory\" containing the request path\n ri = uri.path.rindex '/'\n cookie.path = ri ? uri.path[0..ri] : '/'\n end\n \n if opts['expires']\n begin\n cookie.expires = DateTime.parse opts['expires']\n rescue ArgumentError; end\n end\n \n cookie.secure = opts.has_key?('secure')\n \n @jar << cookie\n return true\n end", "def cookies\n @cookies ||= (self.headers[:set_cookie] || \"\").split('; ').inject({}) do |out, raw_c|\n key, val = raw_c.split('=')\n unless %w(expires domain path secure).member?(key)\n out[key] = val\n end\n out\n end\n end", "def cookie_expiration\n super\n end", "def user_visited_a_non_ssl_page_since_login?\n cookies[:insecure].nil? || cookies[:insecure] == true\n end", "def cookies\n request.cookies\n end", "def cookie\n self[HttpClient::SET_COOKIE]\n end", "def setUser\n cookies[:user_id]=current_user.id\n cookies[:is_tech]=current_user.tech\n end", "def valid_cookie?\n cookie = @handshake.headers['Cookie']\n puts \"Cookie: #{cookie}\"\n return false unless cookie\n end", "def cookie_path; end", "def has_auth_cookie?\n old_cookie = @request.cookies[OLD_TOKEN_COOKIE]\n new_cookie = @request.cookies[NEW_TOKEN_COOKIE]\n !old_cookie.nil? && !new_cookie.nil?\n end", "def set_cookie!\n cookies[:user_session] = {\n :value => token,\n :secure => controller.request.ssl?,\n :httponly => true,\n :expires => self.expires_at\n }\n end", "def is_cookie_token_valid?\n return true if self.class.els_options.has_key? 'faker'\n raise \"No cookies instance found\" if cookies.nil?\n token = cookies[self.class.els_options['cookie']]\n if token.nil? || !Runner.is_token_valid?(token,self.class.els_options)\n false\n else\n true\n end\n end", "def add_cookie_if_needed(req)\n req.headers = { \"Cookie\" => conn.headers[\"Cookie\"] } unless conn.headers[\"Cookie\"].nil?\n end", "def cookie(params = nil)\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"cookie \" + params.to_s + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "def web_browser_cookie_settings\n return @web_browser_cookie_settings\n end", "def has_auth_cookie?\n request = Rack::Request.new(@env)\n cookie = request.cookies[TOKEN_COOKIE]\n !cookie.nil? && cookie.length == 40\n end", "def cookie_name\n super\n end", "def session_dont_remember\n httpsession = Thread.current[:hayabusa][:httpsession]\n raise \"Could not figure out HTTP-session.\" if !httpsession\n session = httpsession.session\n raise \"Could not get session-variable from HTTP-session.\" if !session\n session[:remember] = 0\n \n self.cookie(\n \"name\" => \"HayabusaSession\",\n \"value\" => _httpsession.session_id,\n \"path\" => \"/\"\n )\n end", "def create_session_cookie_if_needed\n if !params[:fb_sig_in_iframe].blank? && cookies[ActionController::Base.session_options[:key]].nil?\n @handle_url = url_for(\"/fb_session/set?request_path=\" + URI::escape(non_fb_params, \"/=!?&\"))\n render :layout => \"fb_session\", :template => \"fb_session/cookie_handling\"\n end\n end", "def cookie\n # 'frontend=aaa'\n nil\n end", "def visitor_registered?\n cookies[self.class.read_inheritable_attribute(:cookie_name)].nil? == false\n end", "def cookie_value; end", "def cookies\n rack_request.cookies\n end", "def valid_cookie?\n if (decrypted_cookie_value = IiifAuthService.decrypt_cookie(cookies[\"bearer_token\"]))\n valid_cookie_date?(decrypted_cookie_value)\n else\n false\n end\n end", "def set_pickup_cookies!\n if @pickup\n cookies[:pickup_id] = @pickup.id\n cookies[:key] = @pickup.key\n elsif params[:pickup_id] && params[:key]\n cookies[:pickup_id] = params[:pickup_id]\n cookies[:key] = params[:key]\n end\n end", "def cookies\n @request.cookies\n end", "def getCookie()\n return @cookie\n\tend" ]
[ "0.76650417", "0.75777227", "0.70494753", "0.69706666", "0.69706666", "0.69706666", "0.69706666", "0.69706666", "0.69706666", "0.69706666", "0.695557", "0.6807186", "0.6799025", "0.6770178", "0.6764302", "0.6694582", "0.6694582", "0.6690253", "0.66819286", "0.66791683", "0.66791683", "0.66791683", "0.66791683", "0.66785383", "0.662831", "0.66236836", "0.66067666", "0.65870124", "0.6567874", "0.64950675", "0.64736223", "0.64672744", "0.6416643", "0.64058155", "0.6402288", "0.6401081", "0.63901144", "0.6386608", "0.6386608", "0.6386608", "0.63720024", "0.63701636", "0.636877", "0.63404644", "0.63400596", "0.63313466", "0.63132924", "0.6311781", "0.63084346", "0.6297099", "0.62954366", "0.62954366", "0.62954366", "0.6272654", "0.62632596", "0.6258038", "0.6255943", "0.62458277", "0.6213151", "0.62123305", "0.6207141", "0.6193856", "0.6191389", "0.61686754", "0.61414945", "0.6136182", "0.61346847", "0.61137086", "0.6113586", "0.6110021", "0.61082125", "0.61075944", "0.61017877", "0.6094213", "0.6080187", "0.60799277", "0.60509455", "0.6045097", "0.60350966", "0.60325325", "0.60227114", "0.6022023", "0.60202986", "0.6020145", "0.60163516", "0.59988123", "0.59985256", "0.5979649", "0.5977715", "0.59706545", "0.5963689", "0.59626687", "0.59624815", "0.5958637", "0.59429866", "0.5925913", "0.5911965", "0.59007865", "0.5896847", "0.58948666" ]
0.75971156
1
Assign a User Agent header.
def user_agent= new_ua @headers['User-Agent'] = new_ua && Kronk.config[:user_agents][new_ua.to_s] || new_ua || Kronk::DEFAULT_USER_AGENT end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent(agent)\n headers.update 'User-Agent' => agent\n end", "def headers=(headers)\n @headers = headers.merge({\"User-Agent\" => user_agent})\n end", "def user_agent= user_agent\n @agent.user_agent = user_agent\n end", "def init_user_agent(options)\n @headers ||= {}\n @headers['User-Agent'] = options[:user_agent] || default_user_agent\n end", "def user_agent=(user_agent); end", "def user_agent(user_agent)\n @user_agent = user_agent\n end", "def user_agent=(user_agent)\n @attributes[\"user_agent\"] = user_agent\n end", "def useragent=(value)\n Curl.set_option(:useragent, value_for(value, :string), handle)\n end", "def user_agent=(name)\n @user_agent = USER_AGENT[name] || USER_AGENT['bot']\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def setUserAgent(agent)\n @helper.setUserAgent(agent)\n self\n end", "def user_agent=(user_agent)\n @request_headers['User-Agent'] = user_agent\n @request = Net::HTTP::Get.new(@uri.request_uri, @request_headers)\n end", "def set_user_agent_override(user_agent:, accept_language: nil, platform: nil)\n {\n method: \"Emulation.setUserAgentOverride\",\n params: { userAgent: user_agent, acceptLanguage: accept_language, platform: platform }.compact\n }\n end", "def set_header(header, value)\n @lunetas_headers[header.to_s] = value\n end", "def agent_header=(agent_header)\n self.agent = \"Gricer::#{model_type}::Agent\".constantize.find_or_create_by request_header: agent_header\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def default_header\n {\n \"User-Agent\" => user_agent\n }\n end", "def user_agent\n @headers['User-Agent']\n end", "def user_agent\n @headers['User-Agent']\n end", "def user_agent\n @headers['User-Agent']\n end", "def headers\n { 'User-Agent' => user_agent }\n end", "def user_agent\n headers[\"HTTP_USER_AGENT\"] || headers[\"USER-AGENT\"]\n end", "def user_agent_on_header\n request.headers['HTTP_USER_AGENT']\n end", "def user_agent(value)\n value || DEFAULT_USER_AGENT\n end", "def user_agent_alias= name\n self.user_agent = AGENT_ALIASES[name] ||\n raise(ArgumentError, \"unknown agent alias #{name.inspect}\")\n end", "def initialize(user_agent)\n self.class.headers 'User-Agent' =>\n \"#{user_agent} CWSrb/#{Cwsrb::VERSION} (#{RUBY_ENGINE}/#{RUBY_VERSION}p#{RUBY_PATCHLEVEL})\"\n end", "def user_agent_alias=(name); end", "def convert_user_agent(value, definition)\n value # TODO\n end", "def header=(value)\n @header = Mail::Header.new(value, charset)\n end", "def user_agent\n @user_agent || USER_AGENT\n end", "def user_agent\n @user_agent || USER_AGENT\n end", "def make_headers(user_headers); end", "def setUseMobileUserAgent(value)\n @fields['use_mobile_user_agent'] = value\n self\n end", "def setUseMobileUserAgent(value)\n @fields['use_mobile_user_agent'] = value\n self\n end", "def set_header key, value\n headers.update(key => value)\n end", "def set_user(user)\n agent&.set_user(user)\n end", "def request_headers= request_headers\n @agent.request_headers = request_headers\n end", "def []=(header, value)\n @headers[header] = value\n end", "def headers\n super\n @headers['User-Agent'] = \"Recurly Ruby Client v#{VERSION}\"\n @headers\n end", "def user_agent (value = nil)\n\t\tif value\n\t\t\traise_if_error C.glyr_opt_useragent(to_native, value)\n\t\telse\n\t\t\tto_native[:useragent]\n\t\tend\n\tend", "def user_agent(string)\n string = string.to_s\n return nil if string.empty?\n UserAgent.new(string)\n end", "def set_header(name, value)\n @headers[name] = value\n \n return self\n end", "def agent\n @agent ||= Sawyer::Agent.new('', sawyer_options) do |http|\n http.headers[:user_agent] = user_agent\n end\n end", "def set_header name, value\n response_object.header name, value\n end", "def set_header(auth_headers)\n header 'access-token', auth_headers['access-token']\n header 'token-type', auth_headers['token-type']\n header 'client', auth_headers['client']\n header 'expiry', auth_headers['expiry']\n header 'uid', auth_headers['uid']\nend", "def headers\n {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'}\n end", "def convert_user_agent(value, _definition)\n value == '-' ? nil : value\n end", "def user_agent\n \"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3\"\n end", "def header=(hdr)\n order_check(hdr)\n hdr.each {|s| raise \"Header must contain strings\" if ! s.kind_of? String }\n @header = hdr\n end", "def add_header(header)\n @headers.merge!(header)\n end", "def user_agent(vendor: T.unsafe(nil)); end", "def user_agent\n self.class.user_agent ||= USER_AGENTS.shuffle.first\n end", "def convert_user_agent(value, definition)\n value == '-' ? nil : value\n end", "def user_agent\n @data[\"user_agent\"]\n end", "def get_user_agent\n user_agent\n end", "def user_agent; end", "def user_agent; end", "def user_agent; end", "def configure(builder)\n builder.headers[:user_agent] = @user_agent\n builder.headers[:'X-Asana-Client-Lib'] = header\n end", "def set_client(user_agent_string)\n user_agent = AgentOrange::UserAgent.new(user_agent_string)\n device = user_agent.device\n if device.is_mobile?\n self.client = device.platform\n self.version = device.platform.version\n else device.is_computer?\n self.client = device.engine.browser.name\n self.version = device.engine.browser.version\n end\n end", "def user_agent\n @request['User-Agent']\n end", "def header(value = nil)\n value ? self.header = value : @header\n end", "def user_agent\n @request[FUA]\n end", "def default_headers\n {\n user_agent: \"Unloq ruby gem #{Unloq::VERSION}\"\n }\n end", "def []=(key, value)\n @header[key] = value\n end", "def append_user_agent_to_params\n params[:browser_user_agent] = http_user_agent\n end", "def user_agent\n @agent.user_agent\n end", "def generate_user_agent(extra_ids = [])\n agent_app = @config.read('authentication.user_agent')\n extra_ids << ['AwApi-Ruby/%s' % YahooAdApi::ApiConfig::CLIENT_LIB_VERSION]\n super(extra_ids, agent_app)\n end", "def add_user_agent_information(additional_user_agent_information)\n @user_agent_extended.push(additional_user_agent_information)\n end", "def ua\n @ua ||= begin\n request.env['HTTP_USER_AGENT'].downcase\n rescue\n ''\n end\n end", "def user_agent\n @options[:user_agent] || \"Ruby Twitter Gem\"\n end", "def initialize\n @headers = {\"User-Agent\" => \"cookies\"}\n end", "def http_user_agent\n # User agent is required for cookie validation\n request.env['HTTP_USER_AGENT'].to_s\n end", "def header(name, value = nil)\n if value\n (@headers ||= {})[name] = value\n else\n (@headers || {})[name]\n end\n end", "def initialize(user_agent_string)\n @user_agent = user_agent_string\n end", "def agent_alias value\n\t\tself.out \"agent_alias #{value}\"\n\t\t@agent.user_agent_alias = value#'Mac Safari' \n\tend", "def generate_token user_agent\n @browser_token_db.add user_agent\n end", "def generate_user_agent(extra_ids = [])\n agent_app = @config.read('authentication.user_agent')\n extra_ids << ['AwApi-Ruby/%s' % BingAdsApi::ApiConfig::CLIENT_LIB_VERSION]\n super(extra_ids, agent_app)\n end", "def use_agent=(use_agent); end", "def user_agent\n kernel = Facter[:kernel] ? Facter[:kernel].value : 'unknown'\n kvers = Facter[:kernelversion] ? Facter[:kernelversion].value : 'unknown'\n values = {\n 'razor' => MK::VERSION,\n 'facter' => Facter.version, # sigh\n 'ruby' => RUBY_VERSION,\n 'kernel' => \"#{kernel}-#{kvers}\"\n }.reject{|k,v| v.nil?}.map{|k,v| k+'/'+v}.join(' ')\n end", "def header=(header)\n @header = header\n end", "def []=(name, value)\n if name.to_s == 'body'\n self.body = value\n elsif name.to_s =~ /content[-_]type/i\n header[name] = value\n elsif name.to_s == 'charset'\n self.charset = value\n else\n header[name] = value\n end\n end", "def some_user_agent\n \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090920 Firefox/3.5.3 (Swiftfox)\"\n end", "def set_request_headers!(request); end", "def []=(key, value)\n @headers[key] = value\n end" ]
[ "0.79428893", "0.79428893", "0.79428893", "0.79428893", "0.79428893", "0.7754459", "0.7345348", "0.728267", "0.72204864", "0.6961458", "0.69581014", "0.6951192", "0.6935251", "0.6672569", "0.66488934", "0.66488934", "0.66488934", "0.66488934", "0.66488934", "0.66488934", "0.66488934", "0.65788394", "0.6537756", "0.6519617", "0.64186674", "0.6382895", "0.6382895", "0.6382895", "0.6382895", "0.6382895", "0.6373888", "0.633763", "0.633763", "0.633763", "0.6278447", "0.6264228", "0.6226483", "0.6216245", "0.61783785", "0.6099448", "0.60495526", "0.6011614", "0.5990456", "0.59875673", "0.59875673", "0.5983844", "0.59699476", "0.59699476", "0.596987", "0.5960413", "0.5930822", "0.5878695", "0.5857612", "0.5816478", "0.5803772", "0.57959896", "0.5789896", "0.57501715", "0.57407886", "0.5642045", "0.56381595", "0.5631007", "0.56165755", "0.56139654", "0.55947775", "0.5594508", "0.5592111", "0.55919254", "0.55912775", "0.5577753", "0.5577753", "0.5577753", "0.55662775", "0.55538416", "0.5541041", "0.5539637", "0.5530982", "0.55203444", "0.55123943", "0.548921", "0.5482417", "0.5479049", "0.54786944", "0.54745", "0.54491216", "0.54296", "0.5416735", "0.5414526", "0.54053444", "0.5405308", "0.53911215", "0.5380413", "0.5369561", "0.5365875", "0.53619516", "0.5348555", "0.5344676", "0.5343237", "0.5336177" ]
0.7616488
7
Read the User Agent header.
def user_agent @headers['User-Agent'] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_agent\n @data[\"user_agent\"]\n end", "def user_agent\n @request['User-Agent']\n end", "def user_agent_on_header\n request.headers['HTTP_USER_AGENT']\n end", "def user_agent\n headers[\"HTTP_USER_AGENT\"] || headers[\"USER-AGENT\"]\n end", "def get_user_agent\n user_agent\n end", "def http_user_agent\n # User agent is required for cookie validation\n request.env['HTTP_USER_AGENT'].to_s\n end", "def getUserAgent()\n\t\t\tUSER_AGENT\n\t\tend", "def user_agent\n @agent.user_agent\n end", "def user_agent\n @request[FUA]\n end", "def ua\n @ua ||= begin\n request.env['HTTP_USER_AGENT'].downcase\n rescue\n ''\n end\n end", "def user_agent\n @user_agent || USER_AGENT\n end", "def user_agent\n @user_agent || USER_AGENT\n end", "def user_agent; end", "def user_agent; end", "def user_agent; end", "def user_agent(agent)\n headers.update 'User-Agent' => agent\n end", "def user_agent\n \"Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3B48b Safari/419.3\"\n end", "def some_user_agent\n \"Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.3) Gecko/20090920 Firefox/3.5.3 (Swiftfox)\"\n end", "def user_agent\n kernel = Facter[:kernel] ? Facter[:kernel].value : 'unknown'\n kvers = Facter[:kernelversion] ? Facter[:kernelversion].value : 'unknown'\n values = {\n 'razor' => MK::VERSION,\n 'facter' => Facter.version, # sigh\n 'ruby' => RUBY_VERSION,\n 'kernel' => \"#{kernel}-#{kvers}\"\n }.reject{|k,v| v.nil?}.map{|k,v| k+'/'+v}.join(' ')\n end", "def user_agent (value = nil)\n\t\tif value\n\t\t\traise_if_error C.glyr_opt_useragent(to_native, value)\n\t\telse\n\t\t\tto_native[:useragent]\n\t\tend\n\tend", "def parse_agent(header)\n # First of all match the agent and the version\n catch(:result) do\n Brauser::Definitions.browsers.each do |_, definition|\n result = definition.match(header)\n throw(:result, result) if result\n end\n\n nil\n end\n end", "def browser_info\n # Fetch the UserAgent string using javascript navigator object\n ua_string = browser.execute_script('return navigator.userAgent')\n @parsed_ua = UserAgent.parse(ua_string)\n end", "def headers\n { 'User-Agent' => user_agent }\n end", "def getUserAgent()\n printDebugMessage('getUserAgent', 'Begin', 11)\n clientRevision = '$Revision$'\n clientVersion = '0'\n if clientRevision.length > 11\n clientVersion = clientRevision[11..-3]\n end\n userAgent = \"EBI-Sample-Client/#{clientVersion} (#{self.class.name}; Ruby #{RUBY_VERSION}; #{RUBY_PLATFORM}) \"\n printDebugMessage('getUserAgent', \"userAgent: #{userAgent}\", 11)\n printDebugMessage('getUserAgent', 'End', 11)\n return userAgent\n end", "def getUserAgent()\n printDebugMessage('getUserAgent', 'Begin', 11)\n clientRevision = '$Revision$'\n clientVersion = '0'\n if clientRevision.length > 11\n clientVersion = clientRevision[11..-3]\n end\n userAgent = \"EBI-Sample-Client/#{clientVersion} (#{self.class.name}; Ruby #{RUBY_VERSION}; #{RUBY_PLATFORM}) \"\n printDebugMessage('getUserAgent', \"userAgent: #{userAgent}\", 11)\n printDebugMessage('getUserAgent', 'End', 11)\n return userAgent\n end", "def get_user_agent\n # If `browser` method is called from a rails view\n if defined?(controller)\n controller.view_context.request.user_agent\n\n # Else `browser` method was called from a ruby component\n elsif defined?(view_context)\n view_context.request.user_agent\n end\n end", "def user_agent= new_ua\n @headers['User-Agent'] =\n new_ua && Kronk.config[:user_agents][new_ua.to_s] ||\n new_ua || Kronk::DEFAULT_USER_AGENT\n end", "def user_agent= new_ua\n @headers['User-Agent'] =\n new_ua && Kronk.config[:user_agents][new_ua.to_s] ||\n new_ua || Kronk::DEFAULT_USER_AGENT\n end", "def user_agent\n ENV[\"CHEF_API_USER_AGENT\"] || config[\"CHEF_API_USER_AGENT\"] || USER_AGENT\n end", "def user_agent=(user_agent); end", "def user_agent_string\n user_agent_tokens.reverse.join(' ')\n end", "def default_header\n {\n \"User-Agent\" => user_agent\n }\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def initialize user_agent\n @user_agent = user_agent.strip\n end", "def user_agent(string)\n string = string.to_s\n return nil if string.empty?\n UserAgent.new(string)\n end", "def user_agent(user_agent)\n @user_agent = user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def user_agent=(user_agent)\n @user_agent = user_agent\n @default_headers['User-Agent'] = @user_agent\n end", "def headers\n {'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36'}\n end", "def user_agent\n [\n \"#{config.application_name}/#{config.application_version}\",\n \"google-api-ruby-client/#{Google::APIClient::VERSION::STRING}\",\n Google::APIClient::ENV::OS_VERSION,\n '(gzip)'\n ].join(' ').delete(\"\\n\")\n end", "def os\n Agent.os_for_user_agent string\n end", "def user_agent(value)\n value || DEFAULT_USER_AGENT\n end", "def name\n Agent.name_for_user_agent string\n end", "def user_agent=(user_agent)\n @request_headers['User-Agent'] = user_agent\n @request = Net::HTTP::Get.new(@uri.request_uri, @request_headers)\n end", "def default_user_agent\n \"#{NAME}/#{VERSION} (Ruby/#{RUBY_VERSION})\"\n end", "def detect_browser(http_user_agent)\n result = http_user_agent\n if result =~ /Safari/\n if result =~ /Chrome/\n version = result.split('Chrome/')[1].split(' ').first.split('.').first\n browser = 'Chrome'\n else\n browser = 'Safari'\n version = result.split('Version/')[1].split(' ').first.split('.').first\n end\n elsif result =~ /Firefox/\n browser = 'Firefox'\n version = result.split('Firefox/')[1].split('.').first\n elsif result =~ /Opera/\n browser = 'Opera'\n version = result.split('Version/')[1].split('.').first\n elsif result =~ /MSIE/\n browser = 'MSIE'\n version = result.split('MSIE')[1].split(' ').first\n end\n\n [browser,version]\n end", "def agent\n @agent ||= Sawyer::Agent.new('', sawyer_options) do |http|\n http.headers[:user_agent] = user_agent\n end\n end", "def user_agent\n self.class.user_agent ||= USER_AGENTS.shuffle.first\n end", "def user_agent\n @options[:user_agent] || \"Ruby Twitter Gem\"\n end", "def ua_parser(agent)\n # Load all user agent data / regexp / patterns once\n @ua ||= UserAgentParser::Parser.new\n @ua.parse(agent)\n end", "def user_agent\n \"SocketLabs-ruby/#{VERSION};ruby(#{RUBY_VERSION})\"\n end", "def agent\n anonymous? ? nil : user.agent\n end", "def init_user_agent(options)\n @headers ||= {}\n @headers['User-Agent'] = options[:user_agent] || default_user_agent\n end", "def read_headers!; end", "def ua_string\n window.execute_script('navigator.userAgent')\n end", "def user_agent\n if defined?(::RUBY_VERSION) && defined?(::RUBY_PLATFORM)\n ruby_description = \"(ruby #{::RUBY_VERSION} #{::RUBY_PLATFORM}) \" # NOTE: the trailing space!\n end\n zlib_version = \"zlib/#{Zlib.zlib_version}\" if defined?(::Zlib) && Zlib.respond_to?(:zlib_version)\n \"NewRelic-RubyAgent/#{NewRelic::VERSION::STRING} #{ruby_description}#{zlib_version}\"\n end", "def read_headers\n @app_environment = request.headers[\"x-vendor-appEnvironment\"]\n @app_version = request.headers[\"x-vendor-appVersion\"]\n end", "def parse_header_contents; end", "def user_agent=(name)\n @user_agent = USER_AGENT[name] || USER_AGENT['bot']\n end", "def os_parser\n @os_parser ||= DoubleAgent.os_parser(user_agent)\n end", "def user_agent(vendor: T.unsafe(nil)); end", "def harvest_user_agent\n return \"TimeTrackingConsolidator (patel.aneeesh@gmail.com)\"\n end", "def useragent=(value)\n Curl.set_option(:useragent, value_for(value, :string), handle)\n end", "def user_agent_match(req, pattern)\n req.user_agent && req.user_agent[pattern]\n end", "def user_agent=(user_agent)\n @attributes[\"user_agent\"] = user_agent\n end", "def user_agent\n ruby_description = ''\n # note the trailing space!\n ruby_description << \"(ruby #{::RUBY_VERSION} #{::RUBY_PLATFORM}) \" if defined?(::RUBY_VERSION) && defined?(::RUBY_PLATFORM)\n zlib_version = ''\n zlib_version << \"zlib/#{Zlib.zlib_version}\" if defined?(::Zlib) && Zlib.respond_to?(:zlib_version)\n \"NewRelic-RubyAgent/#{NewRelic::VERSION::STRING} #{ruby_description}#{zlib_version}\"\n end", "def user_agent= user_agent\n @agent.user_agent = user_agent\n end", "def iphone_user_agent?\n request.env[\"HTTP_USER_AGENT\"] && request.env[\"HTTP_USER_AGENT\"][/(Mobile\\/.+Safari)/]\n end", "def browser_version\n browser_parser.version(user_agent)\n end", "def header_user_agent\n { \"User-Agent\" => \"Kinetic Ruby SDK #{KineticSdk.version}\" }\n end", "def engine\n Agent.engine_for_user_agent string\n end", "def user_agent\n 'eventful-ruby/%s (Rubygems; Ruby %s %s)' % [Eventful::VERSION, RUBY_VERSION, RUBY_PLATFORM]\n end", "def get_agent\n\t\tagent = Mechanize.new { |agent| agent.user_agent_alias = 'Mac Safari' }\n\tend", "def cgi_parse_header(line); end", "def browser\n Browser.new(user_agent)\n end", "def iphone_user_agent?\n request.env[\"HTTP_USER_AGENT\"] &&\n request.env[\"HTTP_USER_AGENT\" ][/(Mobile\\/.+Safari)/]\n end", "def iphone_user_agent?\n request.env[\"HTTP_USER_AGENT\"] && request.env[\"HTTP_USER_AGENT\"][/(Mobile\\/.+Safari)/]\n end", "def iphone_user_agent?\n request.env[\"HTTP_USER_AGENT\"] && request.env[\"HTTP_USER_AGENT\"][/(Mobile\\/.+Safari)/]\n end", "def iphone_user_agent?\n request.env[\"HTTP_USER_AGENT\"] && request.env[\"HTTP_USER_AGENT\"][/(Mobile\\/.+Safari)/]\n end", "def browser_version\n return 0.0 if not request.env['HTTP_USER_AGENT']\n if browser_is('ie')\n return request.env['HTTP_USER_AGENT'].match(/^.*?MSIE ([0-9]+.[0-9]){1}.*?/)[1].to_f\n end\n if browser_is('mozilla')\n return request.env['HTTP_USER_AGENT'].match(/^.*?Firefox\\/([0-9]+.[0-9]){1}.*?/)[1].to_f\n end\n if browser_is('webkit')\n return request.env['HTTP_USER_AGENT'].match(/^.*?Safari\\/([\\d]+\\.[\\d]+[\\.\\d]*)?/)[1].to_f\n end\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 read_header\n\t@bytes_to_be_read = 0\n\tread_mt_header_string(MThd_BYTE_ARRAY, @skip_init) # \"MThd\"\n\n\t@bytes_to_be_read = read32()\n\tformat = read16()\n\tntrks = read16()\n\tdivision = read16()\n\n\theader(format, ntrks, division)\n\n\t# Flush any extra stuff, in case the length of the header is not 6\n\tif @bytes_to_be_read > 0\n get_bytes(@bytes_to_be_read)\n @bytes_to_be_read = 0\n\tend\n\n\treturn ntrks\n end", "def user_agent\n \"PriceHubbleGem/#{PriceHubble::VERSION}\"\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 browser_parser\n @browser_parser ||= DoubleAgent.browser_parser(user_agent)\n end", "def get_useragent(hid = false, no_flash = false)\n if get_carrier() != CARRIER_DOCOMO || hid == false || (not has_key?(:hid))\n return @props[:useragent]\n end\n\n ua = @props[:useragent].dup\n unless ua.to_s == ''\n if ua =~ /DoCoMo\\/1.0/ # PDC\n ua.concat '/' + self['hid'] unless self['hid'].nil?\n else # FOMA\n param_start = ua.index('(')\n ua = ua[0, param_start] unless param_start.nil?\n\n ua.concat '(c100;TB'\n ua.concat ';' + self[:hid]\n ua.concat ';' + self[:icc] if has_key?(:icc)\n ua.concat ')'\n\n # ua.gsub!(/;TB/, ';TC') unless no_flash\n end\n end\n return ua\n end", "def client_browser_name \n user_agent = (request.env['HTTP_USER_AGENT'] || \"\").downcase \n if user_agent =~ /msie/i \n \"Internet Explorer\" \n elsif user_agent =~ /applewebkit/i \n \"Safari\" \n elsif user_agent =~ /konqueror/i \n \"Konqueror\" \n elsif user_agent =~ /gecko/i \n \"Mozilla\" \n elsif user_agent =~ /opera/i \n \"Opera\" \n else \n \"Unknown\" \n end \n end", "def bot_user_agent(vendor: T.unsafe(nil)); end", "def request_headers\n @agent.request_headers\n end", "def user_agent\n # This particular string is required by the Discord devs.\n required = \"DiscordBot (https://github.com/meew0/discordrb, v#{Discordrb::VERSION})\"\n @bot_name ||= ''\n\n \"rest-client/#{RestClient::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION}p#{RUBY_PATCHLEVEL} discordrb/#{Discordrb::VERSION} #{required} #{@bot_name}\"\n end", "def user_agent\n # This particular string is required by the Discord devs.\n required = \"DiscordBot (https://github.com/meew0/discordrb, v#{Discordrb::VERSION})\"\n @bot_name ||= ''\n\n \"rest-client/#{RestClient::VERSION} #{RUBY_ENGINE}/#{RUBY_VERSION}p#{RUBY_PATCHLEVEL} discordrb/#{Discordrb::VERSION} #{required} #{@bot_name}\"\n end", "def user_system_info\n {\n :system => NoPlanB::HttpHeaderUtils.extract_system_info(request.env['HTTP_USER_AGENT']),\n :browser => NoPlanB::HttpHeaderUtils.extract_browser_info(request.env['HTTP_USER_AGENT']),\n :ip_address => request.remote_ip\n }\n end" ]
[ "0.75735027", "0.7495876", "0.74563426", "0.73740244", "0.736895", "0.71271586", "0.7113645", "0.70372796", "0.7019833", "0.6938536", "0.6914303", "0.6914303", "0.6867195", "0.6867195", "0.6867195", "0.6812859", "0.68037176", "0.6702099", "0.6489713", "0.6386898", "0.63736516", "0.635829", "0.635427", "0.63292843", "0.63292843", "0.63075787", "0.62909484", "0.62909484", "0.6215151", "0.62084824", "0.62056506", "0.61554414", "0.6147542", "0.6147542", "0.6147542", "0.6147542", "0.6147542", "0.6106021", "0.6069586", "0.6065476", "0.6065476", "0.6065476", "0.6065476", "0.6065476", "0.60548955", "0.6047832", "0.6042657", "0.6025964", "0.5994447", "0.5973492", "0.5963347", "0.593858", "0.5936755", "0.5928996", "0.59234864", "0.59205526", "0.59111977", "0.5894284", "0.58940035", "0.58925575", "0.58877337", "0.5879771", "0.5853535", "0.58399564", "0.5831542", "0.5764192", "0.5734558", "0.57206565", "0.56962645", "0.5681365", "0.5681078", "0.56625026", "0.5661728", "0.56565857", "0.56549126", "0.56405365", "0.55924076", "0.5560382", "0.5557975", "0.55542755", "0.55471796", "0.553366", "0.55241287", "0.55241287", "0.55241287", "0.5520196", "0.55199456", "0.5497943", "0.5479719", "0.5473702", "0.5468814", "0.5458523", "0.5419435", "0.54092294", "0.5409196", "0.5401724", "0.5401724", "0.53989923" ]
0.79317075
2
Check if this is an SSL request.
def ssl? @uri.scheme == "https" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ssl?\n return @request_uri.scheme == \"https\"\n end", "def ssl?\n @url.scheme == 'https'\n end", "def ssl?\n uri.scheme == 'https'\n end", "def ssl?\n uri.scheme == 'https'\n end", "def ssl?\n uri_endpoint.scheme == 'https'\n end", "def ssl?\n @headers[\"HTTPS\"] == \"on\"\n end", "def ssl?\n ssl.present?\n end", "def ssl_allowed?\n\t\tnot ssl_required?\n\tend", "def ssl?\n ssl\n end", "def ssl_required?\n ssl_actions_include_current_action(:ssl_required_actions)\n end", "def ssl_required?\n\t if get_config(\"SSL\") == \"true\"\n\t true\n\t else\n\t false\n\t end\n\t end", "def ssl?\n @api_scheme == 'https'\n end", "def ssl_required?\n\t if get_config(\"SSL\") == \"true\"\n\t true\n\t else\n\t false\n\t end\n end", "def ssl_required?\n if get_config(\"SSL\") == \"true\"\n true\n else\n false\n end\n end", "def valid_ssl_connection?\n return !@https.nil? && @https != false \n end", "def ssl?\n return @ssl\n end", "def ssl?\n !!(@socket.respond_to?(:context) && @socket.context)\n end", "def ssl_required?\r\n true\r\n end", "def ssl_request?(env)\n if env['HTTPS'] == 'on'\n 'https'\n elsif env['HTTP_X_FORWARDED_PROTO']\n env['HTTP_X_FORWARDED_PROTO'].split(',')[0]\n else\n env['rack.url_scheme']\n end == 'https'\n end", "def ssl_required?\n HTTPS_ON\n end", "def ssl?\n @transport_mode == '~'\n end", "def ssl?\n\t\treturn self.scheme == 'https'\n\tend", "def ssl?\n return ssl\n end", "def ssl_required?\n !disable_ssl?\n end", "def is_ssl\n # TS_INFO: Returns true always\n # if ( isset( $_SERVER['HTTPS'] ) ) {\n # if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) {\n # return true;\n # }\n #\n # if ( '1' == $_SERVER['HTTPS'] ) {\n # return true;\n # }\n # } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {\n # return true;\n # }\n # return false;\n true\n end", "def use_ssl?\n use_ssl\n end", "def is_ssl?(url)\n\t\tputs \"Validate if SSL is enabled on: #{url}\" if @verbose\n\t\tbegin\n\t\t\turl=url.strip\n\t\t\tif is_url?(url) && url =~ /https/i\n\t\t\t\treturn true\n\t\t\telse\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 false\n\t\tend\n\tend", "def ssl_required?\n true\n end", "def ssl_allowed?\n (self.class.read_inheritable_attribute(:ssl_allowed_actions) || []).include?(action_name.to_sym) ||\n request.path.index(\"/zz_api/\") == 0\n end", "def ssl?\n @j_del.isSsl\n end", "def use_ssl\n if query\n ssl_query = query.split('&').each.select do |q|\n q.start_with?('use_ssl=')\n end.first\n ssl_query == 'use_ssl=true'\n else\n true\n end\n end", "def ssl_required?\n return ENV['SSL'] == 'on' ? true : false if defined? ENV['SSL']\n return false if local_request?\n return false if RAILS_ENV == 'test'\n ((self.class.read_inheritable_attribute(:ssl_required_actions) || []).include?(action_name.to_sym)) && (::Rails.env == 'production' || ::Rails.env == 'staging')\n end", "def ssl_required_with_supported?\n ssl_supported? ? ssl_required_without_supported? : false\n end", "def ssl_required_with_supported?\n ssl_supported? ? ssl_required_without_supported? : false\n end", "def use_ssl?\n @ssl\n end", "def ssl_required?\n (self.class.read_inheritable_attribute(:ssl_required_actions) || []).include?(action_name.to_sym)\n end", "def secure?\n # X-Scheme is set by nginx\n # X-FORWARDED-PROTO is set by elastic load balancer\n (req.env['HTTP_X_FORWARDED_PROTO'] == 'https' || req.env['HTTP_X_SCHEME'] == \"https\")\n end", "def ssl_enabled?\n\t\t\tssl && ssl_on\n\t\tend", "def ssl_required?\n (APP_CONFIG['use_https'] and !session[:user_id].nil?)\n end", "def usessl?\n @usessl\n end", "def supports_ssl?\n false\n end", "def ssl?\n https? || socks4? || socks5?\n end", "def ssl?\n https? || socks4? || socks5?\n end", "def ssl_installed?\n !domain.blank? && !ssl_key.blank? && !ssl_cert.blank?\n end", "def ssl_required?\n (Rails.env == 'production' || Rails.env == 'staging') && configuration(:require_ssl)\n end", "def ensure_proper_protocol\n if !request.ssl? && USE_SSL && ssl_required?\n redirect_to :protocol => 'https://', :action => action_name\n return false\n end\n return true\n end", "def ssl?; end", "def ssl?; end", "def force_ssl?\n @force_ssl || false\n end", "def use_ssl?\n self.class.use_ssl || false\n end", "def supports_ssl?\n\t false\n\tend", "def secure?\n @uri.port == 443\n end", "def https?(uri)\n uri.instance_of?(URI::HTTPS)\n end", "def secure?\r\n s = servlet_response.isSecure\r\n $log.debug(\"is https? #{s}\")\r\n s\r\n end", "def require_ssl\n return_error(error_code: 403, message: 'HTTPS Required') unless request.secure?\n end", "def verify_ssl\n true\n end", "def use_ssl?\n port.to_i == 443\n end", "def ssl_required\n @attributes[:ssl_required]\n end", "def require_ssl\n if request.ssl? or Rails.env == 'development' \n true\n else\n redirect_to({:protocol => 'https://'}.merge(params), :flash => flash)\n false\n end\n end", "def ssl_allowed_with_app_config?\n !ssl_required? && AppConfig.use_ssl && (self.class.read_inheritable_attribute(:ssl_allowed_actions) == [] || ssl_allowed_without_app_config?)\n end", "def ssl_verify\n @ssl_verify || true\n end", "def ssl_configured?\n Rails.env.production? && request.path != '/cable'\n end", "def cert_request_valid?(cert_request)\n begin\n OpenSSL::X509::Request.new cert_request\n rescue\n return false\n end\n\n true\n end", "def require_ssl!\n request.halt(403) unless request.ssl?\n end", "def ssl_required\n if ENV['RAILS_ENV'] == \"production\" && Substruct.override_ssl_production_mode == false\n if !request.ssl?\n redirect_to \"https://\" + request.host + request.request_uri\n flash.keep\n return false\n end\n end\n end", "def ssl_required?\n return false if disable_ssl?\n return true if logged_in?\n super\n end", "def ssl_configured?\n !Rails.env.development?\n end", "def ssl_required?\n return false if non_production_environment?\n\n required = (self.class.read_inheritable_attribute(:ssl_required_actions) || [])\n except = (self.class.read_inheritable_attribute(:ssl_required_except_actions) || [])\n\n unless except\n required.include?(action_name.to_sym) or required.include?(:all)\n else\n !(except.include?(action_name.to_sym) or except.include?(:all))\n end\n end", "def verify_ssl?\n ENV[\"BOOKINGSYNC_VERIFY_SSL\"] != \"false\"\n end", "def hubssolib_ensure_https\n unless request.ssl?\n # This isn't reliable: redirect_to({ :protocol => 'https://' })\n redirect_to (hubssolib_promote_uri_to_ssl(request.request_uri, request.host))\n return false\n else\n return true\n end\n end", "def ssl_allowed?\n admin_subdomain? #|| (logged_in? && current_account.ssl_allowed?)\n end", "def certificate_verification?\n !@network.options[:ssl_cert_file].nil?\n end", "def ssl_required_with_app_config?\n ENV['RAILS_ENV'] == 'production' && (self.class.read_inheritable_attribute(:ssl_required_actions) == [] || ssl_required_without_app_config?)\n end", "def use_ssl?; end", "def cert?\n true\n end", "def cert?\n false\n end", "def validate_ssl_certificate\n response = request('api.twilio.com', '8443', 'GET', 'https://api.twilio.com:8443/.json')\n return unless response.status_code < 200 || response.status_code >= 300\n\n raise RestError.new 'Unexpected response from certificate endpoint', response\n end", "def ssl_required?\n ! Rails.env.test?\n end", "def check_ssl_requirement # :nodoc:\n return true unless RAILS_ENV == 'production'\n return true unless defined?(SSL_REDIRECTS_ON) && SSL_REDIRECTS_ON\n \n case\n when !request.ssl? && @require_ssl\n logger.debug \"redirecting to secure page\"\n newparams = {}\n newparams.update(:host => (defined?(SSL_SECURE_HOST) ? SSL_SECURE_HOST : request.host) + (defined?(SSL_SECURE_PORT) ? \":#{SSL_SECURE_PORT.to_s}\" : ''))\n newparams.update(:protocol => 'https://')\n redirect_to(newparams) and return false\n when request.ssl? && !@require_ssl\n logger.debug \"redirecting to std\"\n newparams = {}\n newparams.update(:host => (defined?(SSL_STANDARD_HOST) ? SSL_STANDARD_HOST : request.host) + (defined?(SSL_STANDARD_PORT) ? \":#{SSL_STANDARD_PORT.to_s}\" : ''))\n newparams.update(:protocol => 'http://')\n redirect_to(newparams) and return false\n end\n end", "def ssl_verify; @opts[:ssl_verify]; end", "def ssl_required?\n (Rails.env.production? or Rails.env.staging?) and Rails.stage\n end", "def connectable?\n ssl_context = OpenSSL::SSL::SSLContext.new\n ssl_context.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n @http.head(URL_TO_CHECK, ssl_context: ssl_context).status.success?\n rescue StandardError\n false\n end", "def force?(env)\n !ssl?(env)\n end", "def require_ssl\n log \"NAV: Checking for SSL\"\n # check for enviroment variable\n return unless ENV['REQUIRE_HTTPS']\n\n unless request.ssl?\n log \"NAV OVERRIDE: Redirecting to https://#{request.host_with_port}#{request.fullpath}\"\n redirect_to({:protocol => 'https://'}.merge(params), :flash => flash)\n end\n end", "def secure_uri?(uri)\n %w[https wss].include? uri.scheme\n end", "def verify_ssl?\n Bubblebath::Configuration.instance.verify_ssl == nil ? true : Bubblebath::Configuration.instance.verify_ssl\n end", "def https?; end", "def ssl_verify\n if ENV[\"CHEF_API_SSL_VERIFY\"].nil? && config[\"CHEF_API_SSL_VERIFY\"].nil?\n true\n else\n %w{t y}.include?(ENV[\"CHEF_API_SSL_VERIFY\"].downcase[0]) || config[\"CHEF_API_SSL_VERIFY\"]\n end\n end", "def ssl_check(url)\n uri = \"http://#{url}\"\n response = Net::HTTP.get_response(URI(uri))\n\n if response.to_hash[\"location\"]\n uri = response.to_hash[\"location\"][0]\n response = Net::HTTP.get_response(URI(uri))\n end\n\n [uri, response]\n end", "def do_ssl_verify?\n if target_hostname == \"localhost\" ||\n target_hostname == \"a2-dev.test\" ||\n target_hostname =~ /\\d+\\.\\d+\\.\\d+\\.\\d+/\n return false\n end\n return true\n end", "def validrequest?(req)\n ssl = SSL.new(\"/home/rip/.mcollective.d/rip.pem\")\n\n ssl.verify_signature(req[:hash], SSL.md5(req[:body]), true)\n\n req[:callerid] = \"webuser=%s\" % ssl.rsa_decrypt_with_public(ssl.base64_decode(req[:callerid]))\n req[:body] = deserialize(req[:body])\n\n @stats.validated\n\n true\n rescue\n @stats.unvalidated\n raise(SecurityValidationFailed, \"Received an invalid signature in message\")\n end", "def require_ssl!\n throw(:halt, 403) unless request.secure?\n end", "def ssl_binary\n\t\t\tssl && ssl_on ? 1 : 0\n\t\tend", "def test_https_required\n RestClient.post url, {} if URI(url).scheme == 'http'\n true\n rescue => e\n case e.message\n when /406/\n true\n else\n raise e\n end\n end", "def use_ssl?\n true # user_signed_in? (but would need to ensure Devise runs under ssl)\n end", "def disable_ssl?\n # We don't need/want SSL encryption in a development environment, or when testing.\n Rails.application.config.consider_all_requests_local || !Settler[:ssl_enabled]\n end", "def ssl_check_peer_state\n super\n end", "def ldap_ssl?\r\n ldap_ssl.to_s.to_i != 0\r\n end", "def user_visited_a_non_ssl_page_since_login?\n cookies[:insecure].nil? || cookies[:insecure] == true\n end" ]
[ "0.82689804", "0.78814477", "0.7837875", "0.7837875", "0.7832652", "0.7749303", "0.7702773", "0.7685337", "0.76782733", "0.7668587", "0.7638191", "0.763135", "0.75952905", "0.7589356", "0.75649774", "0.7561973", "0.75456953", "0.7518626", "0.74921393", "0.74803007", "0.74644566", "0.74338186", "0.7411612", "0.73508346", "0.73207873", "0.7267096", "0.7254846", "0.7250094", "0.7219483", "0.7216728", "0.71906257", "0.7164212", "0.7155119", "0.7155119", "0.7154363", "0.71406454", "0.7125874", "0.7111318", "0.7084246", "0.7068157", "0.7060217", "0.70445573", "0.70445573", "0.7018591", "0.7015385", "0.7012394", "0.69630456", "0.69630456", "0.69352686", "0.6932284", "0.6910922", "0.6900957", "0.68866014", "0.6881695", "0.6877375", "0.6852722", "0.68400025", "0.68305343", "0.6814964", "0.6787129", "0.67637354", "0.674353", "0.67340416", "0.6688296", "0.6680968", "0.6663243", "0.66277355", "0.66133887", "0.6584107", "0.6578562", "0.65226257", "0.6514426", "0.65096605", "0.6508879", "0.64993167", "0.6495079", "0.6476336", "0.6467606", "0.6458148", "0.6457071", "0.64515615", "0.6435664", "0.6433655", "0.63229674", "0.63183916", "0.6311789", "0.6298916", "0.62979317", "0.62808514", "0.6280784", "0.6273334", "0.62558573", "0.62371886", "0.6226179", "0.62222564", "0.6218055", "0.6133371", "0.6090213", "0.60794574" ]
0.7884586
2
Assign whether to use ssl or not.
def ssl= bool @uri.scheme = bool ? "https" : "http" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def ssl=(ssl)\n @ssl = if ssl == true || ssl =~ /(true|t|yes|y|1)$/i\n true\n else\n false\n end\n end", "def use_ssl?; end", "def ssl?; end", "def ssl?; end", "def use_ssl?\n @ssl\n end", "def usessl?\n @usessl\n end", "def use_ssl?\n use_ssl\n end", "def ssl?\n ssl\n end", "def use_ssl?\n self.class.use_ssl || false\n end", "def ssl?\n return ssl\n end", "def force_ssl?\n @force_ssl || false\n end", "def force_ssl=(_arg0); end", "def force_ssl=(_arg0); end", "def ssl_option\n super\n end", "def ssl_options; end", "def ssl_options; end", "def ssl?\n ssl.present?\n end", "def ssl?\n @transport_mode == '~'\n end", "def force_ssl; end", "def force_ssl; end", "def ssl?\n return @ssl\n end", "def configure_ssl(http); end", "def enable_ssl(opts); end", "def encrypted=(boolean)\n @scheme = boolean ? 'https' : 'http'\n # Configure port if it hasn't already been configured\n @port = boolean ? 443 : 80\n end", "def require_ssl\n @require_ssl = true\n end", "def ssl_options(options = {})\n {:protocol => \"https\", :only_path => false} unless Rails.env.development?\n end", "def supports_ssl?\n false\n end", "def ssl_required?\n HTTPS_ON\n end", "def supports_ssl?\n\t false\n\tend", "def ssl_required?\n if get_config(\"SSL\") == \"true\"\n true\n else\n false\n end\n end", "def ssl_opts; end", "def ssl; end", "def use_ssl?\n port.to_i == 443\n end", "def ssl_enabled?\n\t\t\tssl && ssl_on\n\t\tend", "def ssl_required?\r\n true\r\n end", "def ssl?\n @uri.scheme == \"https\"\n end", "def ssl?\n @uri.scheme == \"https\"\n end", "def ssl_required?\n !disable_ssl?\n end", "def ssl?\n https? || socks4? || socks5?\n end", "def ssl?\n https? || socks4? || socks5?\n end", "def ssl_required?\n\t if get_config(\"SSL\") == \"true\"\n\t true\n\t else\n\t false\n\t end\n\t end", "def ssl?\n @url.scheme == 'https'\n end", "def ssl_required?\n\t if get_config(\"SSL\") == \"true\"\n\t true\n\t else\n\t false\n\t end\n end", "def ssl?\n uri.scheme == 'https'\n end", "def ssl?\n uri.scheme == 'https'\n end", "def disable_ssl; end", "def ssl_options\n replace_verify_mode(ssl)\n end", "def use_ssl\n if query\n ssl_query = query.split('&').each.select do |q|\n q.start_with?('use_ssl=')\n end.first\n ssl_query == 'use_ssl=true'\n else\n true\n end\n end", "def ssl?\n\t\treturn self.scheme == 'https'\n\tend", "def ssl_required?\n true\n end", "def ssl?\n @api_scheme == 'https'\n end", "def local_https_enabled\n get('beef.http.https.enable') || false\n end", "def ip_configuration_require_ssl\n settings.fetch(:ip_configuration, {})[:require_ssl]\n end", "def set_ssl_option(opts)\n opts = check_params(opts,[:options])\n super(opts)\n end", "def ssl?\n @headers[\"HTTPS\"] == \"on\"\n end", "def enable_ssl(verify = OpenSSL::SSL::VERIFY_PEER, certs = nil, \n port = SSL_PORT)\n @usessl = true\n @verify = verify\n @certs = certs\n @port = port\n end", "def ssl?\n uri_endpoint.scheme == 'https'\n end", "def https?; end", "def ssl\n @ssl ||= SSL.new\n end", "def configure_ssl(http)\n http.tap do |https|\n https.use_ssl = true\n https.ca_file = default_ca_file\n https.verify_mode = OpenSSL::SSL::VERIFY_PEER\n config.ssl_options.each do |key, value|\n http.send(\"#{key}=\", value)\n end\n add_certificate(https)\n end\n end", "def ssl?\n return @request_uri.scheme == \"https\"\n end", "def configure_ssl(options, env)\n return unless env[:url].scheme == 'https' && env[:ssl]\n\n options[:ssl] = {\n cert_chain_file: env[:ssl][:ca_file],\n verify_peer: env[:ssl].fetch(:verify, true)\n }\n end", "def set_serverssl(opts)\n opts = check_params(opts,[:serverssls])\n super(opts)\n end", "def setup_ssl\n @connection.use_ssl = @config[:use_ssl]\n\n if @config[:ssl_verify_peer]\n @connection.verify_mdoe = OpenSSL::SSL::VERIFY_PEER\n @connection.ca_file = @config[:ssl_ca_file]\n else\n @connection.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n end", "def ssl=(value)\n conf['dashboard']['ssl'] = value\n end", "def ssl_options=(_arg0); end", "def ssl_options=(_arg0); end", "def add_ssl(http)\n if host.start_with?('https')\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_PEER\n end\n http\n end", "def ssl?\n @j_del.isSsl\n end", "def ssl_verify; @opts[:ssl_verify]; end", "def secure_ssl=(_arg0); end", "def ssl\r\n\t\t\tparent.ssl\r\n\t\tend", "def ssl_binary\n\t\t\tssl && ssl_on ? 1 : 0\n\t\tend", "def serverssl\n super\n end", "def ssl_required_with_supported?\n ssl_supported? ? ssl_required_without_supported? : false\n end", "def ssl_required_with_supported?\n ssl_supported? ? ssl_required_without_supported? : false\n end", "def is_ssl\n # TS_INFO: Returns true always\n # if ( isset( $_SERVER['HTTPS'] ) ) {\n # if ( 'on' == strtolower( $_SERVER['HTTPS'] ) ) {\n # return true;\n # }\n #\n # if ( '1' == $_SERVER['HTTPS'] ) {\n # return true;\n # }\n # } elseif ( isset( $_SERVER['SERVER_PORT'] ) && ( '443' == $_SERVER['SERVER_PORT'] ) ) {\n # return true;\n # }\n # return false;\n true\n end", "def enable_ssl_verification=(_value)\n self.properties = properties.except('enable_ssl_verification') # Remove unused key\n end", "def init_http_ssl(http)\n if @ssl_init_http\n @ssl_init_http.call(self, http)\n else\n # enable SSL for this HTTP connection\n http.use_ssl = true\n\n if @ssl_verify\n # set the verify mode and the cert store\n http.verify_mode = @ssl_verify_mode\n http.cert_store = @ssl_store\n end\n end\n end", "def connect_ssl; end", "def ssl_verify\n @ssl_verify || true\n end", "def ssl_version=(ssl_version); end", "def ssl_version=(ssl_version); end", "def enable_ssl(opts)\n cert, key, src =\n opts[:BridgetownOptions].values_at(\"ssl_cert\", \"ssl_key\", \"source\")\n\n return if cert.nil? && key.nil?\n raise \"Missing --ssl_cert or --ssl_key. Both are required.\" unless cert && key\n\n require \"openssl\"\n require \"webrick/https\"\n\n opts[:SSLCertificate] = OpenSSL::X509::Certificate.new(read_file(src, cert))\n begin\n opts[:SSLPrivateKey] = OpenSSL::PKey::RSA.new(read_file(src, key))\n rescue StandardError\n if defined?(OpenSSL::PKey::EC)\n opts[:SSLPrivateKey] = OpenSSL::PKey::EC.new(read_file(src, key))\n else\n raise\n end\n end\n opts[:SSLEnable] = true\n end", "def default_ssl_port; end", "def ssl_allowed?\n\t\tnot ssl_required?\n\tend", "def verify_ssl\n true\n end", "def starttls_always?; end", "def connection_options\n ssl_options\n end", "def ldap_ssl_option\n super\n end", "def tls?; end", "def ssl_verifypeer=(value)\n Curl.set_option(:ssl_verifypeer, value_for(value, :bool), handle)\n end", "def ssl_configured?\n !Rails.env.development?\n end", "def configure_ssl(client)\n Preconditions.assert_class('client', client, Net::HTTP)\n client.use_ssl = true\n client.verify_mode = OpenSSL::SSL::VERIFY_PEER\n client.cert_store = OpenSSL::X509::Store.new\n client.cert_store.set_default_paths\n end", "def ssl_options\n if ssl_cert && ssl_key\n {\n client_cert: ssl_cert,\n client_key: ssl_key\n }\n end\n end", "def require_ssl\n if request.ssl? or Rails.env == 'development' \n true\n else\n redirect_to({:protocol => 'https://'}.merge(params), :flash => flash)\n false\n end\n end", "def enable_ssl_verification\n true\n end", "def init_ssl(opt)\n @ssl_init_http = opt['ssl_init_http']\n @ssl_verify = opt['ssl_verify']\n\n if cb = opt['ssl_init']\n cb.call(self, opt)\n elsif @verify_ssl\n # set verify mode, create cert store\n @ssl_verify_mode = OpenSSL::SSL::VERIFY_PEER\n @ssl_store = OpenSSL::X509::Store.new\n\n # add path to certificate store\n # TODO: documentation, at least in method definition\n cert_path = opt['ssl_cert_path'] ||\n ENV['RUBILICIOUS_SSL_CERT_DIR'] ||\n ENV['SSL_CERT_DIR'] ||\n OpenSSL::X509::DEFAULT_CERT_DIR\n @ssl_store.add_path(cert_path)\n else\n # disable SSL verification by default\n @ssl_verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n end", "def ssl_version= ssl_version\n @agent.ssl_version = ssl_version\n end" ]
[ "0.8319328", "0.82412237", "0.8113454", "0.8113454", "0.80570805", "0.805706", "0.8051032", "0.80060554", "0.7918468", "0.7877911", "0.7808463", "0.77716917", "0.77716917", "0.77628624", "0.7761831", "0.7761831", "0.77568835", "0.7753574", "0.77359855", "0.77359855", "0.7727008", "0.76754254", "0.7658276", "0.7647152", "0.7645729", "0.76399183", "0.7638892", "0.76343465", "0.76133657", "0.76022935", "0.75956434", "0.75541496", "0.7553284", "0.7499768", "0.74809957", "0.74734247", "0.74734247", "0.74571556", "0.743917", "0.743917", "0.7432386", "0.74320024", "0.74289346", "0.742528", "0.742528", "0.74223506", "0.7422053", "0.7421544", "0.74172527", "0.74170923", "0.74132067", "0.73341167", "0.732763", "0.7324487", "0.7323817", "0.73192775", "0.72958654", "0.7294007", "0.7289223", "0.72846025", "0.72708774", "0.7264319", "0.72239566", "0.7214304", "0.71961015", "0.71750283", "0.71750283", "0.71511143", "0.7126324", "0.712101", "0.7114842", "0.7091754", "0.7072216", "0.70705104", "0.70602965", "0.70602965", "0.7036849", "0.703526", "0.70184314", "0.70120543", "0.70032704", "0.6968602", "0.6968602", "0.6954436", "0.69363075", "0.692669", "0.6914996", "0.691255", "0.68969864", "0.688157", "0.6881548", "0.6875971", "0.6865927", "0.68571836", "0.6847148", "0.68403375", "0.6824741", "0.6821845", "0.68171567" ]
0.8393315
1
Retrieve this requests' response.
def retrieve http_class = http_proxy @proxy[:host], @proxy @_req = http_class.new @uri.host, @uri.port @_req.read_timeout = @timeout if @timeout @_req.use_ssl = true if @uri.scheme =~ /^https$/ elapsed_time = nil socket = nil socket_io = nil @_res = @_req.start do |http| socket = http.instance_variable_get "@socket" socket.debug_output = socket_io = StringIO.new start_time = Time.now res = http.request self.http_request, @body elapsed_time = Time.now - start_time res end Kronk.cookie_jar.set_cookies_from_headers @uri.to_s, @_res.to_hash if self.use_cookies @response = Response.new socket_io, @_res, self @response.time = elapsed_time @response end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_response()\n if has_errors?\n return get_error_response()\n end\n @values[\"RESPONSE\"]\n end", "def response\n @response\n end", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def get_Response()\n \t return @outputs[\"Response\"]\n \tend", "def response\n @_response\n end", "def response\n @@response\n end", "def response\n @response\n end", "def response\r\n @response\r\n end", "def response\n @response\n end", "def response\n @response\n end", "def http_response\n return @http_response\n end", "def response\n get_header_and_body\n end", "def api_response\n @response\n end", "def parsed_response\n response\n end", "def response; return @response end", "def response\n @response ||= request!(true)\n end", "def last_response\n @response\n end", "def response\r\n submit.ResponseList.GetAt(0).Detail\r\n end", "def response\n @response ||= Net::HTTP.new(uri.host).request(request)\n end", "def get_response\n GopDataTrustAdapter::Response.new(self.api, get_response!)\n end", "def retrieve_response\n session.post(url)\n end", "def response\n process\n @response.to_a\n end", "def responses\n @responses\n end", "def response\n\t\t@response\n\tend", "def raw_response\n @raw_response\n end" ]
[ "0.80271435", "0.80271435", "0.80271435", "0.80271435", "0.80271435", "0.80271435", "0.80271435", "0.80271435", "0.80271435", "0.8015506", "0.7925372", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7925028", "0.7924413", "0.7924413", "0.7924413", "0.7924413", "0.7924413", "0.7924413", "0.7924413", "0.7924413", "0.79244125", "0.7924297", "0.7924297", "0.7924297", "0.7924297", "0.7924297", "0.7881514", "0.7845952", "0.78424907", "0.7748997", "0.75554967", "0.75554967", "0.74914926", "0.7424354", "0.7290666", "0.72748154", "0.72685933", "0.72571516", "0.7210773", "0.71056837", "0.70802283", "0.7046556", "0.7038036", "0.70251083", "0.7008451", "0.699087", "0.69802195" ]
0.0
-1
Returns the raw HTTP request String.
def to_s out = "#{@http_method} #{@uri.request_uri} HTTP/1.1\r\n" out << "host: #{@uri.host}:#{@uri.port}\r\n" self.http_request.each do |name, value| out << "#{name}: #{value}\r\n" unless name =~ /host/i end out << "\r\n" out << @body.to_s end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def to_s\n out = \"#{@http_method} #{@uri.request_uri} HTTP/1.1\\r\\n\"\n out << \"Host: #{@uri.host}:#{@uri.port}\\r\\n\"\n\n http_request.each do |name, value|\n out << \"#{name}: #{value}\\r\\n\" unless name =~ /host/i\n end\n\n out << \"\\r\\n\"\n\n if @body.respond_to?(:read)\n out << @body.read\n elsif Kronk::Multipart === @body\n out << @body.to_io.read\n else\n out << @body.to_s\n end\n end", "def to_s\n @request\n end", "def body_string\n body = request.body\n body.rewind # Since this is a StringIO and we access it twice, rewind it\n body.read\n rescue RuntimeError => exception\n # Rails 4.2 with Ruby 2.3 raises \"RuntimeError: can't modify frozen String\"\n # when trying to access request.body with invalid JSON. Fallback to header.\n request.headers[\"RAW_POST_DATA\"]\n end", "def raw_body\n @response.body.to_s\n end", "def canonicalize_request\n \"Method:#{http_method.to_s.upcase}\\nHashed Path:#{digester.hash_string(canonical_path)}\\nX-Ops-Content-Hash:#{hashed_body}\\nX-Ops-Timestamp:#{canonical_time}\\nX-Ops-UserId:#{user_id}\"\n end", "def to_s\r\n\t\t\"<httpRequest>\" + @uri_xml_encoded_only + \"</httpRequest>\\n\"\r\n\tend", "def raw_post\n env['RAW_POST_DATA']\n end", "def body\n if raw_post = @env['RAW_POST_DATA']\n raw_post.force_encoding(Encoding::BINARY) if raw_post.respond_to?(:force_encoding)\n StringIO.new(raw_post)\n else\n @env['rack.input']\n end\n end", "def execute_as_string(http_request)\r\n response = @connection.send(\r\n http_request.http_method.downcase,\r\n http_request.query_url\r\n ) do |request|\r\n request.headers = http_request.headers\r\n unless http_request.parameters.empty?\r\n request.body = http_request.parameters\r\n end\r\n end\r\n convert_response(response)\r\n end", "def read_request\n request = ''\n\n Kernel.loop do\n line = @client.gets\n break if line.chomp.empty?\n request << line\n end\n\n request\n rescue\n raise 'client closed connection'\n end", "def raw_message\n @raw_message ||= \"#{raw_headers}\\r\\n\\r\\n#{raw_body}\"\n end", "def request\n @request.full\n end", "def http_request\n lines = []\n request = data[:request]\n\n verb, override = method_and_override(request[:verb])\n\n lines << \"%s %s HTTP/1.1\" % [verb, request[:path]]\n\n lines << \"X-Http-Method-Override: #{override}\" if override\n\n lines << \"Host: #{host}\"\n\n (request[:headers] || {}).each_pair do |key, value|\n lines << \"#{key}: #{value}\"\n end\n\n if request[:data]\n lines << \"Content-Type: application/json; charset=utf-8\"\n lines << \"\"\n lines << JSON.pretty_generate(request[:data])\n end\n\n lines.join(\"\\n\")\n end", "def request_string\n \"#{authentication_string}&\" + @request_parameters.\n reject{|k| self.send(k).blank?}.map(&:to_s).sort.map{|k|\n \"#{k.to_s.upcase}=#{escape(self.send(k))}\"\n }.flatten.join('&')\n end", "def to_string\n \"#{@source} #{@remote_user} #{@timestamp} #{@http_request} \"\\\n \"#{@http_status} #{@element_size} byte #{@http_referer}\\n#{@user_agent}\"\n end", "def parsed_request\n request.body.rewind\n\n data = URI.unescape(request.body.read.to_s.split('signed_request=')[1])\nend", "def to_s\n str = \"HTTP/#{http_version} #{status} #{status_text}\\r\\n\"\n headers.each do |key, value|\n value.each do |v|\n str << \"#{key}: #{v}\\r\\n\"\n end\n end\n\n str << \"\\r\\n\"\n str << body_as_string\n str\n end", "def canonical_request\n [\n method,\n Pathname.new(uri.path).cleanpath.to_s,\n uri.query,\n headers.sort.map { |k, v| [k.downcase, v.strip].join(':') }.join(\"\\n\") + \"\\n\",\n headers.sort.map { |k, v| k.downcase }.join(\";\"),\n headers[\"X-Amz-Content-Sha256\"]\n ].join(\"\\n\")\n end", "def signature_base_string\n [\n @http_method.dup,\n percent_encode(base_url),\n percent_encode(request_params),\n percent_encode(nonce.to_s),\n percent_encode(@business_guid)\n ].join('&')\n end", "def content_get\n # compress GET requests to try and stay under that 8KB request limit\n deflated_request = Zlib::Deflate.deflate(@request, 9)[2..-5]\n # strict_encode64() isn't available? sub out the newlines\n @request_params[\"SAMLRequest\"] = Base64.encode64(deflated_request).gsub(/\\n/, \"\")\n \n Logging.debug \"SAMLRequest=#{@request_params[\"SAMLRequest\"]}\"\n uri = Addressable::URI.parse(@URL)\n if uri.query_values == nil\n uri.query_values = @request_params\n else\n # solution to stevenwilkin's parameter merge\n uri.query_values = @request_params.merge(uri.query_values)\n end\n url = uri.to_s\n #Logging.debug \"Sending to URL #{url}\"\n return url\n end", "def content_get\n\t\t\t# compress GET requests to try and stay under that 8KB request limit\n\t\t\tdeflated_request = Zlib::Deflate.deflate(@request, 9)[2..-5]\n\t\t\t# strict_encode64() isn't available? sub out the newlines\n\t\t\t@request_params[\"SAMLRequest\"] = Base64.encode64(deflated_request).gsub(/\\n/, \"\")\n\t\t\t\n\t\t\tLogging.debug \"SAMLRequest=#{@request_params[\"SAMLRequest\"]}\"\n\t\t\turi = Addressable::URI.parse(@URL)\n\t\t\turi.query_values = @request_params\n\t\t\turl = uri.to_s\n\t\t\t#url = @URL + \"?SAMLRequest=\" + @request_params[\"SAMLRequest\"]\n\t\t\tLogging.debug \"Sending to URL #{url}\"\n\t\t\treturn url\n\t\tend", "def read_request_line(conn)\n request_line = conn.gets(\"\\n\", MAX_URI_LENGTH)\n method, full_path, _http_version = request_line.strip.split(' ', 3)\n path, query = full_path.split('?', 2)\n\n [method, full_path, path, query]\n end", "def request_string\n Shrimp.server.url + '?' +\n { in: @source.to_s, out: outfile }\n .merge(browser_attributes)\n .merge(paper_attributes)\n .merge(footer_attributes)\n .merge(header_attributes)\n .delete_if { |_, v| v.nil? }.map { |k, v| \"#{k}=#{v}\" }.join('&')\n end", "def http_query_string\n <<-END_POST\nbody=%5B%22KOSE%E9%AB%98%E4%B8%9D%E9%9B%AA%E8%82%8C%E7%B2%BE%E6%B4%97%E9%A2%9C%E4%B9%B3%22%5D&buyer_email=18611543280&buyer_id=2088902582208882&exterface=create_direct_pay_by_user&is_success=T&notify_id=RqPnCoPT3K9%252Fvwbh3InQ8703uAICbLI7SGaz7f3Qe96t7vC6a1YKnYuOZTls2t9kw%252F6z&notify_time=2014-11-11+17%3A59%3A28&notify_type=trade_status_sync&out_trade_no=R990240665&payment_type=1&seller_email=acct-ali%40shiguangcaibei.com&seller_id=2088611493982911&subject=%E8%AE%A2%E5%8D%95%E7%BC%96%E5%8F%B7%3AR990240665&total_fee=1.43&trade_no=2014111159601788&trade_status=TRADE_SUCCESS&sign=1c3e7b66a6a7e704f0ad2ed0bc25ee04&sign_type=MD5\n END_POST\n .chomp!\n end", "def raw_body\n unless @raw_body\n @in.rewind\n @raw_body = @in.read(content_length)\n end\n\n @raw_body\n end", "def req_body\n\t\t\t@req_body ||= env['rack.input'].read\n\t\tend", "def generate\n parts = []\n parts << @request.scheme << \"://\"\n parts << @request.host\n\n if @request.scheme == \"https\" && @request.port != 443 ||\n @request.scheme == \"http\" && @request.port != 80\n parts << \":\" << @request.port.to_s\n end\n\n parts << @request.script_name\n parts << @request.path_info\n\n if qs = query_string\n parts << \"?\"\n parts << qs\n end\n\n parts.join\n end", "def body(request)\n request.body.read\n end", "def to_s\n string = ''.tap do |s|\n s << @http_version << ' '\n s << \"#{@status.code} #{@status.message}\"\n s << CRLF\n end\n\n @header.each do |key, value|\n string << \"#{key}: #{value}#{CRLF}\"\n end\n\n string << \"#{CRLF}#{@body}\"\n end", "def http_request\n req = VanillaRequest.new @http_method, @uri.request_uri, @headers\n\n if @oauth\n req['Authorization'] =\n SimpleOAuth::Header.new(@http_method, @uri, {}, self.oauth).to_s\n elsif @auth && @auth[:username]\n req.basic_auth @auth[:username], @auth[:password]\n end\n\n # Stream Multipart\n if Kronk::Multipart === @body\n req.body_stream = @body.to_io\n\n # Stream IO\n elsif @body.respond_to?(:read)\n req.body_stream = @body\n\n else\n req.body = @body\n end\n\n b = req.body || req.body_stream\n\n if b.respond_to?(:bytesize)\n req['Content-Length'] = b.bytesize.to_s\n elsif b.respond_to?(:size) && b.size\n req['Content-Length'] = b.size.to_s\n elsif b.nil?\n req['Content-Length'] = \"0\"\n end\n\n req['Transfer-Encoding'] = 'chunked' if !req['Content-Length']\n\n req\n end", "def body\r\nif raw_post = @env['RAW_POST_DATA']\r\nraw_post.force_encoding(Encoding::BINARY)\r\nStringIO.new(raw_post)\r\nelse\r\n@env['rack.input']\r\nend\r\nend", "def raw\n begin\n @raw ||= request_json(url)\n rescue OpenURI::HTTPError => e\n Rails.logger.error \"#{e.message}: #{url}\"\n raise\n end\n end", "def inspect\n { method: method, uri: uri.to_s, headers: headers, body: body }.inspect\n end", "def raw_body\n @raw_body ||= @raw[(raw_command.length + 1)..-1] || \"\"\n end", "def generate\n parts = []\n parts << @request.scheme << \"://\"\n parts << @request.host\n\n if @request.scheme == \"https\" && @request.port != 443 ||\n @request.scheme == \"http\" && @request.port != 80\n parts << \":\" << @request.port.to_s\n end\n\n parts << @request.script_name\n parts << @request.path_info\n\n if qs = query_string\n parts << \"?\"\n parts << qs\n end\n\n parts.join\n end", "def raw_body\n @response.body\n end", "def to_raw()\n self.headers ||= default_headers_obj()\n self.body ||= default_body_obj()\n\n if len=@opts[:static_length]\n @body = Body.new(@body, @body.opts) {|x| x.base = self}\n @headers.set_header(\"Content-Length\", len.to_i)\n elsif @opts[:ignore_content_length]\n @headers.delete_header(\"Content-Length\")\n end\n\n bstr = @body.to_raw\n hdrs = @headers.to_raw_array.unshift(first_entity.to_raw)\n return \"#{hdrs.join(\"\\r\\n\")}\\r\\n\\r\\n#{bstr}\"\n end", "def raw_request_message(params)\n params[:api_id] = api_id\n params[:api_partialkey] = api_key.slice(0, 64)\n JSON.generate(params)\n end", "def query_string\n return @query_string\n end", "def raw\n @raw ||= ''\n end", "def raw(s)\n RawString.new(s)\n end", "def raw_message\n @raw_message\n end", "def to_s\n \"#{http_methods.join(\" / \")} #{path}\"\n end", "def build_request_url\n \"http://snipr.com/site/snip?r=simple&link=#{ensure_http}\"\n end", "def unsigned_query_string\n (should_encode? ? RestClient::Payload.generate(query_params) : query_params).to_s\n end", "def raw(s)\n RawString.new(s)\n end", "def dump_request(request)\n return unless @output_buffer\n puts \"> dump_request\"\n terms = %w(request_uri request_line raw_header body)\n longest = terms.map(&:size).max\n \n @output_buffer.puts '-' * 80\n @output_buffer.puts \"Request:\"\n terms.each do |term|\n @output_buffer.puts \" %#{longest}s:\" % [term] # , request.send(term).to_s.length]\n end\n @output_buffer.puts '-' * 80\n @output_buffer.flush\n puts \"< dump_request\"\n end", "def string_to_sign\n \"GET\\n#{ENDPOINT}\\n#{REQUEST_URI}\\n#{canonical_query_string}\"\n end", "def raw_body\n @attributes[:raw_body]\n end", "def getBody()\n return @req.body\n end", "def to_s\n raw\n end", "def body_raw\n @body_raw ||= body(true).read\n @body_raw\n end", "def request\n @req\n end", "def query_string\n return nil if @request.query_string.to_s.empty?\n\n parts = @request.query_string.split(/[&;] */n)\n parts.map! { |p| p.split('=', 2).map!{ |s| unescape(s) } }\n parts.sort!\n parts.reject!(&self.class.query_string_ignore)\n parts.map! { |k,v| \"#{escape(k)}=#{escape(v)}\" }\n parts.empty? ? nil : parts.join('&')\n end", "def query_string\n return nil if @request.query_string.nil?\n ignore_query_params = [\"no-cachely\", \"refresh-cachely\", Rack::Cachely.config.ignore_query_params].flatten\n query = @request.query_string.split(/[&;] */n).map { |p| unescape(p).split('=', 2) }.sort\n query = query.reject{|k,v| ignore_query_params.include?(k)}.map{ |k,v| \"#{escape(k)}=#{escape(v)}\" }\n\n query.join('&')\n end", "def request\n response.request\n end", "def read_request_message\n raw_request = CommonUi::IOUtils.read_to_array(\n \"#{ENV[\"XROAD_HOME\"]}/center-service/test/resources/\"\\\n \"client_reg_request_CONTROLLERTEST_WRONG_INSTANCE.soap\")\n\n raw_request.map!() { |line| line.strip() }\n\n return raw_request.join(\"\")\n end", "def get_body\n request_object.body\n end", "def request\n @cgi\n end", "def query_string\n \"\"\n end", "def query_string\n if method == \"GET\" && !request_parameters.empty?\n \"?#{request_parameters.to_query}\"\n end\n end", "def request\n socket.request\n end", "def signed_query_string\n return unsigned_query_string unless should_encode?\n text_to_sign = ((body == true || (! body.empty?)) ? encoded_body : unsigned_query_string_stripped)\n signature = sign(text_to_sign)\n \"#{unsigned_query_string}&signature=#{signature}\"\n end", "def to_s\n [\n (\"#{@protocol}://\" if @protocol),\n (\"#{@userinfo}@\" if @userinfo),\n @host,\n (\":#{@port}\" if @port),\n @registry,\n @path,\n (\"?#{@query}\" if @query),\n (\"##{@fragment}\" if @fragment)\n ].join\n end", "def raw\n repr.raw\n end", "def get_querystring\n request_object.querystring\n end", "def content(c)\n @request.env[\"RAW_POST_DATA\"] = c.to_s\n end", "def http_query_string_sgcb\n <<-END_POST\nbody=%5B%22KOSE%E9%AB%98%E4%B8%9D%E9%9B%AA%E8%82%8C%E7%B2%BE%E6%B4%97%E9%A2%9C%E4%B9%B3%22%5D&buyer_email=18611543280&buyer_id=2088902582208882&exterface=create_direct_pay_by_user&is_success=T&notify_id=RqPnCoPT3K9%252Fvwbh3InQ8703uAICbLI7SGaz7f3Qe96t7vC6a1YKnYuOZTls2t9kw%252F6z&notify_time=2014-11-11+17%3A59%3A28&notify_type=trade_status_sync&out_trade_no=R990240665&payment_type=1&seller_email=acct-ali%40shiguangcaibei.com&seller_id=2088611493982911&subject=%E8%AE%A2%E5%8D%95%E7%BC%96%E5%8F%B7%3AR990240665&total_fee=1.43&trade_no=2014111159601788&trade_status=TRADE_SUCCESS&sign=a25c543b8b84166f6c5f556c2f229fb1&sign_type=MD5\n END_POST\n .chomp!\n end", "def raw_post; end", "def do_request()\n uri = URI.parse(API_BASE_URL + build_request_path())\n response = Net::HTTP.get_response(uri)\n response.body\n end", "def last_http_request\n req = last_response.request\n out = \"#{req.http_method::METHOD} #{req.uri.request_uri}\\n\"\n out += \"Host: #{req.uri.host}\\nConnection: close\\n\"\n req.options[:headers].each do |header, value|\n out += header.capitalize.gsub(/\\-([a-z])/) { |m| \"-#{m[1].chr.upcase}\" }\n out += \": #{value}\\n\"\n end\n\n out # we only do GET requests so no need to append body, add if needed\n end", "def params_str\n parse_request! if @params_str.nil?\n @params_str\n end", "def send_request_string( request_name, data, want_reply=false )\n msg = @buffers.writer\n msg.write_string data.to_s\n send_request request_name, msg, want_reply\n end", "def body\n @raw\n end", "def query_string\n ''\n end", "def body_raw\n @response.body\n end", "def to_s\n raw = ''\n headers.each_pair { |k, v| raw << \"#{k}: #{v}\\r\\n\"}\n raw << \"\\r\\n\"\n\n body.each_line do |line|\n orig_line = line\n line = line.chomp\n\n raw << '.' if line[0] == '.' # dot stuffing\n raw << line\n # don't add a newline if there wasn't one originally\n raw << \"\\r\\n\" unless line.eql?(orig_line)\n end\n\n raw << \"\\r\\n\"\n end", "def encoded_body\n Ethon::Easy::Form.new(nil, options[:body]).to_s\n end", "def to_s\n @document ||= @request.wsdl.body\n end", "def to_s\n body.to_s\n end", "def to_s\n \"#{headers}\\r\\n\\r\\n#{body}\"\n end", "def string_to_sign\n [method, url.host, url.path, url.query].join \"\\n\"\n end", "def to_s\n @body.to_s\n end", "def signable_string(method, uri, headers)\n [\n method.to_s.upcase,\n headers.fetch('Content-MD5', ''),\n headers.fetch('Content-Type', ''),\n headers.fetch('Date') { raise IndexError, 'Headers must include Date' },\n canonicalized_headers(headers),\n canonicalized_resource(uri)\n ].join(\"\\n\")\n end", "def request_url\n query_builder.request_string\n end", "def raw(input)\n Utils::Escape::SafeString.new(input)\n end", "def raw\n #\n end", "def request_uri\n return nil if absolute? && scheme !~ /^https?$/\n res = path.to_s.empty? ? \"/\" : path\n res += \"?#{self.query}\" if self.query\n return res\n end", "def to_s\n #@to_s ||= \"http#{http.use_ssl? ? 's' : ''}://#{http.address}:#{http.port}\"\n @to_s ||= http.to_s\n end", "def query_string\n ast.to_query_string\n end", "def to_s\n \"#{@base_url}?#{query}\"\n end", "def query_string\n return nil if @request.query_string.nil?\n\n @request.query_string.split(/[&;] */n).\n map { |p| unescape(p).split('=', 2) }.\n sort.\n map { |k,v| \"#{escape(k)}=#{escape(v)}\" }.\n join('&')\n end", "def to_s\n response = \"#{@status_line}\\n#{@header_fields}\\n#{@body}\"\n end", "def raw_source\n @raw_source\n end", "def raw_source\n @raw_source\n end", "def raw_source\n @raw_source\n end", "def raw_plain\n @raw_plain\n end", "def content_post\n # POST requests seem to bomb out when they're deflated\n # and they probably don't need to be compressed anyway\n @request_params[\"SAMLRequest\"] = Base64.encode64(@request).gsub(/\\n/, \"\")\n \n #Logging.debug \"SAMLRequest=#{@request_params[\"SAMLRequest\"]}\"\n # kind of a cheesy method of building an HTML, form since we can't rely on Rails too much,\n # and REXML doesn't work well with quote characters\n str = \"<html><body onLoad=\\\"document.getElementById('form').submit();\\\">\\n\"\n str += \"<form id='form' name='form' method='POST' action=\\\"#{@URL}\\\">\\n\"\n # we could change this in the future to associate a temp auth session ID\n str += \"<input name='RelayState' value='ruby-saml' type='hidden' />\\n\"\n @request_params.each_pair do |key, value|\n str += \"<input name=\\\"#{key}\\\" value=\\\"#{value}\\\" type='hidden' />\\n\"\n #str += \"<input name=\\\"#{key}\\\" value=\\\"#{CGI.escape(value)}\\\" type='hidden' />\\n\"\n end\n str += \"</form></body></html>\\n\"\n \n #Logging.debug \"Created form:\\n#{str}\"\n return str\n end", "def to_s\n string = ''\n\n raise 'resource_name is required' unless self.resource_name\n string += \"GET \" + self.resource_name + \" HTTP/1.1\\x0d\\x0a\"\n\n string += \"Upgrade: WebSocket\\x0d\\x0a\"\n string += \"Connection: Upgrade\\x0d\\x0a\"\n\n raise 'Host is required' unless self.host\n string += \"Host: \" + self.host + \"\\x0d\\x0a\"\n\n origin = self.origin || 'http://' + self.host\n string += \"Origin: \" + origin + \"\\x0d\\x0a\"\n\n if self.version > 75\n self.generate_keys\n\n string += 'Sec-WebSocket-Protocol: ' + self.subprotocol + \"\\x0d\\x0a\" if self.subprotocol\n\n string += 'Sec-WebSocket-Key1: ' + self.key1 + \"\\x0d\\x0a\"\n string += 'Sec-WebSocket-Key2: ' + self.key2 + \"\\x0d\\x0a\"\n\n string += 'Content-Length: ' + self.challenge.length.to_s + \"\\x0d\\x0a\"\n else\n string += 'WebSocket-Protocol: ' + self.subprotocol + \"\\x0d\\x0a\" if self.subprotocol\n end\n\n # TODO cookies\n\n string += \"\\x0d\\x0a\"\n\n string += self.challenge if self.version > 75\n\n return string\n end", "def read_request(client)\n req = \"\"\n\n while line = client.gets\n req += line\n break if line =~ /^\\s*$/\n end\n\n request = Request.new(req)\n if request.method == \"POST\"\n puts request.header_fields[:Content_Length].to_i\n request.parse_data(\n client.read(request.header_fields[:Content_Length].to_i)\n )\n end\n return request\n end" ]
[ "0.727364", "0.69600296", "0.66420066", "0.6527482", "0.6520622", "0.64491695", "0.63976574", "0.6271037", "0.6259756", "0.6236128", "0.6132159", "0.6083503", "0.6081281", "0.607472", "0.6061257", "0.5991761", "0.59768283", "0.59693193", "0.59610456", "0.59242535", "0.5910411", "0.5910338", "0.5904206", "0.5901116", "0.58940095", "0.5891242", "0.58762646", "0.58626044", "0.5851417", "0.5850791", "0.5843815", "0.58425325", "0.5832415", "0.57944757", "0.5763392", "0.5761782", "0.5755302", "0.5725781", "0.57159567", "0.57152504", "0.5688839", "0.5684142", "0.5681971", "0.566369", "0.5663259", "0.56557155", "0.56556046", "0.56519157", "0.5633268", "0.56242925", "0.5623387", "0.5616486", "0.56072855", "0.56031066", "0.56027216", "0.55977494", "0.5592365", "0.55879176", "0.558524", "0.55733943", "0.55661094", "0.55657494", "0.5540919", "0.55375236", "0.5530089", "0.5529185", "0.55277616", "0.55174196", "0.5512841", "0.55123633", "0.5511698", "0.54824674", "0.5478901", "0.5477109", "0.5476986", "0.5475357", "0.5474345", "0.54721344", "0.54713315", "0.5468554", "0.54612994", "0.5457741", "0.54461986", "0.5441833", "0.543707", "0.5434355", "0.543364", "0.5431472", "0.5430244", "0.5428998", "0.5425982", "0.54178625", "0.5414539", "0.541327", "0.541327", "0.541327", "0.5412079", "0.5410696", "0.5406715", "0.5402893" ]
0.7152661
1
This method is for brand users to see their requests that are related to this startup
def requests @requests = @startup.requests.startup_related_requests(current_user.brand_id) .order(created_at: :desc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_started\n intro_and_request_permissions\n end", "def show_startup\n authorize! :investor_connect_with_startups, current_user\n # Only allow temporary investor account access to their suggested startups\n if [2367, 2375, 2435, 2436, 2437, 2438, 2459, 2466].include?(current_user.id)\n calculate_suggested_startup_completeness\n @startup = current_user.suggested_startups(1).first\n else\n @startup = Startup.find 319\n Relationship.suggest_connection(current_user, @startup, :startup_investor)\n end\n \n if @startup.blank?\n flash[:notice] = \"Thanks, you've reviewed all of the startups currently available to you.\"\n redirect_to :action => :index\n return\n end\n\n @checkin_history = Checkin.history_for_startup(@startup)\n @screenshots = @startup.screenshots.ordered\n\n @rating = Rating.new\n @rating.startup = @startup\n @rating.interested = false\n\n @instrument = @startup.instruments.first\n @measurements = @instrument.measurements.ordered_asc.all unless @instrument.blank?\n\n @checkins = @startup.checkins.ordered\n end", "def on_pre_request( request )\n end", "def set_request_start\n # byepassing to active admin's own\n # authentication process\n return true if request_from_admin?\n\n super\n end", "def set_request; end", "def home\n # factions with pending request\n @pending_factions = Faction.with_pending_requests(current_user)\n\n # factions that the user can send a request to join (which means the user hasn't sent a request yet)\n @possible_factions = Faction.can_send_request(current_user)\n\n @request = Request.new\n end", "def before_request\n end", "def before_GET(req)\n super\n @subsection = 'vehicle-list'\n @title = \"Welcome back #{dealership(req).name}\"\n end", "def list_requests\n # stub\n end", "def first_request\n reset_horizon\n end", "def on_pre_request( request ); end", "def on_launch_request\n if authorized? && request_type.launch? && block_given?\n @response = yield user\n end\n end", "def requester\n REQUESTER\n end", "def fetch_setup_details\n\n super\n\n end", "def set_request_start\n @request_started_at = Time.now\n @used_auth_by_token = true\n end", "def app_landing\n end", "def present_getting_started\n\n if current_user.is_owner?\n redirect_to(getting_started_path) unless current_user.ack_get_started_owner\n else\n redirect_to(get_started_path) unless current_user.ack_get_started_user\n end\n\n end", "def splash()\n\t\t@request.add('/')\n\t\t@request.add('/var/widgets.json?callback=define')\n\t\t@request.add('/system/me?_charset_=utf-8')\n\t\t@request.add('/tags/directory.tagged.json?_charset_=utf-8&_=1342651726188')\n\t\t@request.add('/var/search/activity/all.json?items=12&_charset_=utf-8&_=1342651726197')\n\t\t@request.add('/var/search/public/random-content.json?page=0&items=10&tag=&type=c&_charset_=utf-8&_=1342651726201')\n\t\t@request.add('/var/templates/worlds.2.json?_charset_=utf-8')\n end", "def requester\n REQUESTER\n end", "def requests\n REQUESTS\n end", "def show\n unless current_user.is_admin\n raise \"401\"\n end\n gon_request @request\n end", "def lookup_required_resources\n \n # Marketplace admin user - required to administer users, and store\n # application-level properties\n unless session['marketplace_admin_user_name']\n marketeer_user = User.where(role: 'marketeer').first\n session['marketplace_admin_user_name'] = marketeer_user ? marketeer_user.name : nil\n end\n \n # Determine whether any required resources are missing.\n session['required_resources_present'] = !session['marketplace_admin_user_name'].nil?\n \n unless session['required_resources_present']\n \n # An action is being invoked before all the required resources have\n # been initialized. Redirect the user back to the landing page, unless\n # the user has initiated an \"/init_XYZ\" request to create a resource.\n # redirect_to root_url\n end\n end", "def index\n @early_access_requests = EarlyAccessRequest.all\n end", "def show\n @request = current_user.requests.find(params[:id])\n end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def request; end", "def pre_connect(request); end", "def get_requests\n @requests\n end", "def req\n \n end", "def index\n @request_master = RequestMaster.new\n end", "def started_request_message(request); end", "def logme\n\t\tlogger.debug \"============Main ApplicationController get calls at #{Time.now}\"\n\tend", "def my_requests\n\t\tuser = current_user\n\n\t\t# get all requests accepted by user\n\t\t# in the future, edit this to filter out fulfilled (completed)\n\t\t@accepted_requests = user.accepteds\n\tend", "def set_home_request\n @home_request = HomeRequest.find(params[:id])\n end", "def show\n @startup = Startup.find(params[:id])\n \n \t$connectiontype=0\t\n\n if @startup.Investors.find_by_user_id(session[:id]) != nil\n\t \tif @startup.Investors.find_by_user_id_and_isowner(session[:id],1) != nil \n \t\t$connectiontype=2\n \telse\n \t\t$connectiontype=1\n \tend\n end\n\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @startup }\n end\n \n end", "def startup_relationship\n Relationship.between(self.user, self.startup)\n end", "def on_behalf_requestors\n return @on_behalf_requestors\n end", "def request_path; end", "def index\n if current_client\n @current_client_requests = current_client.requests\n else\n end\n end", "def generate_request\r\n end", "def request_info\n @requests = Request.ordered\n end", "def show\n @req = @company.implementer_requests\n end", "def show\n redirect_to edit_request_path(@request) if current_user.admin? && @request.pending?\n @request_templates = RequestTemplate.all\n end", "def after_request\n end", "def enforce_viewing_context_for_show_requests \n end", "def boot_location\n super\n end", "def show_req\n @user=find_user\n if !@user.nil?\n @use_reqs=@use_case.requirements.find :all\n session[:use_case_id]=@use_case.id\n @attr=Attribute.find_by_project_id(session[:project_id])\n respond_to do |format|\n format.html { render \"requirements/index\" }\n end\n else\n redirect_to sign_in_url\n end\n\n end", "def user_requested_by\n response = get(\"users/self/requested-by\")\n response\n end", "def startup\n end", "def request_log(request); end", "def set_request_start_time\n @request_start_time = Time.now\n end", "def request\n raise 'need to be implemented'\n end", "def index\n unless current_user.is_admin\n raise \"401\"\n end\n gon.requests = Request.all\n end", "def before_each(req)\n @subsection = \"signup\"\n @title = \"Sign Up for Lynr\"\n @stripe_pub_key = stripe_config.pub_key\n super\n end", "def quick_start_method\n main_service.quick_start_method&.rest\n end", "def before_dispatch(env); end", "def before_GET(req)\n super\n @subsection = 'vehicle-list'\n @title = \"Manage Vehicles\"\n end", "def my_request\n request = Request.where(user_id: @current_user.id)\n if request\n render json: {\n status: 'success',\n message: 'Requests found',\n data: request,\n },\n status: :ok\n else \n render json: {\n status: 'no-content',\n message: 'Requests not found',\n },\n status: :no_content\n end\n end", "def single_req_view\n SingleReqView.new(self)\n end", "def startup\n return Startup.where(:id => self.startup_id) if self.startup_id.present?\n return self.checkin.startup if self.checkin_id.present\n nil\n end", "def index\n @app_requests = AppRequest.all\n end", "def before_dispatch(_env)\n end", "def request_uri; end", "def on_global_request(type, &block); end", "def setup\n @event = Event.create(eventName: \"socialLogin\")\n @referral = Referral.create(referredBy: \"http://www.jumpstartlabs.com\")\n @request = Request.create(requestType: \"GET\")\n @resolution = Resolution.create(resolutionWidth: \"1920\", resolutionHeight: \"1280\")\n @url = Url.create(url: \"http://www.jumpstartlabs.com\")\n @user_agent = UserAgent.create(userAgent: \"Mozilla/5.0 (Macintosh%3B Intel Mac OS X 10_8_2) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1309.0 Safari/537.17\")\n @user = User.create(identifier: \"jumpstartlab\", rootUrl: \"hweoaw;eofiawofhawef\")\n end", "def request\n @controller.request\n end", "def request\n @controller.request\n end", "def request\n @controller.request\n end", "def set_admin_request\n @request = ::Request.find(params[:id])\n end", "def enable_on_behalf_requestors_to_add_access\n return @enable_on_behalf_requestors_to_add_access\n end", "def set_startup\n @startup = Startup.find(params[:id])\n end", "def set_startup\n @startup = Startup.find(params[:id])\n end", "def apply_request(request_env); end", "def app_starting?\n @launching\n end", "def requestor\n return @requestor\n end", "def startup\n end", "def startup\n end", "def startup\n end", "def set_request\n @request = Request.find(params[:id])\n if !show_request\n redirect_to requests_url, notice: \"Request not found.\"\n end\n end", "def pending_response_requests; end", "def showRequests\n \t\t# Ensure user is logged in to view this page\n\t\tif(session.has_key?(\"logged_in\"))\n\t\t\n\t\t\t# If the user is not logged in redirect to homepage\n\t\t\tif(session['logged_in'] != 1) \n\t\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\t\tend\n\n\t\t\t# Get user id.\n\t\t\t@userID = session['user_id']\n\n\n\t\t\t# ids of people requesting collaboration.\n\t\t\t@co_ids = Collaboration.where(second_id:@userID)\n\n\t\t\t@num = @co_ids.count\n\n\t\t\t# Arrays to store ids other requesters.\n\t\t\t@requester_ids = Array.new(@num)\n\t\t\t@names = Array.new(@num)\n\t\t\t@messages = Array.new(@num)\n\n\t\t\tfor i in 0..@num-1\n\t\t\t\t@requester_ids[i] = @co_ids[i].first_id\n\t\t\t\t@messages[i] = Collaboration.find_by(first_id:@requester_ids[i], second_id:@userID).message\n\t\t\t\t@names[i] = User.find(@co_ids[i].first_id).username\n\t\t\tend\n\n\t\telse\n\t\t\tredirect_to url_for(:controller => :home, :action => :showHome)\n\t\tend\n\tend", "def index\n if can?(:view_all)\n @requests = Request.all\n else\n @requests = Request.where(user_id: current_user.id)\n end\n end", "def show\n @request = Request.new\n end", "def user_service_request\n @service_requests = @user.get_user_service_requests(@page)\n end", "def index\n @request = Request.find(params[:request_id])\n if current_user.requisitante_transporte?\n if @request.status != \"EM ABERTO\"\n flash[:info] = \"Você não pode adicionar passageiros a requisição atual.\"\n redirect_to requests_url\n end\n end\n\n @request_passengers = @request.request_passengers\n @request_passenger = @request.request_passengers.new\n \n end", "def index\n if current_user.try(:admin?)\n @requests = Request.all\n else\n @requests = Request.find(:all, :conditions => ['requester_email = ? OR approver_email = ?', current_user.email, current_user.email])\n end\n\n end", "def before_request\n self.login if require_login? && !@authenticating\n end", "def set_request\n power = Power.new current_user\n if action_name == 'update'\n @requests = power.patchable_requests\n else\n @requests = power.requests\n end\n\n if @requests && params[:id]\n @request = @requests.find(params[:id])\n end\n end", "def show\n Rails.application.executor.wrap { @access_token = @lms_instance.oauth2_url.present? ? Lti13Service::GetAgsAccessToken.new(@lms_instance).call : nil }\n # caliper event background job\n # ToolUseEventWorker.perform_async(@lms_instance.id, @launch.id, root_url, request.uuid)\n end", "def request\n @request\n end", "def config\n requester.config \n end" ]
[ "0.6185273", "0.60964185", "0.59822327", "0.59533244", "0.5846475", "0.58300793", "0.58265173", "0.5817101", "0.57669276", "0.5752893", "0.57413894", "0.57252264", "0.56760705", "0.56101936", "0.5583395", "0.55816245", "0.55812365", "0.5568494", "0.55577356", "0.55425817", "0.5532737", "0.55243367", "0.55220973", "0.5459989", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.54538935", "0.5439183", "0.54266435", "0.5425107", "0.54219323", "0.54175234", "0.54160976", "0.53873986", "0.53861433", "0.53842807", "0.53807235", "0.5374532", "0.5362632", "0.53531396", "0.5350366", "0.53440887", "0.53430974", "0.5342658", "0.53426445", "0.5333651", "0.5324319", "0.5320454", "0.5300073", "0.5298273", "0.5294561", "0.52941287", "0.52918875", "0.5288753", "0.5282556", "0.527218", "0.5256958", "0.5253288", "0.525033", "0.5229761", "0.5227244", "0.5226568", "0.52264327", "0.5226372", "0.5225659", "0.5222284", "0.521474", "0.521474", "0.521474", "0.52117777", "0.52114713", "0.5209236", "0.52082586", "0.5202941", "0.5201245", "0.51999664", "0.519875", "0.519875", "0.519875", "0.51973337", "0.51938885", "0.51870614", "0.5184724", "0.5183667", "0.5182237", "0.51814204", "0.518105", "0.51805717", "0.51752734", "0.5169726", "0.5165594", "0.51584053" ]
0.6791154
0
=> Analyse l'option de ligne de commande
def treat_as_option doption option = nil valeur = nil if doption.start_with? '--' doption.gsub(/^--([^=]+)=?(.*)?$/){ option = $1 valeur = $2 } else option_courte = doption[1..1] option = OPTION_LIST[option_courte] fatal_error(:unknown_option, :option => option_courte) if option.nil? valeur = doption[2..-1] end # Est-ce que c'est une "option-command" if OPTION_COMMAND_LIST.has_key? option @@command = option else @@options = @@options.merge option => valeur end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def options(opt); end", "def options(opt); end", "def options() end", "def process_command_line_options\r\n begin\r\n defer, found = \"\", false\r\n opts = GetoptLong.new(\r\n [ \"--help\", \"-h\", \"-?\", GetoptLong::NO_ARGUMENT ],\r\n [ \"--load\", \"-l\", GetoptLong::REQUIRED_ARGUMENT ],\r\n [ \"--debug\", \"-d\", GetoptLong::NO_ARGUMENT ],\r\n [ \"--quit\", \"-q\", GetoptLong::NO_ARGUMENT ],\r\n [ \"--words\", \"-w\", GetoptLong::NO_ARGUMENT ])\r\n\r\n # Process the parsed options\r\n opts.each do |opt, arg|\r\n unless found\r\n puts; found = true\r\n end\r\n\r\n case opt\r\n when \"--debug\"\r\n @debug = true\r\n when \"--load\"\r\n defer << \"load\\\"#{arg}\\\" \"\r\n when \"--quit\"\r\n defer << \")quit \"\r\n when \"--words\"\r\n defer << \")words \"\r\n else\r\n fail SilentExit\r\n end\r\n end\r\n\r\n puts if found\r\n rescue Exception => e\r\n puts\r\n puts \"fOOrth available options:\"\r\n puts\r\n puts \"--help -h -? Display this message and exit.\"\r\n puts \"--load -l <filename> Load the specified fOOrth source file.\"\r\n puts \"--debug -d Default to debug ON.\"\r\n puts \"--quit -q Quit after processing the command line.\"\r\n puts \"--words -w List the current vocabulary.\"\r\n puts\r\n raise SilentExit\r\n end\r\n\r\n defer\r\n end", "def process_options\n \n end", "def process_options\n \n end", "def process_options\n \n end", "def process_options\n \n end", "def options(opt)\n end", "def parse_options; end", "def parse_options; end", "def option\n\t\t\tprint \"__________________________________\"\n\t\t\tputs \"****MENU****\"\n\t\t\tputs \"1) Generar archivo con promedios\"\n\t\t\tputs \"2) Inasistencias totales\"\n\t\t\tputs \"3) Alumnos que aprobaron\"\n\t\t\tputs \"4) Salir\"\n\t\t\tprint \"___________________________________\\n\\n\"\n\t\t\tputs \"Debe ingresar una opcion: \"\n\n\t\t\topcion = gets.chomp.to_i\n\t\t\treturn opcion\n\t\t\tend", "def parse_cli\n require 'getoptlong'\n require 'rdoc/usage'\n \n opts = GetoptLong.new(\n [ '--help', '-h', GetoptLong::NO_ARGUMENT ],\n [ \"--quote-terms\", '-q', GetoptLong::NO_ARGUMENT ]\n )\n \nend", "def options\n\tputs \"[A]dd employee\"\n\tputs \"[D]isplay the employee details\"\n\tputs \"[Q]uit\"\n\tputs \"\"\nend", "def thor_options_to_optparse\n flags = []\n %i[color progress debug interactive].each do |option|\n if options[option] then flags << \"--#{option}\"\n else flags << \"--no-#{option}\"\n end\n end\n flags\n end", "def aide\n <<EOF\nNOM\n #{$0} -- Script pour gestion academique (banque de cours)\n\nSYNOPSIS\n #{$0} [--depot=fich] commande [options-commande] [argument...]\n\nCOMMANDES\n aide - Emet la liste des commandes\n ajouter - Ajoute un cours dans la banque de cours\n (les prealables doivent exister)\n desactiver - Rend inactif un cours actif\n (ne peut plus etre utilise comme nouveau prealable)\n init - Cree une nouvelle base de donnees pour gerer des cours\n (dans './#{$DEPOT_DEFAUT}' si --depot n'est pas specifie)\n lister - Liste l'ensemble des cours de la banque de cours\n (ordre croissant de sigle)\n nb_credits - Nombre total de credits pour les cours indiques\n prealables - Liste l'ensemble des prealables d'un cours\n (par defaut: les prealables directs seulement)\n reactiver - Rend actif un cours inactif\n supprimer - Supprime un cours de la banque de cours\n trouver - Trouve les cours qui matchent un motif\nEOF\nend", "def parse_options\n @options = {}\n @optparse = OptionParser.new do |opts|\n opts.banner = \"Usage: moa-getfacl [options] <object-name> ...\\n\\n Object Store ACL Listing\\n\\n\"\n\n # @options[:numeric] = false\n # opts.on( '-n', 'Display user IDs numerically' ) do\n # @options[:numeric] = true\n # end\n\n opts.on( '-?', '--help', 'Display this screen' ) do\n puts opts\n exit 0\n end\n end\n\n @optparse.parse!\nend", "def parsed_options?\n @optparse = OptionParser.new do |opts|\n \n # A usage banner\n opts.banner = \"Usage: #{File.basename($0)} [options]\"\n \n # Returns the current version of the tool\n opts.on_tail('-v', '--version', \"Display version\") { output_version ; exit 0 }\n \n # Quick distribution\n options[:quickpkg] = nil\n opts.on( '-Q', '--quickpkg <app>', 'Create a quick application distribution (simple)' ) do |app|\n options[:quickpkg] = app\n end\n \n # Create a new project\n options[:createproj] = nil\n opts.on_head( '-C', '--createproj <dir>', String, 'Create a project directory (advanced)' ) do |proj|\n options[:createproj] = proj\n end\n \n # Specify an existing project\n options[:projectdir] = nil\n opts.on_head( '-D', '--projectdir <dir>', String, 'Specify a project directory to work with' ) do |dir|\n options[:projectdir] = dir\n end\n \n # Update the Radmind command file\n options[:ktcheck] = nil\n opts.on( '-K', '--ktcheck', 'Update the Radmind client command file' ) do |check|\n options[:ktcheck] = check\n # puts \"Updating the client's command file: #{options[:ktcheck]}\"\n end\n\n # Convert a Radmind transcript\n options[:convert] = nil\n opts.on( '-t', '--tconvert <transcript>', 'Convert a createable transcript to an appliable transcript' ) do |transcript|\n options[:tconvert] = transcript\n end\n\n # Fetch a converted Radmind loadset\n options[:fetch] = nil\n opts.on( '-f', '--fetch <transcript>', 'Fetch a converted Radmind transcript' ) do |transcript|\n options[:fetch] = transcript\n end\n \n # Specify a radmind host\n options[:radhost] = nil\n opts.on( '-h', '--radhost <host>', 'Specify the Radmind server host' ) do |host|\n options[:radhost] = host\n end\n\n # Generate the boilerplate\n options[:boil] = nil\n opts.on( '-b', '--boil', 'Generate boilerplate ' ) do |boil|\n options[:boil] = boil\n end\n \n # Package up the project's pkgroot\n options[:package] = nil\n opts.on('-p', '--package', 'Package your project ') do |package|\n options[:package] = package\n end\n\n # Archive the package inside a disk image\n options[:rollup] = nil\n opts.on('-r', '--rollup', 'Create a disk image of your package ') do |rollup|\n options[:rollup] = rollup\n end\n \n # Use Radmind security?\n options[:security] = nil\n opts.on( '-w', '--secure <level>', 'Use security level 0, 1 or 2 for Radmind operations' ) do |level|\n options[:secure] = level\n end\n\n # Use Radmind checksums\n options[:cksum] = nil\n opts.on( '-c', '--cksum <hash>', 'Update the Radmind client command file' ) do |hash|\n options[:cksum] = hash\n end\n \n # Prints a detailed help message\n opts.on_tail('--help', 'Show detailed help and information') do\n output_version\n output_help\n end\n \n end\n \n # Parse the options\n # * A non-successful parse operation presents a list of the acceptable options\n begin\n @optparse.parse!\n rescue => error\n puts error.message + \"\\n\"\n puts @optparse\n exit 1\n end\n\n # Pre-process the options before we validate them\n process_options\n true\n \n end", "def showOptions()\n\t\tif defined? @@opt\n\t\t\tgetOptions(@@opt)\n\t\telse\n\t\t\t# there is no option file on current path, maybe not a module path?\n\t\t\tputs \"[-]\".red + \" No options available. Are you using a module?\"\n\t\t\t\n\t\tend\n\tend", "def opt_parse # rubocop:disable Metrics/AbcSize\n case @options[:action]\n when 'create'\n build_looper('instances')\n when 'list'\n formatter(list)\n when 'delete'\n puts delete\n when 'get_ip'\n BmcAuthenticate.new(@options)\n attrcheck = { 'instance' => @options[:inst] }\n @validate.validate(@options, attrcheck)\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_ocid = inst_details.instance\n ips = list_instance_ip(@options[:compartment], inst_ocid)\n puts 'The private IP is ' + ips.at(0) + ' the public ip is ' + ips.at(1)\n when 'InstanceConsoleHistory'\n chist = InstanceConsoleHistory.new\n chist.options = @options\n chist.validate = @validate\n formatter(chist.list) \n else\n 'you have entered an incorrect value, correct values are get_ip, create, list, list_image, delete'\n end \n end", "def putOptionsSimple\n puts 'Option 1: Print code'\n puts 'Option 2: Print name'\n puts 'Option 3: Print country'\n puts 'Option 4: Print continent'\n puts 'Option 5: Print Timezone'\n puts 'Option 6: Print Latituted and Longitude'\n puts 'Option 7: Print population'\n puts 'Option 8: Print region'\n puts 'Option 9: List cities within reach'\n puts 'Option 10: Escape'\n \n option = gets\n option = checkEndCon(option.to_i, 1, 10)\n return option\n end", "def call_option(input)\n if (/^[0-#{@@main_ops.length - 1}]$/.match(input))\n print \"\\e[H\\e[2J\"\n puts @@headings[input.to_i]\n case input\n when '0'\n add_contact\n pause\n when '1'\n modify_contact\n pause\n when '2'\n display_all_contacts\n pause\n when '3'\n display_one_contact\n pause\n when '4'\n display_attribute_across\n pause\n when '5'\n delete_contact\n pause\n end \n else \n puts \"Error: option #{input} not recognized.\"\n end\n end", "def command_run_options(c, str_opts)\n c.option '-c', '--categories [string]', String, str_opts.categories\n c.option '-d', '--dl-method [string]', String, str_opts.dl_method\n c.option '-n', '--number [integer]', Integer, str_opts.number\n c.option '-p', '--player [string]', String, str_opts.player\n c.option '-r', '--rng [string]', String, str_opts.rng\n end", "def verify_options_hook; end", "def options\n self.read_attribute(:options).split(\"\\n\") unless self.read_attribute(:options).nil?\n end", "def unrecognized_option(err); end", "def print_options(format)\n help = execute(\"python #{@@executables[format]} --help\")\n # non-hyphenated long options to symbols\n help.gsub!(/(\\-\\-)([A-Za-z0-9]+)([=|\\s])/, ':\\2\\3')\n # hyphenated long options to quoted strings\n help.gsub!(/(\\-\\-)([\\w|\\-]+)(\\n)?[^$|^=|\\]]?/, '\\'\\2\\'\\3')\n # equal to hashrocket\n help.gsub!(/\\=/, ' => ')\n # hort options to symbols\n help.gsub!(/([^\\w])\\-(\\w)([^\\w])/, '\\1:\\2\\1')\n # short options with args get a hashrocket\n help.gsub!(/(:\\w) </, '\\1 => <')\n puts help\n end", "def extractable_options?; end", "def main_options\n commands = {\"1\" => \"See all buildings\" ,\n \"2\" => \"Set a unit as rented/avalilable\" ,\n \"3\" => \"Create new Building\",\n \"4\" => \"Exit program\"}\n\n commands.each do |option, description |\n puts \"#{option} - #{description} \"\n end\n print \"\\n:>\"\n gets_chomp(commands)\n end", "def extract(_options_str = nil)\n @options_str = _options_str if _options_str # hook for testing\n @extract ||= begin\n lines_containing_options = options_str.split(/\\n/).grep(/^[\\s\\t]+-/)\n all_options = lines_containing_options.inject([]) do |list, line|\n list + line.scan(/(?:^\\s+|,\\s)(-[\\w-]+)/).flatten\n end\n long_options = all_options.grep(/^--/).sort\n short_options = hide_short_flags? ? [] : (all_options - long_options).sort\n long_options + short_options\n end\n end", "def option_type; end", "def parse_options=(_arg0); end", "def parse_options=(_arg0); end", "def parse_options\n @opts = Slop.parse do |o| \n o.string '-f1', '--file1', 'First source file'\n o.string '-f2', '--file2', 'Second source file'\n o.on '-v', '--version' do\n puts Slop::VERSION\n end\n end\n rescue Exception => e\n raise\n end", "def make_option_list\n end", "def make_option_list\n end", "def usage\n puts \"\\nUsage: #{$PROGRAM_NAME} operation [option1] [option2]\\n\"\n puts \"\\n\\toperations: peers|replications|testfailover[or test]|testcleanup[or cleanuptest]|failover[or recovery]\"\n puts \"\\n\\te.g. #{$PROGRAM_NAME} peers\"\n puts \"\\te.g. #{$PROGRAM_NAME} replications ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} replications <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testfailover [or test] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testfailover [or test] ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} testcleanup [or cleanuptest] cleanuptest ALL\"\n puts \"\\te.g. #{$PROGRAM_NAME} failover [or recovery] <VM name>\"\n puts \"\\te.g. #{$PROGRAM_NAME} failover [or recovery] recovery ALL\"\n puts \"\\n\"\n \nend", "def program_options\n [\n # The values of the array are,\n # [long_option, short_option and parameter, description, code to execute] \n ['--to', '-t TO', \"Send email to recipent\",\n lambda { |value| options.to = value }\n ],\n ['--message', '-m MESSAGE', \"Include the message.\",\n lambda { |value| options.message = value }\n ],\n ['--subject', '-s SUBJECT', \"Include the subject.\",\n lambda { |value| options.subject = value }\n ],\n ['--verbose', '-v', \"Log to standard output.\",\n lambda { |value| options.verbose = true }\n ],\n ['--version', '-V', \"Display the program version.\",\n lambda { |value|\n puts \"#{program_name}, version #{PROGRAM_VERSION}\"\n exit\n }\n ]\n ]\nend", "def get_options\n if parts = @text.match(/([\\d]*) (.*)/)\n return parts[1].strip, parts[2].split(\",\").map(&:strip)\n end\n end", "def getOptions\n @options = Array.new\n # format of options argument\n optionsPattern = Regexp.new(/\\-[\\w]+/)\n # check to see if options are formatted correctly\n if optionsPattern.match(ARGV[0])\n # get each option and push them to an array \n # start at 1 to ignore - \n for i in 1..ARGV[0].length - 1\n @options.push(ARGV[0][i])\n end # -- end for loop to get options\n else\n abort(\"First argument needs to be an option.\\nExample:\\n\\t ruby OSQuery -i Blood_rune\")\n end # -- end valid options check\nend", "def process_options\n options.delete_if { |x,y| y.nil? }\n if options.empty?\n puts @optparse \n exit 0\n end\n options.each do |x,y|\n begin\n if y.to_s.match('^-')\n raise BoilerMakerErr.new(\"Bad args: \\\"#{y}\\\" is not a valid arg to option, \\\"--#{x}\\\". Use the -h flag for syntax help.\")\n end\n rescue => error\n puts error.message + \"\\n\"\n exit 1\n end\n end\n end", "def extractable_options?; true end", "def options1 \n <<~OPTIONS\n\n What would you like to know about? :\n\n 1. Traits\n 2. Physical Traits\n 3. Ruling Planet\n 4. Compatible signs\n 5. Dates\n 6. Favorite things\n 7. More\n OPTIONS\n end", "def testCommandLineDetailedListShort\n executeSlave( [ '-e' ] )\n end", "def get_options; end", "def listOptions\r\n\r\n puts \"Hello. This calculator has the following options.\"\r\n\r\n while (!@check_action)\r\n puts \"\\nChoose what you want to calculate:\"\r\n listMethods\r\n action = gets.chomp.upcase\r\n case action\r\n when \"BMI\"\r\n bodyMassIndex\r\n when \"SPEED\"\r\n mediumSpeed\r\n when \"TRI\"\r\n triangleArea\r\n when \"EXIT\"\r\n @check_action = true\r\n else\r\n puts \"Not a valid entry. Please check again your options.\"\r\n end\r\n end\r\n\r\n puts \"Goodbye.\"\r\n end", "def process\n begin\n aux_option = remove_unwanted_chars(@_option)\n\n # unprocessed option list\n option_list = aux_option.split(%r{\\*/|\\];})\n\n option_list.each do |op|\n begin\n if op.to_s.index('=[') != nil\n ntec_option = NtecOption.new\n ntec_option.options = []\n\n # get option name\n ntec_option.name = op[0..op.index('=[')-1].strip\n\n # get unprocessed option\n unprocessed_option = op[op.index('=[')+2..op.length]\n\n # process option\n if (unprocessed_option.to_s.index('],')) == nil\n\n #removes [] if its just like this data=[[zczczxc]];\n unprocessed_option = process_item_list(unprocessed_option)\n\n ntec_option.options.push(unprocessed_option.strip) # return just one item...\n else\n # split option list [A], [b], [C]\n option_items = unprocessed_option.split(%r{\\],})\n\n option_items.each do |item|\n aux_item = item.strip\n\n if aux_item != ''\n processed_item = process_item_list(aux_item)\n ntec_option.options.push(processed_item)\n end\n end\n end\n @ntec_option_list.push(ntec_option)\n end\n\n rescue Exception => e\n puts 'Error processing option: ' + e.message\n end\n end\n\n rescue Exception => e\n throw 'Error processing options: ' + e.message\n end\n end", "def menu_options()\n print_message 'Select operation to perform'\n print_message '1. Add'\n print_message '2. Substract'\n print_message '3. Multiply'\n print_message '4. Divide'\n print_message \"Or press 'q' to exit calculator app\"\n end", "def parse_options\n case ARGV[1]\n when \"-p\", \"-plugin\"\n return true\n when \"-u\", \"-unplug\"\n return true\n else\n return false\n end\nend", "def common_opts(opt)\n opt.on_tail(\"-h\", \"-?\", \"--help\", \"Show this help message.\") do\n puts opt\n exit\n end\n opt.on_tail(\"-v\", \"--version\", \"Show the version.\") do\n puts \"Taverna 2 Server Ruby Gem version: #{T2Server::Version::STRING}\"\n exit\n end\n end", "def program_options\n [\n # The values of the array are,\n # [long_option, short_option and parameter, description, code to execute]\n ['--verbose', '-v', \"Log to standard output.\",\n lambda { |value| options.verbose = true }\n ],\n ['--version', '-V', \"Display the program version.\",\n lambda { |value|\n puts \"#{program_name}, version #{PROGRAM_VERSION}\"\n exit\n }\n ]\n ]\nend", "def show_options\n head :ok\n end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def program_options\n [\n # The values of the array are,\n # [long_option, short_option and parameter, description, code to execute]\n ['--google', '-g', \"Format for Google blogger.\",\n lambda { |value| options.google = true }\n ],\n ['--jayway', '-j', \"Format for Jayway blog.\",\n lambda { |value| options.jayway = true }\n ],\n ['--utf', '-u', \"Include meta charset utf8\",\n lambda { |value| options.utf = true }\n ],\n ['--stylesheet', '-s', \"Add a stylesheet, md.css\",\n lambda { |value| options.stylesheet = true }\n ],\n ['--verbose', '-v', \"Log to standard output.\",\n lambda { |value| options.verbose = true }\n ],\n ['--version', '-V', \"Display the program version.\",\n lambda { |value|\n puts \"#{program_name}, version #{PROGRAM_VERSION}\"\n exit\n }\n ]\n ]\nend", "def parse_options\nmain_opts = %w(jadd cadd jgadd cgadd wadd sum list ausgleich)\nbetrag_opts = %w(jadd cadd jgadd cgadd wadd)\n\n\tusage if ARGV.size < 1\n\n\toptions = {:modus => ARGV.shift}\n\n\tusage unless main_opts.include?(options[:modus])\n\n\tif betrag_opts.include?(options[:modus])\n\t\tusage if ARGV.size < 1\n\t\toptions[:betrag] = ARGV.shift.to_f\n\t\toptions[:tags] = sanitize_tags(ARGV)\n\n\t\toptions[:jahr] = Time.now.year\n\t\toptions[:monat] = Time.now.month\n\telsif options[:modus] == \"sum\" || options[:modus] == \"list\"\n\t\t#usage if ARGV.size < 1\n\t\toptions[:name] = parse_name\n\t\toptions[:jahr], options[:monat] = parse_date\n\telsif options[:modus] == \"ausgleich\"\n\t\toptions[:jahr], options[:monat] = parse_date\n\tend\n\n\treturn options\nend", "def read_vm_option(option, uuid = @uuid)\n out = execute_prlctl('list', uuid, '--no-header', '-o', option).strip\n raise Errors::ParallelsVMOptionNotFound, vm_option: option if out.empty?\n\n out\n end", "def option_command?\n options || @option_command\n end", "def parse_command_line(gimmicode_arguments)\n begin\n OptionParser.new do |opts|\n opts.banner = $usage\n \n opts.separator \"\"\n opts.separator \"Specific options:\"\n\n opts.on('-h', '--help [COMMAND]', 'Show this message or the help of the given command') do |h|\n if h == \"of\" or h == \"convert\"\n exec(\"#{$current_directory}/gimmicode-#{h} -h\")\n else\n puts opts\n puts \"\"\n puts \"Commands:\"\n puts \" of\\t\\tGet the codes of the given characters\"\n puts \" convert\\tConvert Unicode data readable by gimmicode of\"\n exit\n end\n end\n end.parse!(gimmicode_arguments)\n rescue OptionParser::ParseError => e\n puts e.message.capitalize\n puts $usage\n exit\n end\nend", "def option_details\n @@option_details\n end", "def parse_command_line\n OptionParser.new do |opts|\n opts.banner = \"Usage: ruby #{$0} [options]\"\n\n opts.on_head(\"-h\", \"--help\", \"Show this help message\") do\n puts opts\n exit\n end\n\n opts.on(\"-v\", \"--verbose\", \"Show all progress messages (INFO, DEBUG, WARNING, ERROR)\") do\n Logger.verbose = true\n end\n\n opts.on(\"-q\", \"--quiet\", \"Only show WARNING and ERROR messages\") do\n Logger.quiet = true\n end\n\n opts.on(\"--console\", \"Open up a console to query the source via rbgccxml\") do\n @requesting_console = true\n end\n\n opts.on(\"--clean\", \"Force a complete clean and rebuild of this extension\") do\n @force_rebuild = true\n end\n\n end.parse!\n end", "def info\n %[\n== Description\n\nIF YOU SEE THIS IN A REAL OOBJECT, YOU NEED TO REDEFINE info() METHOD\n\nThis check does nothing. It's used as a base class for \"real\" checks\n\n== Parameters in config file\n\n :none: It doesn't use any additional parameter\n\n== Objects format\n\n :none:\n :option1: \n]\n end", "def parse_options()\n options = { :threshold => 50,\n :verbose => false,\n :remotes => false,\n :status => false}\n options[:remotes] = ARGV[0] == 'remotes'\n options[:status] = ARGV[0] == 'status'\n\n\n optparse = OptionParser.new do|opts|\n opts.banner = $banner\n opts.on( '-t N', '--threshold VAL', Integer, \"If a remote has <= theshold dirs, they will be listed. -1 to print all. Default #{options[:threshold]}\" ) do |value|\n options[:threshold] = value\n end\n opts.on('-v', '--verbose', 'Verbose output') do |v|\n $verbose = v\n end\n opts.on( '-h', '--help', 'Display this screen' ) do\n puts opts\n exit\n end\n end\n optparse.parse!\n\n if(!options[:remotes] and !options[:status])\n raise OptionParser::MissingArgument.new('Must specify an action: remotes, unclean')\n end\n\n return options\nrescue OptionParser::MissingArgument\n puts optparse\n raise\nend", "def Mostrar_Opcion\n opt = gets.chomp.to_i.abs\n\n case opt\n when 1\n Rango_Numero()\n pausa()\n when 2\n Rango_Letras()\n pausa()\n when 3\n @exit = true\n else puts \"\\nOpcion Incorrecta\"\n end\n end", "def usage()\n puts \"you can use it wih the following options\"\n puts \"-w <a word> search sentences containing this word\"\n puts \"-i <id> search sentences with this id\"\n puts \"-l <lang> search sentences from this lang (lang is its iso 639 alpha 3 code\"\nend", "def Mostrar_Opcion\n opt = gets.chomp.to_i.abs\n\n case opt\n when 1\n Multiplicar_Cadena()\n pausa()\n when 2\n puts \"\\n\"\n Revertir_Cadena()\n pausa()\n when 3\n puts \"\\n\"\n Longitud_Cadena()\n pausa()\n when 4\n puts \"\\n\"\n Mayuscula_Cadena()\n pausa()\n when 5\n puts \"\\n\"\n Miniscula_Cadena()\n pausa()\n when 6\n @exit = true\n else puts \"\\nOpcion Incorrecta\"\n end\n end", "def process_options\n \n \n @options.verbose = false if @options.quiet\n end", "def parse_command_line_options\n options = {}\n options[:config] = \"config/clamav.yml\" # default\n opts = OptionParser.new\n # define options\n opts.banner = \"Usage: clamav.rb [-c file] [-u] [-i time]\"\n opts.on('-c', '--config FILE',\n \"Specify config file other than default \",\n \"'config/clamav.yml' - use relative path\") do |file|\n options[:config] = file\n end\n opts.on('-i', '--install TIME', Time,\n \"Install LaunchAgent to run clamav.rb every\",\n \"day at specified time {eg: 2:30pm}\",\n \"Try using with --config FILE\",\n \"Requires RELOGIN\") do |time|\n options[:install] = time\n end\n opts.on('-u', '--uninstall', \"Uninstall LaunchAgent - requires RELOGIN\") do |time|\n options[:uninstall] = true\n end\n opts.on_tail(\"-h\", \"--help\", \"Show this message\") {puts opts; exit 0}\n opts.on_tail(\"-v\", \"--version\", \"Show version\") {puts \"clamav.rb 1.1.0\"; exit 0}\n # parse options\n opts.parse!(ARGV)\n options\nend", "def parse_command\n log_and_exit read_template('help') if @input.empty?\n @command = @input.shift\n \n while @input.any?\n opt = @input.shift\n \n if opt =~ /^--(\\w+)(=(\"[^\"]+\"|[\\w]+))*/\n name = $1\n value = $3 ? $3.gsub(/\"/, \"\") : true\n @named_options[name] = value\n else\n @options << opt\n end\n end\n end", "def get_options\n ARGV.options { |opt|\n opt.banner = \"Usage: ruby #{__FILE__} [options] \"\n\n opt.on(\"--help\", \"What you see right now\"){ puts opt; exit 0}\n\n #Try testing with this\n #ruby __FILE__ -x -c -s test\n opt.on(\"-x\", \"parse arguments and show Usage\") {|@quit|}\n\n opt.on(\"--doc=DIRECTORY\", String, \"Output rdoc (Ruby HTML documentation) into directory\"){|dir|\n system(\"rdoc -o #{dir} #{__FILE__}\")\n }\n\n opt.on(\"--verbose\", \"-v\", \"print intermediate steps to STDERR\"){|@verbose|}\n\n opt.on(\"--schema\", \"-S\", \"Use Schema i.e. XSD rather than XML document\"){|@opt_schema|}\n\n opt.on_tail(\"By default splits data according to opt_filter, \",\n \"Subset plots on #{@opt_subset}. Will not create histograms\")\n\n opt.parse!\n } or exit(1);\n\n if @quit\n pp self\n (print ARGV.options; exit)\n end\n\n rescue NameError => err\n STDERR.puts \"ERROR: #{err}\"\n exit 1\n rescue => err\n STDERR.puts \"ERROR: #{err}\"\n exit 1\n end", "def parse_options\n @options = {}\n @optparse = OptionParser.new do |opts|\n opts.banner = \"Usage: moa-metadata [options] <object-name> ...\\n\\n Cat objects metadata (to stdout)\\n\\n\"\n\n # @options[:numeric] = false\n # opts.on( '-n', 'Display user IDs numerically' ) do\n # @options[:numeric] = true\n # end\n\n opts.on( '-?', '--help', 'Display this screen' ) do\n puts opts\n exit 0\n end\n end\n\n @optparse.parse!\nend", "def common_options(opts)\n opts.separator ''\n opts.separator 'Other options:'\n opts.on('--[no-]color', 'Run without color') do |v|\n Term::ANSIColor.coloring = v\n end\n opts.on_tail('-v', '--version', 'Show version.') do\n ui.trace \"inch #{Inch::VERSION}\"\n exit\n end\n opts.on_tail('-l', '--language [LANGUAGE]',\n 'Set language (elixir|javascript|ruby).') do |language|\n @language = language\n end\n opts.on_tail('-r', '--read-from-dump [FILE]',\n 'Read objects from dump.') do |file|\n @read_dump_file = file\n end\n opts.on_tail('-h', '--help', 'Show this help.') do\n ui.trace opts\n exit\n end\n end", "def getRealInformation(csa)\n puts 'Information from CSA'\n puts 'Option 1: Go to Simple Information'\n puts 'Option 2: Go to statistic Information'\n puts 'Option 3: List all of the cities available'\n puts 'Option 4: Get All Routes'\n puts 'Option 5: Modify Routes'\n puts 'Option 6: Save Information'\n puts 'Option 7: Route Information'\n puts 'Option 8: Shortest Route'\n puts 'Option 9: Merge File'\n puts 'Option 10: Escape'\n \n option = gets\n option = checkEndCon(option.to_i, 1,10)\n \n return option\n \n end", "def options\n puts \"Here are your options:\"\n puts \" \"\n puts \"1 : Create a new apartment.\"\n puts \"2 : Create a new person.\"\n puts \"3 : List all appartments in your building.\"\n puts \"4 : List all the people in an apartment.\"\n puts \"5 : Quit\"\n puts \" \"\n puts \"What would you like to? (Type a number)\"\nend", "def help\n puts @option_parser\n exit\n end", "def test_parse04a\n ArgumentManager.add_option([ 'u-opt' ], :type => :string, :mandatory => true, :df_str => 'foo' )\n \n assert_raise( RuntimeError ) {\n options = ArgumentManager.parse( [] )\n }\n end", "def option?(param)\n param[0] == \"-\"\n end", "def print_help\n\t\t\t\t# Print app name\n\t\t\t\tif @app_name then\n\t\t\t\t\tprint \"#{@app_name}\"\n\t\t\t\t\tprint \" #{@app_version}\" if @app_version > 0\n\t\t\t\t\tprint \" - #{@description}\" if @description\n\t\t\t\t\tprint \"\\n\"\n\t\t\t\tend\n\n\t\t\t\t# Print usage\n\t\t\t\tprint \"#{@messages[\"pre_usage\"]}\\n\" if @messages[\"pre_usage\"]\n\t\t\t\tprint \"#{@usage ? @usage : \"Usage: #{ARGV[0]} [OPTIONS]\"}\\n\"\n\n\t\t\t\t# Print pre_options\n\t\t\t\tprint \"#{@messages[\"pre_options\"]}\\n\" if @messages[\"pre_options\"]\n\t\t\t\tprint \"\\nValid options are:\\n\"\n\n\t\t\t\t# Order options for printing\n\t\t\t\t@sorted_opts = @inserted[:name].sort do |first, second|\n\t\t\t\t\t@options[first][:priority] != @options[second][:priority] ? @options[first][:priority] <=> @options[second][:priority] : @inserted[:name].index(first) <=> @inserted[:name].index(second)\n\t\t\t\tend\n\n\t\t\t\t# Add options, saving max length\n\t\t\t\tpopts = {}\n\t\t\t\tmaxlen = -1\n\t\t\t\t@sorted_opts.each do |key|\n\t\t\t\t\topt = @options[key]\n\n\t\t\t\t\tpopt = \"#{[opt[:short], opt[:long]].join(\", \")}\"\n\t\t\t\t\tpopt += (\"=\" + (opt[:meta] ? opt[:meta] : \"ARG\")) if ![:bool, :action].include?(opt[:type])\n\t\t\t\t\tpopts[key] = popt\n\t\t\t\t\tmaxlen = popt.length if popt.length > maxlen\n\t\t\t\tend\n\n\t\t\t\t# Print options\n\t\t\t\t@sorted_opts.each do |key|\n\t\t\t\t\tval = popts[key]\n\t\t\t\t\tprint \"\\t#{val}#{\" \" * (5 + (maxlen - val.length))}#{@options[key][:help]}\\n\"\n\t\t\t\tend\n\n\t\t\t\t# Print post_options\n\t\t\t\tprint \"#{@messages[\"post_options\"]}\\n\" if @messages[\"post_options\"]\n\t\t\tend", "def choose_from_historique\n @historique || (return error('Aucune commande n’a encore été entrée. Pas d’historique des commandes.'))\n msg = Array.new\n msg << \"\\n\"\n msg << \"Choisir la commande :\"\n @historique.each_with_index{|c,i| msg << \"\\t#{(i+1).to_s.ljust(4)} #{c}\"}\n msg << \"\\n\"\n puts msg.join(\"\\n\")\n choix = getc(\"Commande à rejouer\")\n case choix\n when /^([0-9]+)$/\n return @historique[choix.to_i - 1]\n end\n end", "def usage\n txt = [\"\\nOPTIONS:\\n\"]\n\n fmt.sort.each do |entry|\n fmtspec, val = entry\n opt = val[0] ? \" <opt> \" : \" \"\n txt << \" #{fmtspec.ljust(longest.length)}#{opt}#{val[1]}\"\n end\n\n txt << \"\"\n txt.join(\"\\n\")\n end", "def options(opt)\n []\n end", "def parse_command_line\n prepend_environment_options\n options = options_with_defaults\n\n OptionParser.new do |parser|\n\n parser.on(\"-h\", \"--help\", \"Show help\") do |_help_requested|\n ARGV << 'h' # pass on the request to the command processor\n options.suppress_command_line_validation = true\n end\n\n parser.on('-i', '--input_dir DIR',\n \"Input directory containing source data files, default: '#{DEFAULT_INPUT_DIR}'\") do |v|\n options.input_dir = File.expand_path(v)\n end\n\n parser.on('-o', '--output_dir DIR',\n \"Output directory to which report files will be written, default: '#{DEFAULT_OUTPUT_DIR}'\") do |v|\n options.output_dir = File.expand_path(v)\n end\n\n parser.on('-r', '--receipt_dir DIR',\n \"Directory root from which to find receipt filespecs, default: '#{DEFAULT_RECEIPT_DIR}'\") do |v|\n options.receipt_dir = File.expand_path(v)\n end\n\n parser.on('-s', '--shell', 'Start interactive shell') do |v|\n options.interactive_mode = true\n end\n\n parser.on('-v', '--[no-]verbose', 'Verbose mode') do |v|\n options.verbose_mode = v\n end\n\n parser.on('-y', '--[no-]say', 'Say error messages.') do |v|\n options.say = v\n end\n\n parser.on('', '--[no-]receipts', 'Include report on existing and missing receipts.') do |v|\n options.do_receipts = v\n end\n end.parse!\n\n if options.verbose_mode\n puts \"Run Options:\"\n ap options.to_h\n end\n\n options\n end", "def Mostrar_Opcion\n opt = gets.chomp.to_i.abs\n\n case opt\n when 1\n Suma()\n pausa()\n when 2\n Resta()\n pausa()\n when 3\n Division()\n pausa()\n when 4\n Multiplicacion()\n pausa()\n when 5\n Potencia()\n pausa()\n when 6\n Residuo()\n pausa()\n when 7\n @exit = true\n else puts \"\\nOpcion Incorrecta\"\n end\n end", "def fetch_options\n options = {}\n opts = GetoptLong.new(\n ['--radar-scan-path', GetoptLong::REQUIRED_ARGUMENT],\n ['--known-items-dir-path', GetoptLong::REQUIRED_ARGUMENT],\n ['--help', GetoptLong::NO_ARGUMENT]\n )\n opts.each do |opt, arg|\n options[opt] = arg\n end\n\n if options['--help']\n puts 'Usage: bin/space-radar [--radar-scan-path FILE] [--known-items-dir-path FOLDER]'\n puts 'The data files need to have the \\'txt\\' extension.'\n puts 'The default data will be used if no paths given.'\n exit 0\n end\n\n options\n end", "def parse_cmd_line\n options = {\n files: [],\n config_file: 'grifter.yml',\n authenticate: true,\n #by leaving environment unset, grift will use GRIFTER_ENVIRONMENT variable if no -e is used on cmd line\n #environment: nil,\n }\n\n optparse = OptionParser.new do |opts|\n opts.banner = %Q|\n Grifter HTTP JSON APIs Client\n example, run a data script: bin/grifter -f script.rb\n example, call a method: bin/grifter <grift method name>\n\n |\n\n opts.on(\"-f\", \"--script=FILENAME\",\n \"specify a script file to run\") { |file| options[:files] << file }\n\n opts.on(\"-d\", \"--script-dir=dir\",\n \"specify a directory of grift scripts, run all of them\") { |dir| options[:files] += Dir[\"#{dir}/**/*.rb\"] }\n\n opts.on(\"-v\", \"--verbose\",\n \"debug logging, see every request and response in detail\") { Log.level = Logger::DEBUG }\n\n opts.on(\"-q\", \"--quiet\",\n \"quiet logging, warnings and errors only\") { Log.level = Logger::WARN }\n\n opts.on(\"-c\", \"--config=FILENAME\",\n \"config filename\") { |fn| options[:config_file] = fn }\n\n opts.on('-e', '--environment=ENVIRONMENT',\n \"environment name\") { |e| options[:environment] = e.to_sym }\n\n opts.on(\"-n\", \"--no-authenticate\",\n \"Do not authenticate\") { options[:authenticate] = false }\n\n opts.on('-l', \"--list\", \"Print each available grift method\") do\n options[:list_grift_methods] = true\n options[:authenticate] = false #no point in authenticating for --list\n end\n\n end\n optparse.parse!\n options\nend", "def optparse_args\n if short\n [\"--#{name}\", \"-#{short}\", desc, :REQUIRED]\n else\n [\"--#{name}\", desc, :REQUIRED]\n end\n end", "def options=(_arg0); end", "def options=(_arg0); end", "def options=(_arg0); end", "def options=(_arg0); end", "def options=(_arg0); end", "def options=(_arg0); end", "def options=(_arg0); end" ]
[ "0.6377345", "0.637626", "0.63755816", "0.63435525", "0.62745917", "0.6246886", "0.6246886", "0.6246886", "0.62201804", "0.6167451", "0.6167451", "0.6129034", "0.60767967", "0.6074044", "0.6066357", "0.60486495", "0.60095185", "0.59998876", "0.5972892", "0.59635955", "0.5933406", "0.59275687", "0.5897945", "0.58714813", "0.5871194", "0.5862871", "0.5847053", "0.5845881", "0.58458513", "0.5839791", "0.5833133", "0.58192956", "0.58192956", "0.5814834", "0.58072644", "0.58072644", "0.5792043", "0.5774245", "0.5767308", "0.57644606", "0.57608175", "0.5759989", "0.5758198", "0.57580346", "0.57458293", "0.57326394", "0.5721596", "0.5720226", "0.57166266", "0.57074195", "0.5702692", "0.5698585", "0.5677699", "0.5677699", "0.5677699", "0.5677699", "0.5677699", "0.5677699", "0.5677699", "0.5677699", "0.5677699", "0.5665753", "0.5661255", "0.5655952", "0.565286", "0.5648116", "0.56409675", "0.56396776", "0.56305444", "0.56305236", "0.56295466", "0.5626569", "0.562562", "0.5623583", "0.56218725", "0.562112", "0.5621053", "0.5619451", "0.5607023", "0.5601435", "0.55957013", "0.5583678", "0.55807596", "0.55758566", "0.5569012", "0.55671495", "0.5564796", "0.555867", "0.5558664", "0.55576026", "0.55561745", "0.55558777", "0.5551703", "0.5548655", "0.5548655", "0.5548655", "0.5548655", "0.5548655", "0.5548655", "0.5548655" ]
0.67668897
0
=> Produit le pdf et l'ouvre
def generate_pdf begin raise( :lilyfile_does_not_exists ) unless File.exists?( path_lily_file ) `lilypond --output='#{path_affixe_file}' '#{path_lily_file}'` `open '#{path_pdf_file}'` rescue Exception => e fatal_error e.message end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def pdf1\n \n \n @company =Company.find(1)\n @cabecera =\"Facturacion\"\n @abajo =\"Viatico\"\n \n @cout = Cout.find(params[:id])\n \n Prawn::Document.generate(\"app/pdf_output/#{@cout.id}.pdf\" ,:page_size => \"A4\",:margin=> 2 ) do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header_1(pdf)\n pdf = build_pdf_body_1(pdf)\n build_pdf_footer_1(pdf)\n @lcFileName = \"app/pdf_output/#{@cout.id}.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+@lcFileName\n #send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n send_file(@lcFileName, :type => 'application/pdf', :disposition => 'inline')\n end", "def gerar_relatorio\n pdf = PDFController.render_pdf\n send_data pdf,\n :type => \"application/pdf\",\n :disposition => \"inline\",\n :filename => \"report.pdf\"\n end", "def pdf\n \n \n @company =Company.find(1)\n @cabecera =\"Facturacion\"\n @abajo =\"Viatico\"\n \n @cout = Cout.find(params[:id])\n \n Prawn::Document.generate(\"app/pdf_output/#{@cout.id}.pdf\") do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header(pdf)\n pdf = build_pdf_body(pdf)\n build_pdf_footer(pdf)\n @lcFileName = \"app/pdf_output/#{@cout.id}.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+@lcFileName\n #send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n send_file(@lcFileName, :type => 'application/pdf', :disposition => 'inline')\n end", "def pdf_file\n ActiveSupport::Deprecation.warn('This API has changed: Please use order.pdf_invoice.pdf instead')\n pdf_invoice.pdf\n end", "def pdf\n @viatico = Viatico.find(params[:id])\n company =@viatico.company_id\n @company =Company.find(company)\n \n \n $lcFecha1= @viatico.fecha1.strftime(\"%d/%m/%Y\") \n $lcMon = @viatico.get_moneda(1)\n $lcPay= \"\"\n $lcSubtotal=0\n $lcIgv=0\n $lcTotal=sprintf(\"%.2f\",@viatico.inicial)\n\n $lcDetracion=0\n $lcAprobado= @viatico.get_processed \n\n\n $lcEntrega5 = \"FECHA :\"\n $lcEntrega6 = $lcFecha1\n\n Prawn::Document.generate(\"app/pdf_output/#{@viatico.id}.pdf\") do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header(pdf)\n pdf = build_pdf_body_2(pdf)\n build_pdf_footer(pdf)\n $lcFileName = \"app/pdf_output/#{@viatico.id}.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName\n \n send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n\n\n end", "def get_pdf(x)\n end", "def pdf\n @library = Library.find(params[:id])\n #send_file(@library)\n \n #send_file Rails.root.join('private','README.rdoc'), :type => 'application/pdf', :x_sendfile =>true\n name=@library.to_str\n send_file Rails.root.join('public',name), :type => 'application/pdf', :x_sendfile =>true\n #@library = Library.find(params[:id])\n #:filepath=@library\n #send_file @library.File.path , :type => 'application/pdf', :x_sendfile =>true\n #render :text => \"file has been uploadfile successfully\"\nend", "def show\n respond_to do |format|\n format.html { redirect_to tipos_path, notice: 'Ruta no disponible.' }\n format.json\n format.pdf do\n case params[:doc]\n when '0'\n pdf = RecibosPdf.new(@tipo, 0, params[:c],params[:cp])\n file = \"Recibos_#{@tipo.nombre}\"\n when '1'\n pdf = RecibosPdf.new(@tipo, 1, params[:c],params[:cp])\n file = \"Recibos_#{@tipo.nombre}_ECO\"\n when '2'\n pdf = BancariosPdf.new(@tipo, 0)\n file = \"Bancarios_#{@tipo.nombre}\"\n when '3'\n pdf = BancariosPdf.new(@tipo, 1)\n file = \"Bancarios_#{@tipo.nombre}_ECO\"\n when '4'\n pdf = ConceptosPdf.new(@tipo, 3, params[:c],params[:cp])\n file = \"Conceptos_#{@tipo.nombre}\"\n when '5'\n pdf = ConceptosPdf.new(@tipo, 4, params[:c],params[:cp])\n file = \"Conceptos_#{@tipo.nombre}_ECO\"\n end\n send_data pdf.render, filename: file, type: 'application/pdf', disposition: 'inline'\n end\n end\n end", "def to_pdf_data; end", "def index\n #pdf_filename = File.join(Rails.root, \"tmp/PDFs/18810993-2017-07-02-adecuacion.pdf\")\n #send_file(pdf_filename, :filename => \"18810993-2017-07-02-adecuacion.pdf\", :disposition => 'inline', :type => \"application/pdf\")\n #validar si se envio la adecuacion\n if session[:usuario_id] && session[:tutor]\n if(!session[:plan_id].blank?)\n\n @bool_enviado = 0\n @adecuacion = Adecuacion.where(planformacion_id: session[:plan_id]).take\n if session[:informe_id].blank?\n estatus_x = EstatusAdecuacion.where(adecuacion_id: @adecuacion.id, actual: 1).take\n else\n estatus_x = EstatusInforme.where(informe_id: session[:informe_id], actual: 1).take\n end\n if (estatus_x.estatus_id != 6 && estatus_x.estatus_id != 5)\n @bool_enviado = 1\n end\n @plan = Planformacion.where(id: session[:plan_id]).take\n\n if !@plan.blank?\n #Ver si el informe fue rachazado\n cpInstructor = Usuario.find(@plan.instructor_id)\n if (cpInstructor.activo == false)\n @cpBloquear = true\n else\n @cpBloquear = false\n end\n #fin\n end\n\n $actividad = params[:actividad_id].to_i\n @documents = []\n if !session[:informe_id].blank?\n @documents = Document.where(\"informe_id <= ? AND adecuacion_id = ? AND actividad_id = ?\",session[:informe_id].to_i , session[:adecuacion_id], $actividad).all\n else\n @documents = Document.where(adecuacion_id: session[:adecuacion_id], informe_id: nil).all\n end\n else\n flash.now[:info]=\"Seleccione una adecuación\"\n redirect_to controller:\"iniciotutor\", action: \"planformacions\"\n end\n else\n redirect_to controller:\"forminst\", action: \"index\"\n end\n end", "def pdf\n @invoice = Factura.find(params[:id])\n respond_to do |format|\n format.html { redirect_to(\"/facturas/pdf/#{@invoice.id}.pdf\") }\n format.pdf { render :layout => false }\n end\n end", "def fiche_inscription\n respond_to do |format|\n format.pdf { render template: 'etudiants/fiche_inscription', pdf: 'Inscription' }\n end\n end", "def pdf\n @resume = Resume.find(params[:id])\n html = RDiscount.new(@resume.content).to_html\n kit = PDFKit.new(html, :page_size => 'Letter')\n pdf = kit.to_pdf\n \n file_path = \"#{Rails.root.to_s}/tmp/#{@resume.id}.pdf\"\n file = kit.to_file(file_path)\n send_file file_path, :type => 'pdf', :disposition => 'inline'\n end", "def pdf\n #render layout: false\n Car.find(params[:id])\n Prawn::Document.generate(\"app/assets/pdf/#{@car.targa}.pdf\") do |f|\n f.text \"Hello Worldd!\"\n end\n end", "def rpt_facturas_all2_pdf\n\n $lcFacturasall = '0'\n @company=Company.find(params[:company_id]) \n @fecha1 = params[:fecha1] \n @fecha2 = params[:fecha2] \n @cliente = params[:customer_id] \n\n @facturas_rpt = @company.get_facturas_day_cliente(@fecha1,@fecha2,@cliente) \n\n\n Prawn::Document.generate(\"app/pdf_output/rpt_factura.pdf\") do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header_rpt(pdf)\n pdf = build_pdf_body_rpt(pdf)\n build_pdf_footer_rpt(pdf)\n $lcFileName = \"app/pdf_output/rpt_factura_all.pdf\" \n end \n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName \n send_file(\"app/pdf_output/rpt_factura.pdf\", :type => 'application/pdf', :disposition => 'inline')\n end", "def menu_gestion_extension_conferencia_o_ponencia\n periodo = Period.where(estatus: 'Activo').take\n \n @coferences = Coference.joins(:users).where(users: {id: current_user.id}).where(ano_periodo: periodo).order(fecha_i: :desc)\n @coferences2 = @coferences\n @resultados = @coferences.count\n @coferences = @coferences.page(params[:page])\n \n respond_to do |format|\n format.html\n format.pdf do\n pdf = CoferenceindexPdf.new(@coferences2, view_context)\n send_data pdf.render, filename: \"Lista de Conferencia o ponencias.pdf\",type: \"application/pdf\", disposition: \"inline\"\n end\n end\n end", "def marcarubro \n @marcarubro = Listaprecio.agrupamiento\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @marcarubro }\n format.pdf { render :layout => false }\n end\n end", "def generate_pdf\n\t\t\t\n\n\t\tfile_name = get_file_name\n\t\tfile_name = \"test\"\n\t \n\t ac = ActionController::Base.new\n\t \n\t pdf = ac.render_to_string pdf: file_name,\n template: \"#{ Auth::OmniAuth::Path.pathify(self.class.name).pluralize}/pdf/show.pdf.erb\",\n locals: {:object => self},\n layout: \"pdf/application.html.erb\",\n quiet: true,\n header: {\n \thtml: {\n \t\ttemplate:'/layouts/pdf/header.html.erb',\n \t\tlayout: '/layouts/pdf/empty_layout.html.erb',\n \t\tlocals: {:object => self}\n \t}\n },\n footer: {\n \t\thtml: { \n \t\t\ttemplate:'/layouts/pdf/footer.html.erb',\n \t\t\tlayout: '/layouts/pdf/empty_layout.html.erb',\n \t\tlocals: {:object => self}\n }\n } \n\n save_path = Rails.root.join('public',\"#{file_name}.pdf\")\n\t\tFile.open(save_path, 'wb') do |file|\n\t\t file << pdf\n\t\tend\n\n\t Tempfile.open(file_name) do |f| \n\t\t f.binmode\n\t\t f.write pdf\n\t\t f.close \n\t\t #IO.write(\"#{Rails.root.join(\"public\",\"test.pdf\")}\",pdf)\n\t\t response = Cloudinary::Uploader.upload(File.open(f.path), :public_id => file_name, :upload_preset => \"report_pdf_files\")\n\t\t puts \"response is-------------------------------------------------------------->: #{response}\"\n\t\t self.latest_version = response['version'].to_s\n\t\t self.pdf_url = response[\"url\"]\n\t\tend\n\n\t\tself.skip_pdf_generation = true\n\t\t\n\t\t#self.save\t\t\n\t\tafter_generate_pdf\n\n\tend", "def show\n\n ##pdf\n respond_to do |format|\n format.html\n format.pdf do\n pdf = PersonnelPdf.new(@personnel)\n send_data pdf.render, \n filename: 'cv.pdf', \n type: 'application/pdf',\n disposition: \"inline\"\n end\n end\n\n end", "def generate_pdf(filename, pupil)\n Prawn::Document.generate(filename) do\n text \"CONTRATO DE PRESTAÇÃO DE SERVIÇOS EDUCACIONAIS EM DANÇA\"\n text \"Dados do Contratante\"\n text \"Aluno: #{pupil.first_name} #{pupil.last_name}\"\n text \"Contratante: #{pupil.first_name} #{pupil.last_name}\"\n text \"Endereço: #{pupil.user.try(:street)}, #{pupil.user.try(:district)}, \" +\\\n \"#{pupil.user.try(:city)}, #{pupil.user.try(:state)}, #{pupil.user.try(:zip_code)}\"\n text \"CPF: #{pupil.user.try(:cpf)} RG: #{pupil.user.try(:rg)}\"\n text \"Telefone(s): #{pupil.user.phone_numbers.collect { |p| p.number }}\"\n text \"E-mail: #{pupil.user.try(:email)}\"\n text \"Dados do Contratado\"\n text \"ESPAÇO DANÇAS MANÁ, localizado na Rua 58, Quadra 47, Casa 02, Vinhais, São Luís/MA,\" +\\\n \"inscrito no CNPJ nº 10.724.129/0001-04, representada por DYANNE MIRELLE BARBOSA SANTANA\" +\\\n \"portadora do CP F nº 074.016.854-18.\"\n text \"DO OBJETO E DAS CONDIÇÕES\"\n text \"Cláusula 1º: A Contratante firma com o Contratado a matrícula no(s) curso(s) de: BALLET CLÁSSICO (____); DANÇA CONTEMPORÂNEA (____); SAPATEADO (____); ALONGAMENTO (____); JAZZ (____); DANÇA DE SALÃO (____); DANÇA DE RUA (____); DANÇA DO VENTRE (____); DANÇA SENSUAL (____).\"\n text \"Cláusula 2ª: O presente contrato compreende apenas a prestação de serviços educacionais em dança, não estão incluídos no valor deste curso: taxa de exames; outros cursos extracurriculares; materiais; uniformes; figurinos; dentre outros materiais e serviços, que serão cobrados separadamente pelo Contratado.\"\n text \"Cláusula 3ª: Os cursos oferecidos pelo Contratado terão duração de ___ (______) meses, de ___________ à ___________ de 2013, assim como o presente contrato.\"\n text \"Cláusula 4ª: A formação e a continuidade das turmas dos cursos oferecidos pelo Contratado dependerá do número mínimo de alunos de _____ por turma, a serem preenchidos dentro do prazo máximo de 2 (dois) meses, contados a partir do início das atividades.\"\n text \"§1º: O não atingimento do número mínimo de alunos por turma implicará no remanejamento do aluno para outra turma compatível em nível, carga horária e preço, de acordo com o interesse do Contratante.\"\n text \"§2º: Caso não seja de interesse do Contratante fazer o remanejamento na hipótese do parágrafo anterior, este poderá requerer o cancelamento da sua matrícula sem o pagamento de qualquer multa contratual, desde que este requerimento ocorra antes da data de vencimento da mensalidade.\"\n text \"Cláusula 5ª: A Contratada se obriga a oferecer ao Contratante apenas as aulas especificadas na carga horária e nos horários definidos na tabela em anexo.\"\n text \"§1º: A reposição de aulas perdidas só será possível se houver vaga em outra turma em nível compatível aquele cursado pelo Contratante. Caso contrário o Contratante não terá direito a repor a aula.\"\n text \"§2º: Os alunos horistas poderão remarcar as aulas com até 5 (cinco) horas de antecedência do horário previamente marcado.\"\n text \"§3º: O aluno horista que não remarcar a aula no prazo estabelecido no parágrafo anterior perderá o direito de repor a aula previamente marcada.\"\n text \"Cláusula 6ª: O contrato de prestação de serviço é personalíssimo em relação ao aluno acima discriminado.\"\n text \"Cláusula 7ª: O curso contratado não possui diplomação.\"\n text \"Cláusula 8ª: O Contratante aceita os programas de ensino adotados, acatando o regimento interno do Contratado, normas disciplinares e o agrupamento dos alunos de acordo como o seu nível técnico.\"\n text \"DO PAGAMENTO DA COBRANÇA\"\n text \"Cláusula 9ª: O curso tem o custo total de R$ __________ (_______________________________________).Parágrafo Único: O valor curso pode ser pago em até ___ (_______) parcelas de __________(_________________________)\"\n text \"Cláusula 10ª: A cobrança tanto das parcelas quanto do valor total do curso será feita por meio de boleto bancário.\"\n text \"§1º: O(s) boleto(s) pode(m) ser pago(s) na própria sede da Contratada: em espécie e em cartão na modalidade débito. As modalidades aqui descritas não excluem as outras disponibilizadas pela instituição financeira que emite o boleto de cobrança.\"\n text \"§2º: O pagamento no cartão na modalidade crédito é apenas permitido para o pagamento integral do valor do curso.\"\n text \"§3°: O pagamento da mensalidade em espécie e dentro da data do vencimento confere ao aluno desconto de 4% na mesma.\"\n text \"§4°: O pagamento integral do valor do curso pago em espécie confere ao aluno desconto de 5%.\"\n text \"Cláusula 11ª: O Contratante deseja pagar o curso em (____) parcela(s) de R$ __________ (_______________________________) e estabelece como dia do vencimento da(s) parcela(s) o dia ____ do mês (de cada mês).\"\n text \"Cláusula 12ª: Os juros e multa diária pelo atraso no pagamento serão estabelecidos pela instituição financeira que realiza a emissão do(s) boleto(s) de pagamento.\"\n text \"Cláusula 13ª: O atraso no pagamento por prazo superior a 30 (trinta) dias implicará na suspensão do acesso as aulas e na inscrição do nome do inadimplente no cadastro de protesto, SPC e Serasa.\"\n text \"DA RECISÃO CONTRATUAL\"\n text \"Cláusula 14ª: A rescisão do contrato pode ser feita unilateralmente pelo Contratado, quando não houverem sido alcançadas as condições estabelecidas na Cláusula 4ª e no seu §1º, do presente contrato.\"\n text \"Parágrafo Único: O contrato também pode ser reincidido unilateralmente pelo Contratado quando o contratante não obedecer aos ditames da Cláusula 8ª.\"\n text \"Cláusula 15ª: A rescisão pode ser feita sem custas adicionais pelo Contratante, desde que seja requerida até a data do vencimento da parcela vincenda.\"\n text \"DISPOSIÇÕES GERAIS\"\n text \"Cláusula 16ª: O ingresso dos alunos nas turmas será precedido de avaliação física.\"\n text \"§1º: O Contratante poderá dispensar a avaliação física desde que ateste por escrito que encontra-se em condições de saúde para a prática de exercícios físicos.\"\n text \"§2º: É de inteira responsabilidade do Contratante informar aos professores eventuais doenças, lesões ou sequelas.\"\n text \"\"\n text \"\"\n text \"\"\n text \"\"\n text \"São Luís, _____ de ______________________ de 2013.\"\n text \"Contratante:________________________ Contratado: ________________________\"\n text \"Testemunha: ______________________ Testemunha: ______________________\"\n text \"CPF: CPF:\"\n text \"Quadro de Turmas da Matrícula\"\n end\n end", "def rpt_product_all\n @company=Company.find(params[:company_id]) \n @products = @company.get_products2\n \n Prawn::Document.generate(\"app/pdf_output/stocks1.pdf\") do |pdf| \n\n pdf.font_families.update(\"Open Sans\" => {\n :normal => \"app/assets/fonts/OpenSans-Regular.ttf\",\n :italic => \"app/assets/fonts/OpenSans-Italic.ttf\",\n })\n\n pdf.font \"Open Sans\",:size =>6\n \n pdf = build_pdf_header(pdf)\n pdf = build_pdf_body(pdf)\n build_pdf_footer(pdf)\n $lcFileName = \"app/pdf_output/stocks1.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName\n #send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n send_file(\"app/pdf_output/stocks1.pdf\", :type => 'application/pdf', :disposition => 'inline')\n end", "def reporte\n puts \"======================================================================================================\"\n @agentes_pdf = Agente.all\n\n respond_to do |format| \n format.pdf do\n pdf = AgentesPdf.new(@agentes_pdf, view_context)\n send_data pdf.render, filename: \"agentes.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end \n end\n end", "def create\n @statement = Statement.new(statement_params)\n @test = @statement.test.id\n\n path_to_file = \"#{Rails.root}/app/assets/images/cert#{@statement.id}.pdf\"\n\n pdf = CombinePDF.load \"#{@statement.test.certificate.path}\" \n\n if !pdf.pages.empty?\n\n #a = \"Привет\".encode(\"UTF-8\")\n\n # create a textbox and add it to the existing pdf on page 2 #{@statement.fio} #{@statement.position} \n pdf.pages[0].textbox @statement.position, height: 60, width: 450, y: 400, x: 82, :font => :time_new_roman, font_color: [0, 0.2, 0.26274509803], max_font_size: 16\n pdf.pages[0].textbox @statement.place, height: 60, width: 450, y: 380, x: 82, :font => :time_new_roman, font_color: [0, 0.2, 0.26274509803], max_font_size: 16\n #Суспеснкого районе г . Казани ниже\n pdf.pages[0].textbox @statement.phone, height: 60, width: 450, y: 360, x: 82, :font => :time_new_roman, font_color: [0, 0.2, 0.26274509803], max_font_size: 16\n pdf.pages[0].textbox @statement.name, height: 60, width: 450, y: 320, x: 82, :font => :time_new_roman, font_color: [0, 0.2, 0.26274509803], max_font_size: 35\n pdf.pages[0].textbox @statement.fio, height: 60, width: 450, y: 280, x: 82, :font => :time_new_roman, font_color: [0, 0.2, 0.26274509803], max_font_size: 35\n # output the new pdf which now contains your dynamic data\n pdf.save path_to_file\n File.open(path_to_file) do |f|\n @statement.certificate = f\n end\n File.delete(path_to_file) if File.exist?(path_to_file)\n end\n\n respond_to do |format|\n if @statement.save\n format.html { redirect_to root_path, notice: 'Statement was successfully created.' }\n else\n format.html { render :new}\n format.json { render json: @statement.errors, status: :unprocessable_entity }\n end\n end\n end", "def source_pdf\n first_member if first_member.try(:mime_type) == [\"application/pdf\"]\n end", "def render\n @pdf.render\n end", "def imprime_ficha\n \n prawnto :prawn => {\n :left_margin => 20,\n :right_margin => 20,\n :top_margin => 400,\n :bottom_margin => 20 }\n \n @paciente = Paciente.find(params[:id]) \n @razon = \"\"\n @razon = @paciente.razon unless @paciente.razon.nil?\n @rfc = \"\"\n @rfc = @paciente.rfc unless @paciente.rfc.nil?\n @consulta = Consulta.find(params[:consulta_id])\n \n if !@consulta.cita.nil?\n @ref_estudio = @consulta.cita.operation.ref_estudio unless @consulta.cita.operation.ref_estudio.nil?\n @fecha_hora = @consulta.cita.fecha_hora unless @consulta.cita.fecha_hora.nil?\n else\n @ref_estudio = \"\"\n @fecha_hora = \"\"\n end\n \n \n \n respond_to do |format|\n #format.html # show.html.erb\n #format.xml { render :xml => @pago }\n format.pdf {render :layout => false }\n end\n end", "def rebuild_pdf\n page_paths = (1..document.page_count).map {|i| \"#{document.slug}_#{i}.pdf\" }\n #`pdftk #{page_paths.join(' ')} cat output #{@pdf}`\n `pdftailor stitch --output #{@pdf} #{page_paths.join(' ')} 2>&1`\n\n if File.exists? @pdf\n asset_store.save_pdf(document, @pdf, access)\n File.open( @pdf,'r') do | fh |\n document.update_file_metadata( fh.read )\n end\n end\n end", "def back_office_pdf_data\n pdf_response = ''\n success = call_ok?(:view_case_pdf, request_pdf_elements) do |body|\n break if body.blank?\n\n pdf_response = body\n end\n\n [success, pdf_response]\n end", "def rpt_purchase2_all\n \n @company =Company.find(1)\n @fecha1 =params[:fecha1]\n @fecha2 =params[:fecha2]\n @tiporeporte =params[:tiporeporte]\n \n supplier_select = params[:cbox1]\n proveedor = params[:supplier_id]\n \n \n if supplier_select == \"1\"\n @rpt_detalle_purchase = @company.get_purchases_day_tipo(@fecha1,@fecha2,@tiporeporte) \n else\n @rpt_detalle_purchase = @company.get_purchases_day_tipo2(@fecha1,@fecha2,@tiporeporte,proveedor) \n end \n \n Prawn::Document.generate \"app/pdf_output/orden_1.pdf\" , :page_layout => :landscape do |pdf| \n \n pdf.font \"Helvetica\"\n pdf = build_pdf_header9(pdf)\n pdf = build_pdf_body9(pdf)\n build_pdf_footer9(pdf)\n $lcFileName = \"app/pdf_output/orden_1.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName\n \n send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n \n\n end", "def pdf_list_benefits_nnw1\n @insurance = load_insurance\n @rotation = @insurance.rotations.last\n\n respond_to do |format|\n format.pdf do\n pdf = ListBenefitsNNW1Pdf.new(@rotation, view_context)\n send_data pdf.render,\n filename: \"#{@insurance.number}_list_benefits_nnw1.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\" \n end\n end \n end", "def pdf\n send_file Rails.root.join('private', 'form_16.pdf'), :type=>\"application/pdf\", :x_sendfile=>true\n end", "def splitpdf\n require 'pashua'\n include Pashua\n docu = Document.path.get[0]\n dname = Document.name.get[0][0..-5]\n page = Document.get[0].current_page.get.index.get\n\n # configuring Pashua dialogue\n config = \"\n *.title = researchr\n fb.type = textfield\n fb.default = 1\n fb.label = Starting on page #{page}, how many pages to extract?\\n\n xb.type = checkbox\n xb.label = last page number, instead of number of pages\n db.type = cancelbutton\n db.label = Cancel\n db.tooltip = Closes this window without taking action\\n\"\n\n pagetmp = pashua_run config\n exit if pagetmp['cancel'] == 1\n\n startpage = page.to_i\n tmppage = pagetmp['fb'].to_i\n if pagetmp['xb'] == \"1\"\n endpage = tmppage\n else\n endpage = pagetmp['fb'].to_i + startpage - 1\n end\n\n outfile = \"#{Downloads_path}/#{dname[0..-5]}-split.pdf\"\n\n `pdfmanipulate split \"#{docu}\" #{startpage}-#{endpage} -o \"#{outfile}\"`\n puts \"pdfmanipulate split \\\"#{docu}\\\" #{startpage}-#{endpage} -o \\\"#{outfile}\\\"\"\n growl(\"File extracted and put in Downloads directory\")\nend", "def menu_gestion_docencia\n periodo = Period.where(estatus: 'Activo').take\n \n @teachings = Teaching.joins(:users).where(users: {id: current_user.id}).where(ano_periodo: periodo).order(fecha_i: :desc)\n @teachings2 = @teachings\n @resultados = @teachings.count\n @teachings = @teachings.page(params[:page])\n\n respond_to do |format|\n format.html\n format.pdf do\n pdf = TeachingindexPdf.new(@teachings2, view_context)\n send_data pdf.render, filename: \"Lista de otras actividades del área de docencia.pdf\",type: \"application/pdf\", disposition: \"inline\"\n end\n end\n end", "def rpt_facturas_all_pdf\n\n $lcFacturasall = '1'\n\n @company=Company.find(params[:company_id]) \n @fecha1 = params[:fecha1] \n @fecha2 = params[:fecha2] \n \n\n @facturas_rpt_1 = @company.get_facturas_day(@fecha1,@fecha2,\"1\") \n @facturas_rpt_2 = @company.get_facturas_day(@fecha1,@fecha2,\"2\") \n# respond_to do |format|\n# format.html \n# format.xls # { send_data @products.to_csv(col_sep: \"\\t\") }\n# end \n\n Prawn::Document.generate(\"app/pdf_output/rpt_factura.pdf\") do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header_rpt(pdf)\n pdf = build_pdf_body_rpt(pdf)\n build_pdf_footer_rpt(pdf)\n\n\n $lcFileName = \"app/pdf_output/rpt_factura_all.pdf\" \n end \n\n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName \n send_file(\"app/pdf_output/rpt_factura.pdf\", :type => 'application/pdf', :disposition => 'inline')\n\n end", "def pdf(id)\n http.get(\"/nfse/#{id}/pdf\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end", "def index\n @fichas = Ficha.order(:nome).paginate(per_page: 10, page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fichas }\n format.pdf do\n @fichas = Ficha.order(:nome)\n render pdf: Ficha.model_name.human(count: 2),\n layout: 'pdf.html'\n end\n end\n end", "def index\n @cios = Cio.includes(:animal, :cobertura).propriedade(current_usuario)\n \n respond_to do |format|\n format.html\n format.pdf {render pdf: \"Cios\"} \n end \n end", "def set_pdf\n @pdfs = Pdf.find(params[:id])\n end", "def index\n @pacientes = Paciente.all\n\n respond_to do |format|\n format.html\n format.json\n format.pdf {render template: 'pacientes/pdf', pdf: 'pacientes'}\n end\n\n end", "def combine_pdf_files\n create_process(process: \"COMBINE_PDF_FILES\")\n end", "def stream\n render_layout\n\n pdf_content\n end", "def direct_pdf_link(m,p)\n end", "def pdf_certifications_insureds\n @insurance = load_insurance\n @rotation = @insurance.rotations.last\n\n case params[:prnscope]\n when 'A' # tylko włączenia\n @coverages = @rotation.coverages_add.joins(:rotation, :insured, :group).references(:rotation, :insured, :group).order(\"individuals.last_name, individuals.last_name, individuals.address_city\").all\n when 'B' # tylko włączenia\n @coverages = Coverage.joins(:rotation, :insured, :group).by_rotation(@rotation.id).references(:rotation, :insured, :group).order(\"individuals.last_name, individuals.last_name, individuals.address_city\").all\n end \n\n respond_to do |format|\n format.pdf do\n pdf = CertificationsInsuredsPdf.new(@coverages, view_context)\n send_data pdf.render,\n filename: \"#{@insurance.number}_rotation_#{@rotation.rotation_date.strftime(\"%Y-%m-%d\")}_certifications_insureds.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\" \n end\n end \n end", "def accediLibreria\n oggetto=PdfStuff::Receipt.new()\n oggetto.hello\n end", "def index\n # @films = Film.search(params[:search]).paginate(page: params[:page], per_page: 10).order('films.brazilian_title')\n @films = Film.search(params[:search]).order('films.brazilian_title').page(params[:page])\n\n respond_to do |format|\n format.html\n format.pdf {\n render pdf: \"films-list-report\",\n encoding: 'utf-8',\n header: {center: \"[ #{I18n.l Date.today, format: '%d.%m.%Y'} - #{number_with_delimiter(Film.count)} filmes cadastrados. ]\"},\n footer: {center: \"[page] de [topage]\"}\n }\n end\n end", "def rpt_stocks1\n @company=Company.find(params[:company_id]) \n @fecha1= \"2017-01-01 00:00:00\"\n @fecha2 = params[:fecha1]\n @categoria = params[:products_category_id]\n @namecategoria= @company.get_categoria_name(@categoria) \n @movements = @company.get_stocks_inventarios4(@categoria)\n \n Prawn::Document.generate(\"app/pdf_output/stocks1.pdf\") do |pdf| \n\n pdf.font_families.update(\"Open Sans\" => {\n :normal => \"app/assets/fonts/OpenSans-Regular.ttf\",\n :italic => \"app/assets/fonts/OpenSans-Italic.ttf\",\n })\n\n pdf.font \"Open Sans\",:size =>6\n \n pdf = build_pdf_header(pdf)\n pdf = build_pdf_body(pdf)\n build_pdf_footer(pdf)\n $lcFileName = \"app/pdf_output/stocks1.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName\n #send_file(\"#{$lcFileName1}\", :type => 'application/pdf', :disposition => 'inline')\n send_file(\"app/pdf_output/stocks1.pdf\", :type => 'application/pdf', :disposition => 'inline')\n end", "def generate_pdf\n\t\t\n\t\tfile_name = get_pdf_file_name\n\n\t\tac = ActionController::Base.new\n\n\t\tpdf = ac.render_to_string pdf: file_name,\n\t template: \"#{ Auth::OmniAuth::Path.pathify(self.class.name).pluralize}/pdf/show.pdf.erb\",\n\t locals: {:receipt => self, :organization => self.payable_to_organization},\n\t layout: \"pdf/application.html.erb\",\n \tquiet: true,\n\t header: {\n\t \thtml: {\n\t \t\ttemplate:'/layouts/pdf/receipt_header.pdf.erb',\n\t \t\tlayout: \"pdf/application.html.erb\",\n\t \t\tlocals: {:receipt => self, :organization => self.payable_to_organization}\n\t \t}\n\t },\n\t footer: {\n\t \t\thtml: { \n\t \t\t\ttemplate:'/layouts/pdf/receipt_footer.pdf.erb',\n\t \t\t\tlayout: \"pdf/application.html.erb\",\n\t \t\tlocals: {:receipt => self, :organization => self.payable_to_organization}\n\t }\n\t } \n\n #save_path = Rails.root.join('public',\"#{file_name}.pdf\")\n\t\t#File.open(save_path, 'wb') do |file|\n\t\t# file << pdf\n\t\t# self.pdf_urls = [save_path]\n\t\t# self.pdf_url = save_path\n\t\t#end\n\t\tTempfile.open(file_name) do |f| \n\t\t f.binmode\n\t\t f.write pdf\n\t\t f.close \n\t\t #IO.write(\"#{Rails.root.join(\"public\",\"test.pdf\")}\",pdf)\n\t\t response = Cloudinary::Uploader.upload(File.open(f.path), :public_id => file_name, :upload_preset => \"report_pdf_files\")\n\t\t puts \"response is: #{response}\"\n\t\t self.latest_version = response['version'].to_s\n\t\t self.pdf_url = response[\"secure_url\"]\n\t\tend\n\t\tself.skip_pdf_generation = true\n\t\t\n\t\tafter_generate_pdf\n\n\tend", "def descarga_taxa_pdf\n unless Usuario::CORREO_REGEX.match(params[:correo])\n return self.resp = { estatus: false, msg: 'Favor de verificar el correo' }\n end \n \n lista = Lista.new\n lista.formato = 'pdf'\n lista.cadena_especies = original_url\n lista.usuario_id = 0 # Quiere decir que es una descarga, la guardo en lista para tener un control y poder correr delayed_job\n lista.nombre_lista = Time.now.strftime(\"%Y-%m-%d_%H-%M-%S-%L\") + \"_guia_EncicloVida\"\n\n if Rails.env.production?\n lista.delay(queue: 'descargar_taxa').to_pdf({ fecha: Time.now.strftime(\"%Y-%m-%d\"), original_url: original_url }) if lista.save\n else # Para que en development no la guarde en un trabajo\n lista.to_pdf({ fecha: Time.now.strftime(\"%Y-%m-%d\"), original_url: original_url }) if lista.save\n end\n\n self.resp.merge({ estatus: true, msg: nil }) \n end", "def toPDF()\n doc = Prawn::Document.new(:compress => true, :page_size => [500, 280])\n doc.font 'Times-Roman'\n \n # Les images pour le background, le logo, la signature du tresorier\n doc.image \"public/images/recus/recu.png\", :at => [0, 200]\n doc.image \"public/images/recus/logo112x87.png\", :at => [370, 195], :fit => [56, 44]\n doc.image \"public/images/recus/signature_recu.png\", :at => [280, 80], :fit => [147,42]\n\n # Boite avec les informations principales du recu\n doc.bounding_box([5,180], :width => 500) do\n doc.text \"Date: \" + DateTime.now.strftime('%Y-%m-%d')\n \n doc.move_down 42\n annee = DateTime.now.strftime('%Y')\n doc.text \"Reçu pour abonnement à la piscine Dixie \" + annee, :style => :bold\n doc.text \"Receipt for Dixie pool registration \" + annee, :style => :bold\n \n doc.move_down 10\n doc.text \"Nom/Name: \" + nom\n doc.text \"Montant perçu/Amount paid: \" + sprintf('$%6.2f', @famille.paiementTotal)\n end\n \n # Boite avec les coordonnes de la piscine. En haut a droite avec le logo dedans\n doc.bounding_box([220, 195], :width => 210, :height => 45) do\n doc.stroke_bounds\n doc.bounding_box([2, 43], :width => 210) do\n doc.text \"Association Piscine Dixie Inc.\"\n doc.text \"CP 34045\"\n doc.text \"Lachine, Qc, H8S 4H4\"\n end\n end\n \n # Sous la signature\n doc.draw_text \"Trésorier / Treasurer\", :at => [300, 30]\n \n return doc\n end", "def rpt_ccobrar4_pdf\n $lcxCliente =\"0\"\n @company=Company.find(params[:company_id]) \n @fecha1 = params[:fecha1] \n @fecha2 = params[:fecha2] \n @facturas_rpt = @company.get_pendientes_day(@fecha1,@fecha2) \n \n Prawn::Document.generate(\"app/pdf_output/rpt_pendientes4.pdf\") do |pdf|\n pdf.font \"Helvetica\"\n pdf = build_pdf_header_rpt4(pdf)\n pdf = build_pdf_body_rpt4(pdf)\n build_pdf_footer_rpt4(pdf)\n $lcFileName = \"app/pdf_output/rpt_pendientes4.pdf\" \n end \n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName \n send_file(\"app/pdf_output/rpt_pendientes4.pdf\", :type => 'application/pdf', :disposition => 'inline')\n \n end", "def pdf\n _, @document = search_service.fetch(params[:solr_document_id])\n\n source_pdf = Wayfinder.for(resource).source_pdf\n if source_pdf\n redirect_to \"#{request.base_url}#{helpers.fileset_download_path(source_pdf, auth_token_param)}\"\n elsif helpers.pdf_allowed?(resource) && can?(:pdf, resource)\n redirect_to \"#{request.base_url}#{polymorphic_path([:pdf, resource], auth_token_param)}\"\n else\n redirect_to solr_document_url(resource), notice: \"No PDF available for this item\"\n end\n end", "def show\n @pcs = Pc.all\n @gjuhas = Gjuha.all\n @qytetets = Qytetet.all\n @pozi = Pozi.all\n @formularis= Formulari.find(params[:id])\n @status = Status.all\n respond_to do |format|\n format.html\n format.pdf do\n pdf=OrderPdf.new(@formularis)\n send_data pdf.render,\n filename: \"\", type: \"application/pdf\", desposition: \"inline\"\n end\n end\n end", "def index\n @search = @cliente.facturas.search(params[:search])\n @facturas = @search.page(params[ :page ]).per(10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @facturas }\n format.pdf do\n dump_tmp_filename = Rails.root.join('tmp',@facturas.first.cache_key)\n Dir.mkdir(dump_tmp_filename.dirname) unless File.directory?(dump_tmp_filename.dirname)\n save_list_pdf_to(dump_tmp_filename,@facturas) \n send_file(dump_tmp_filename, :type => :pdf, :disposition => 'attachment', :filename => \"facturas.pdf\")\n File.delete(dump_tmp_filename) \n end \n end\n end", "def show\n @cv = Cv.find(params[:id])\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"cv. #{@cv_params}\",\n page_size: 'A4',\n template: \"cvs/show.html.erb\",\n layout: \"pdf.html\",\n lowquality: true,\n zoom: 1,\n dpi: 75\n end\n end\n end", "def menu_gestion_investigacion\n periodo = Period.where(estatus: 'Activo').take\n \n @researches = Research.joins(:users).where(users: {id: current_user.id}).where(ano_periodo: periodo).order(fecha_i: :desc)\n @researches2 = @researches\n @resultados = @researches.count\n @researches = @researches.page(params[:page])\n\n respond_to do |format|\n format.html\n format.pdf do\n pdf = ResearchindexPdf.new(@researches2, view_context)\n send_data pdf.render, filename: \"Lista de otras actividades del área de investigación.pdf\",type: \"application/pdf\", disposition: \"inline\"\n end\n end\n end", "def output_pdf\n siz = @report.size.to_i\n if siz < 500 || Dialog.confirm(\"Cela demandera environ #{siz / 250} secondes\")\n path = ask_path('.pdf')\n path ? build_and_save_pdf(path) : 'Annulé'\n else\n 'Annulé'\n end\n rescue\n pdf_error\n end", "def pdf_list_insureds\n @insurance = load_insurance\n @rotation = @insurance.rotations.last\n\n respond_to do |format|\n format.pdf do\n pdf = ListInsuredsPdf.new(@rotation, view_context)\n send_data pdf.render,\n filename: \"#{@insurance.number}_rotation_#{@rotation.rotation_date.strftime(\"%Y-%m-%d\")}_list_insureds.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\" \n end\n end \n end", "def menu_gestion_docencia_trabajos\n periodo = Period.where(estatus: 'Activo').take\n \n @works = Work.joins(:users).where(users: {id: current_user.id}).where(ano_periodo: periodo).order(fecha_i: :desc)\n @works2 = @works\n @resultados = @works.count\n @works = @works.page(params[:page])\n\n respond_to do |format|\n format.html\n format.pdf do\n pdf = WorkindexPdf.new(@works2, view_context)\n send_data pdf.render, filename: \"Lista de actividades de trabajos de grado del área de docencia.pdf\",type: \"application/pdf\", disposition: \"inline\"\n end\n end\n end", "def show\n# @document = Document.find(params[:id])\n# docpath= Rails.root.to_s + '/public/documents/' + @document.filename\n# send_file docpath, :type=>\"application/pdf\"\n end", "def generate_pdf\n respond_with(invoice)\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @factura }\n format.pdf do\n \n #unless @factura.isprinted?\n @entry = @factura.to_entry\n unless @entry.save\n flash[:error] = @entry.errors.full_messages.join(\"\\n\")\n redirect_to [@factura.cliente]\n return\n end\n #end\n \n\n dump_tmp_filename = Rails.root.join('tmp',@factura.cache_key)\n Dir.mkdir(dump_tmp_filename.dirname) unless File.directory?(dump_tmp_filename.dirname)\n \n if @factura.cliente.company.factura_method_print.blank?\n @factura.save_pdf_to(dump_tmp_filename) \n else\n if @factura.respond_to?(@factura.cliente.company.factura_method_print)\n @factura.send( @factura.cliente.company.factura_method_print , dump_tmp_filename )\n end \n end\n\n send_file(dump_tmp_filename, :type => :pdf, :disposition => 'attachment', :filename => \"#{@cliente.razonsocial}-factura-#{@factura.numero}.pdf\")\n File.delete(dump_tmp_filename)\n end\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.pdf do\n render :pdf => @documento.pdf_file_name\n end\n end\n end", "def pdf_file(template)\n if Spree::PrintInvoice::Config.store_pdf\n send_or_create_pdf(template)\n else\n render_pdf(template)\n end\n end", "def pdf\n #TODO: this is a security issue as anyone can access the pdf, need to fix so that only jquery can access\n send_file(open(@ebook.pdf.url), :filename => @ebook.pdf.path, :disposition => 'inline', :type => \"application/pdf\")\n end", "def user_city\n prueba=City.user_city()\n respond_to do |format|\n format.html {render json: prueba,each_serializer: Cities::User_citySerializer, status:200}\n format.pdf do \n pdf = UsersPdf.new(prueba)\n send_data pdf.render, filename: \"users_city.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n end\n \nend", "def show\n @section_title = 'Detail'\n @volunteer = Volunteer.find(params[:id])\n \n respond_to do |format|\n format.pdf {\n \n #if !@volunteer.pdf.exists?\n pdf = doc_raptor_send({:document_type => \"pdf\".to_sym})\n friendlyName = \"Volunteer_#{@volunteer.user.name}.pdf\"\n friendlyName = friendlyName.gsub(\"/\", \"_\")\n File.open(\"#{Rails.root}/tmp/#{friendlyName}\", 'w+b') {|f| f.write(pdf) }\n @volunteer.pdf = File.open(\"#{Rails.root}/tmp/#{friendlyName}\");\n @volunteer.save!({:validate => false})\n send_data pdf, :filename => friendlyName, :type => \"pdf\"\n #else\n # redirect_to @volunteer.pdf.url\n #end\n \n }\n format.html {\n render\n }\n end\n \n end", "def show\n \t@amostra = Amostra.find(params[:id])\n \t\n \trespond_to do |format|\n \tformat.html # show.html.erb\n \tformat.xml { render :xml => @amostra }\n \tformat.pdf { render :layout => false } # Add this line\n \tprawnto :filename => \"laudo #{@amostra.certificado} #{@amostra.produto} #{@amostra.marca}.pdf\", \n :prawn => { \n \t\t#:background => \"public/image/logo2.png\", \n \t\t:left_margin => 0, \n \t\t:right_margin => 0, \n \t\t:top_margin => 30, \n \t\t:bottom_margin => 30, \n \t\t:page_size => 'A4' \n \t}\n \tend\n\n end", "def convert_to_pdf!\n if content_type == 'application/pdf'\n return stamp_pdf!\n else\n command = \"export LD_LIBRARY_PATH=/opt/openoffice.org2.4_sdk/linux/lib:/opt/openoffice.org2.4/program/; #{RAILS_ROOT}/lib/pdfconvert/convert.php #{self.versions[:original].path} \\\"\\\" #{self.versions[:pdf].path}\"\n RAILS_DEFAULT_LOGGER.info { \"--Converting file to pdf:\\n Command: #{command}\" }\n result = `#{command}`\n RAILS_DEFAULT_LOGGER.info { \"#{result}\" }\n RAILS_DEFAULT_LOGGER.info { \" --> Result: #{$?}\" }\n out = $?\n\n if result.to_s.include?(\"couldn't connect to socket\") || result.to_s.include?(\"error\") || !out.success?\n Thread.current['pdf_conversion_error'] = \"Could not convert document to PDF: #{result.to_s}\"\n else\n Thread.current['pdf_conversion_error'] = nil\n end\n \n stamp_pdf! if out.success?\n return out\n end\n end", "def rpt_stocks3\n @company=Company.find(params[:company_id]) \n @fecha1 = params[:fecha1] \n @fecha2 = params[:fecha2] \n \n @movements = @company.get_movement_stocks(@fecha1,@fecha2) \n \n Prawn::Document.generate(\"app/pdf_output/stocks3.pdf\") do |pdf| \n pdf.font \"Helvetica\"\n pdf = build_pdf_header2(pdf)\n pdf = build_pdf_body2(pdf)\n build_pdf_footer2(pdf)\n $lcFileName = \"app/pdf_output/stocks3.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName \n send_file(\"app/pdf_output/stocks3.pdf\", :type => 'application/pdf', :disposition => 'inline')\n end", "def toPDF(doc, parent)\n if !parent\n raise \"Pas de parent pour le recu\"\n end\n \n doc.start_new_page\n doc.font 'Times-Roman'\n \n # On fait deux copies.\n [650, 400].each do |y|\n doc.bounding_box([0, y], :width => 500, :height => 200) do\n oneRecu(doc, parent)\n end\n end\n \n end", "def ciudad_location\n \"#{Rails.root}/app/pdfs/ciudades/ciudad-#{self.id}.pdf\"\n end", "def process_pdf\n\t\tif before_generate_pdf.blank?\n\t\t\tself.ready_for_pdf_generation = nil\n\t\telse\n\t\t\tself.ready_for_pdf_generation = Time.now.to_i \n\t\tend\n\tend", "def invoice_as_pdf\n invoice_id = params['invoice_id']\n invoice = ChargeBee::Invoice.retrieve(invoice_id).invoice\n if invoice.subscription_id != @subscription_id\n redirect_to \"/400\"\n return\n end\n result = ChargeBee::Invoice.pdf(invoice_id)\n redirect_to result.download.download_url\n end", "def add_pdf_to_db\n @progression = get_progression(9, 13)\n end", "def index\n @text_on_pdfs = TextOnPdf.all\n end", "def download_pdf\n pdf_type = 'Return'\n return_pdf(pdf_type)\n end", "def download\n sleep 1 # Wait until the PDF engine finish writing the file\n send_file session[:preview_filename], type: \"application/pdf\"\n session[:preview_filename] = nil\n end", "def enviar_validacion\n #Generamos la carta de verificacion\n pdf = WickedPdf.new.pdf_from_string(\"<h1>¡Hola #{self.hogar.user_admin.name}!</h1> <p>Su código de validación es #{self.activation_token} </p> <p> Un abrazo afectuoso,</p> <p> El equipo de Vesindo</p>\", encoding: \"UTF-8\")\n save_path = Rails.root.join('pdfs',\"#{self.hogar.user_admin.name}.pdf\")\n File.open(save_path, 'wb') do |file|\n file << pdf\n end\n end", "def show\n respond_to do |format|\n format.html\n format.pdf do\n render pdf: \"Proveedor\",\n template: \"user/proveedors/show.html.erb\",\n layout: 'pdf_proveedores.html'\n end\n end\n end", "def show\r\n @apertura_cajas = AperturaCaja.all\r\n @apertura_caja = AperturaCaja.find(params[:id])\r\n respond_to do |format|\r\n format.html\r\n format.pdf do\r\n pdf = AperturaCajaPdf.new(@apertura_caja, view_context)\r\n send_data pdf.render, filename: \"libro_caja_#{@apertura_caja.apertura}.pdf\",\r\n type: \"application/pdf\",\r\n disposition: \"inline\"\r\n end\r\n end\r\n end", "def rpt_stocks2\n @company=Company.find(params[:company_id]) \n @fecha1 = params[:fecha1] \n @fecha2 = params[:fecha2] \n @categoria =params[:products_category_id]\n @estado = params[:estado]\n \n @namecategoria= @company.get_categoria_name(@categoria) \n @movements = @company.get_stocks_inventarios2(@fecha1,@fecha2,@categoria,@estado) \n \n Prawn::Document.generate(\"app/pdf_output/stocks2.pdf\") do |pdf| \n pdf.font_families.update(\"Open Sans\" => {\n :normal => \"app/assets/fonts/OpenSans-Regular.ttf\",\n :italic => \"app/assets/fonts/OpenSans-Italic.ttf\",\n })\n\n pdf.font \"Open Sans\",:size =>6\n pdf = build_pdf_header2(pdf)\n pdf = build_pdf_body2(pdf)\n build_pdf_footer2(pdf)\n $lcFileName = \"app/pdf_output/stocks2.pdf\" \n \n end \n\n $lcFileName1=File.expand_path('../../../', __FILE__)+ \"/\"+$lcFileName \n send_file(\"app/pdf_output/stocks2.pdf\", :type => 'application/pdf', :disposition => 'inline')\n MovementDetail.delete_all \n end", "def show\n if params[:download]\n send_pdf(download: true)\n elsif params[:preview]\n send_pdf\n end\n end", "def download_pdf\n send_file(\n \"#{Rails.root}/public/cv_eric_merlin.pdf\",\n filename: \"cv_eric_merlin.pdf\",\n type: \"application/pdf\"\n )\nend", "def data_pdf_params\n #params[:data_pdf]\n end", "def render\n generate_content\n @pdf.render\n end", "def asset_pdf\n @assets = Asset.find(:all, :conditions => 'is_deleted = 0')\n @currency_type = currency\n render :pdf => 'asset_report_pdf'\n end", "def download_pdf(pdf, displayed_filename)\n send_data pdf.render, :filename => displayed_filename\n end", "def export\n @voucher = Voucher.find(params[:id])\n\n html = render_to_string(action: 'export', layout: false)\n voucher_pdf = PDFKit.new(html)\n\n combined_pdf = CombinePDF.parse(voucher_pdf.to_pdf)\n\n @voucher.receipts.each do |r|\n if r.content.content_type =~ /pdf/\n combined_pdf << CombinePDF.parse(Paperclip.io_adapters.for(r.content).read)\n else\n # It's image\n image_url = URI.join(request.url, r.content.url)\n image_pdf = PDFKit.new(render_to_string(action: 'export_image', layout: false, locals: {url: image_url}))\n combined_pdf << CombinePDF.parse(image_pdf.to_pdf)\n end\n end\n\n send_data(combined_pdf.to_pdf, type: 'application/pdf', filename: \"voucher-#{@voucher.id}.pdf\")\n end", "def show\n @invoice = Invoice.find(params[:id])\n @details = InvoiceDetail.where(invoice_id: @invoice.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invoice }\n format.pdf do\n pdf = InvoiceDetailPdf.new(@invoice,@details)\n send_data pdf.render, filename: \"detalle_factura_numero_#{@invoice.number}.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n end\n end", "def pdf_location\n \"/pdf/#{authoritative_ref}.pdf\" if File.exists? \"public/pdf1/#{authoritative_ref}.pdf\"\n end", "def pdf\n document = Document.find(params[:id])\n\n # The line below enables document caching for 48 hours.\n expires_in 30.days, public: true\n send_file(\n document.serve,\n type: \"application/pdf\",\n disposition: \"inline\")\n end", "def suplierSaleReport\n\n # Save and open pdf\n #filename = File.join(Rails.root, \"app/report\", \"SalesList.pdf\")\n #pdf.render_file filename\n #send_file filename, :filename => \"SalesList.pdf\", :type => \"application/pdf\"\n \n @sale = Sale.find(params[:id])\n\n # Open pdf\n send_data suplierSale_pdf.render, :filename => \"SuplierSale.pdf\", :type => \"application/pdf\"\n\n end", "def show\n\n # respond_to do |format|\n # format.html\n # format.pdf do\n # pdf = Prawn::Document.new\n # pdf.html \"profile/dashboard\"\n # send_data pdf.render,filename: \"profile_#{@profile}.pdf\",type: \"application/pdf\",\n # disposition: \"inline\"\n # end\n # end\n\n respond_to do |format|\n format.html\n format.json\n format.pdf { render template: 'profile/cv',pdf: 'cv' }\n\n\n end\n\n end", "def index\n @personnelspdf = Personnel.all\n @q = Personnel.paginate(:page => params[:page], :per_page => 10).search(params[:q])\n @personnels = @q.result\n\n ##pdf\n respond_to do |format|\n format.html\n format.pdf do\n pdf = PersonnelsPdf.new(@personnelspdf)\n send_data pdf.render, filename: 'personnels.pdf', type: 'application/pdf'\n end\n end\n\n\n end", "def generate_pdf_data\n pages = 0\n\n # Render the PDF data to string\n pdf_data = WickedPdf.new.pdf_from_string(\n ResumeRenderer.new(self).render_theme(self.current_theme, layout: 'pdf_page'),\n {\n disable_external_links: true,\n disable_internal_links: true,\n print_media_type: true,\n outline: { outline: true }\n }\n )\n\n # Extract the PDF metadata\n meta_dump = nil\n IO.popen(\"#{ENV['PDFTK_BIN']} - dump_data_utf8 output -\", \"w+\") do |pipe|\n pipe.write pdf_data\n pipe.close_write\n meta_dump = pipe.read\n end\n\n # Mutate some PDF metadata values\n # meta_dump.gsub!(/^InfoBegin\\nInfoKey:\\ Creator\\nInfoValue:\\ .+\\n/, \"InfoBegin\\nInfoKey: Creator\\nInfoValue: JibJob PDF Renderer\\n\")\n # meta_dump.gsub!(/^InfoBegin\\nInfoKey:\\ Producer\\nInfoValue:\\ .+\\n/, \"InfoBegin\\nInfoKey: Producer\\nInfoValue: https://jibjob.co\\n\")\n\n # # Inject updated PDF metadata back\n # begin\n # dump_tmpfile = Tempfile.new(\"jibjob-resume-#{self.id}\")\n # dump_tmpfile.write(meta_dump)\n # dump_tmpfile.rewind\n # IO.popen(\"#{ENV['PDFTK_BIN']} - update_info_utf8 #{dump_tmpfile.path} output - uncompress\", \"w+\") do |pipe|\n # pipe.write pdf_data\n # pipe.close_write\n # pdf_data = pipe.read\n # end\n # ensure\n # dump_tmpfile.close\n # dump_tmpfile.unlink\n # end\n\n # Fetch some PDF metadata values\n pages = meta_dump.match(/^NumberOfPages:\\ (\\d+)\\n/)[1].to_i\n\n # Return PDF data wrapper\n { content: pdf_data,\n pages: pages\n }\n end", "def user_c\n \n prueba=Cook.user_c(params[:city_id])\n respond_to do |format|\n format.html {render json: prueba,each_serializer: User_cSerializer, status:200}\n format.pdf do \n pdf = UsersdPdf.new(prueba)\n send_data pdf.render, filename: \"users_by_date.pdf\",\n type: \"application/pdf\",\n disposition: \"inline\"\n end\n end\nend", "def process\n begin\n @pdf = document.slug + '.pdf'\n pdf_contents = asset_store.read_pdf document\n File.open(@pdf, 'wb') {|f| f.write(pdf_contents) }\n case input['task']\n when 'text' then process_text\n when 'images' then process_images\n end\n rescue Exception => e\n LifecycleMailer.exception_notification(e,options).deliver_now\n raise e\n end\n document.id\n end", "def generate_pdf(filename)\n @destination_path = \"#{Rails.root}/public/files/\"+filename.remove('pptx')+'pdf'\n Libreconv.convert( @files.to_s, @destination_path, nil, 'pdf:writer_pdf_Export')\n # Docsplit.extract_pdf(@files.to_s)\n\n # Creates the manipulated pptx file physically\n FileUtils.mv @files.to_s, \"#{Rails.root}/public/files/\"+filename\n @destination_path\n end", "def show\n @pdf_attachment = @index.pdf_attachment\n end", "def getpdf\n # source info page: https://github.com/usgpo/link-service\n\n #Query: bill number, bill type, congress, bill version OR most recent\n #Parameters:\n #collection: Required - Value is bills.\n #billtype: Required - Values are hr, s, hjres, sjres, hconres, sconres, hres, sres.\n #billversion: Optional - If bill version is not provided, the most recent version of a bill is returned. Values are as, cps, fph, lth, ppv, rds, rhv,\n # rhuc, ash, eah, fps, lts, pap, rev, rih, sc, eas, hdh, nat, pwah, reah, ris, ath, eh, hds, oph, rah, res, rsv, ats, eph, ihv, ops, ras, renr, rth,\n # cdh, enr, iph, pav, rch, rfh, rts, cds, esv, ips, pch, rcs, rfs, s_p, cph, fah, isv, pcs, rdh, rft, sas, mostrecent. <-----\n #billnum: Required - This is the numerical bill number. Sample value is 1027.\n #congress: Required - This is the numerical Congress number. Sample value is 112.\n #link-type: Optional - This is the format of the returned document. Default is pdf. Other values are xml, html, mods, premis, contentdetail.\n\n #Examples:\n #https://api.fdsys.gov/link?collection=bills&billtype=hr&billversion=ih&billnum=1&congress=112\n #https://api.fdsys.gov/link?collection=bills&billtype=hconres&billnum=17&congress=112&link-type=xml\n\n # the above api accepts mostrecent as an argument, which is why I will be using it (that way I dont have to infer version through status, which would\n # be overhead).\n\n # replace tempfile location by a location in a folder under meritmoot. After returning the file to the user\n # check the last checked time. If its been a bit (like 2 hours), go through and delete all files that havent been\n # accessed in, like, a day.\n\n # I have noticed that some pdfs dont load on meritmoot.com. I am gueeesssssssing this is due to timeout. This is probably extendable in javascript.\n # extend it to 15 seconds.\n\n #capture crap\n logWatch(\"GetBillPdf\") { |log|\n require 'net/http'\n require 'time'\n billType = params['billtype']\n billNum = params['billnum']\n billCongress = params['congress']\n billVersion = 'mostrecent'\n billVersion = params['billversion'] if not params['billversion'].nil?\n\n theFile = nil\n prefix = \"moot-pdf\"\n theFileName = \"#{prefix}-#{billCongress}-#{billType}-#{billNum}-#{billVersion}.pdf\"\n\n #figure out if we allready have it\n files = Dir.entries(\"/tmp\")\n files.select!{ |name| name == theFileName }\n p \"files: #{files}\"\n if files.length == 1\n theFile = \"/tmp/\" + theFileName\n theFile = File.open(theFile)\n createTime = theFile.ctime\n billUpdateTime = Mmbill.find_by(bill_id: \"#{billType}#{billNum}-#{billCongress}\".downcase)\n if billUpdateTime == nil\n logWatch(\"pdfs_related_Mmbill_not_found\"){ \n p(\"#{billType}#{billNum}-#{billCongress} - #{theFileName}\")\n }\n billUpdateTime = Time.new(1990) #something a long time ago\n else \n billUpdateTime = Time.parse(billUpdateTime.bulk['history']['active_at'])\n end\n\n #outdated?\n if createTime > billUpdateTime\n #No just pass it back\n send_file(theFile, filename: theFileName, type: 'application/pdf', disposition: 'inline')\n else\n #Yes it is outdated. delete it\n theFile.close\n File.delete(\"/tmp/\" + theFileName)\n theFile = nil\n end\n end\n if theFile == nil\n theFile = File.open(\"/tmp/\" + theFileName, \"w\", :encoding => 'ascii-8bit')\n #https://api.fdsys.gov/link?collection=bills&billtype=sres&billversion=mostrecent&billnum=14&congress=116\n Net::HTTP.get_response(URI.parse(\"https://api.fdsys.gov/link?collection=bills&billtype=#{billType}&billversion=#{billVersion}&billnum=#{billNum}&congress=#{billCongress}\")) do |r|\n p \"code: #{r.code}\"\n ApiController.passingAround(r, theFile)\n end\n send_file(theFile, filename: theFileName, type: 'application/pdf', disposition: 'inline')\n theFile.close()\n end\n #bit of cleanup.\n #delete old ones\n files = Dir.entries(\"/tmp\")\n #select ones we handle, and that are three days since last accesssed\n files.select!{|name| name[prefix] != nil and File.atime(\"/tmp/\" + name) < Time.now - ( 3 * 24 * 60 * 60 ) }\n for rejectFile in files\n #rejectFile.close\n File.delete(\"/tmp/#{rejectFile}\")\n end\n }\n end", "def readPDFData\n\n\t\trequire 'rubygems'\n\t\trequire 'pdf/reader'\n\n\t\tfileName = \"./storage/PDFs/docraptor-ruby.pdf\"\n\n\t\tPDF::Reader.open(fileName) do |reader|\n\n\t\t\tparams[:url_data_model][:pdf_version] = reader.pdf_version\n\t\t\tparams[:url_data_model][:metadata] = reader.metadata.inspect\n\t\t\tparams[:url_data_model][:page_count] = reader.page_count\n\t\t\t@pageInfo = reader.info.inspect\n\n\t\tend\n\n\tend" ]
[ "0.71021163", "0.69785696", "0.69780004", "0.69769233", "0.6972289", "0.68994546", "0.6859801", "0.6763033", "0.67473286", "0.6659852", "0.6651626", "0.65888286", "0.65872425", "0.65717244", "0.6569472", "0.6562237", "0.6539161", "0.6523104", "0.6522748", "0.64863497", "0.6484915", "0.64813375", "0.64811754", "0.6478622", "0.64782476", "0.6476946", "0.6475304", "0.6470266", "0.6467272", "0.6457928", "0.6457913", "0.6449449", "0.6443559", "0.64262736", "0.642206", "0.6419085", "0.6415002", "0.6409911", "0.6407286", "0.64012975", "0.6384949", "0.6384631", "0.637792", "0.6371211", "0.6367017", "0.63666034", "0.6348738", "0.63478065", "0.6337511", "0.63320327", "0.633016", "0.6328883", "0.6320392", "0.6319676", "0.63175577", "0.6313093", "0.63082665", "0.6305842", "0.629715", "0.6291793", "0.6289916", "0.6288643", "0.62876785", "0.6287659", "0.6282214", "0.62720525", "0.62719977", "0.6271029", "0.6269743", "0.6268113", "0.6254885", "0.6251669", "0.6247832", "0.6238833", "0.6234564", "0.62249994", "0.6211921", "0.6209853", "0.6209559", "0.62093574", "0.62086016", "0.62084126", "0.62079805", "0.6201096", "0.6200497", "0.6200417", "0.61950696", "0.6192093", "0.61871886", "0.6177321", "0.61757195", "0.6171863", "0.6168342", "0.6168122", "0.6167783", "0.61616886", "0.6158559", "0.6151608", "0.61503077", "0.6150117", "0.6144876" ]
0.0
-1
=> Message de fin de conversion
def end_conversion # @todo: pour le moment : puts "Fichier converti avec succès".as_blue true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def message(message) end", "def to_s; message; end", "def message\n to_s\n end", "def message\n to_s\n end", "def message( message )\n\tend", "def parse(msg)\n \"テストアラートメッセージ\"\n # TODO: XMLパース整形処理\n end", "def to_s()\r\n\t\treturn \"Demande inscription n°#{@id} : #{@expediteur},#{@motDePasse},#{@mail},#{@statutDemande},#{@message}\"\r\n\tend", "def message() end", "def get_message # 優惠訊息\n\t\tif self.range == 'all'\n msg1 = '全館'\n elsif self.range == 'price'\n msg1 = '全館滿' + self.range_price.to_s + '元'\n elsif self.range == 'product'\n if self.range_quantity == 1\n msg1 = '本商品每件'\n else\n msg1 = '本商品' + self.range_quantity.to_s + '件'\n end\n end\n\n if self.offer == 'freight'\n if self.offer_freight == 'all'\n msg2 = '免運費'\n elsif self.offer_freight == 'CVS'\n msg2 = '超商取貨免運費'\n elsif self.offer_freight == 'Home'\n msg2 = '宅配免運費'\n end\n elsif self.offer == 'price'\n msg2 = '折' + self.offer_price.to_s + '元'\n elsif self.offer == 'discount'\n msg2 = '打' + self.offer_discount.to_s + '折'\n end\n\n msg1 + msg2\n\tend", "def to_message\n fail NotImplementedError\n end", "def to_simple_message\n {\n text: self.message\n }\n end", "def m2_message\n [\n \"Super fedt at du gerne vil hjælpe os, med at planlægge Spejdernes Lejr 2017!\",\n \"\\n\\nUd fra dine fantastiske kompetencer, har vi videregivet dine kontaktoplysninger til {{udvalg}}. Hvis du ikke hører fra {{udvalg}}, eller hvis I ikke fandt noget du var interesseret i, så er du mere end velkommen til at kontakte os på job@sl2017.dk. Så hjælper vi dig videre til et andet spændende lejrjob!\",\n \"\\n\\n_De fedeste Spejdernes Lejr 2017 hilsener_ \\n\",\n \"{{bruger}}, Jobcenteret SL2017\"\n ].join()\n end", "def to_s\n\t\t\tmessage\n\t\tend", "def message=(_arg0); end", "def message=(_arg0); end", "def message_text\n clear_default_fields\n result = self.message\n reset_default_fields\n result\n end", "def create_message(data); end", "def create_message(data); end", "def message=(_); end", "def convert!; end", "def do_something_with_BHS(msg)\n # puts \"My \" << msg[0].e0 << \" looks like this: \" << msg.to_s\nend", "def msg(message)\n end", "def to_s\n messages.to_s\n end", "def message; end", "def message; end", "def message; end", "def message; end", "def message; end", "def message; end", "def convert\n end", "def convert\n end", "def to_message\n self\n end", "def transform(msg, extended: false)\n case msg\n when LookupService::Data, Lookup::Crossref::Api::Message\n # OK as is.\n else\n msg = Lookup::Crossref::Message::Work.new(msg)\n end\n super(msg, extended: extended)\n end", "def foorth_message\r\n \"#{self.foorth_code} #{self.message}\"\r\n end", "def message\n\t\t@message \n\tend", "def convert_message(msg)\n\n $stderr.puts \"%sConverting message:\\n%s\" % \n [ $indent, msg.header.to_s.gsub(/^/, $indent+' ') ] if $DEBUG\n\n # Text/plain messages are subject to conversion\n case msg.header.content_type\n when nil, %r{^text/plain}, %r{^message/rfc822}\n $stderr.puts \"%sThis is a text/plain message\" % [ $indent ] if $DEBUG\n\n # Start by doing PGP ... if this matches then we don't want to\n # mess with uuencoded stuff because that would break the signature\n nmsg = convert_pgp(msg)\n nmsg = convert_uu(msg) unless nmsg\n msg = nmsg if nmsg\n end\n\n # Multi-part messages are converted part by part, depth-first.\n # Note this could be acting on a converted text/plain message from\n # above, which is good, because it means we'll fix the\n # Content-Length and Lines headers (as well as convert embedded\n # message, but what are the chances of that?)\n if msg.multipart?\n\n # Convert each part\n unless msg.header.content_type =~ %r{^multipart/signed}\n # Create the new message. Start by duplicating the headers. \n nmsg = RMail::Message.new\n nmsg.header.replace(msg.header.dup)\n nmsg.preamble, nmsg.epilogue = msg.preamble, msg.epilogue\n\n $indent << ' ' # for $DEBUG\n msg.each_part { |part| nmsg.add_part(convert_message(part)) }\n $indent[0,2] = '' # for $DEBUG\n\n # This is now the message\n msg = nmsg\n end\n\n # Add length headers; requires serializing at this point\n s = msg.to_s # this is the full serialized message\n h = msg.header.to_s\n content_length = s.length - h.length - 1\n if content_length > 0\n msg.header.set('Content-Length', content_length.to_s)\n lines = s.count(\"\\n\") - h.count(\"\\n\") - 1\n msg.header.set('Lines', lines.to_s)\n end\n end\n\n return msg\nend", "def to_s\n message\n end", "def to_s\n message\n end", "def to_message\n @fields ||= {}\n arr = Array.new(self.class.default_fields)\n type_id + @fields.inject(arr) { |a,(k,v)| a[k-1] = v; a }.join(\"|\")\n end", "def convert\n begin\n if content_type == 'application/edi-hl7'\n message = HL7::Message.parse(self.content)\n partial = message.msh.message_type.message_code.downcase\n if partial.blank?\n # bad, very bad....\n partial = 'pit'\n message = 'Parsing error - HL7 has no MSH segment'\n end\n elsif content_type=='text/yaml'\n message = YAML.load(content)\n if narrative_type_id == 10\n partial = \"yaml_form\"\n elsif narrative_type_id == 11\n partial = \"yaml_script\"\n\t elsif narrative_type_id == 12\n partial = \"diagnoseslist\"\n elsif narrative_type_id == 2\n partial = \"medslist\"\n else\n raise \"cannot determine partial for yaml narrative type %s\" % content_type_id\n end\n elsif content_type=='application/pdf' or content_type=='image/jpg' or content_type=='image/png' or content_type=='image/gif' \n partial = 'file'\n else\n message = to_html\n partial = 'pit'\n \n end\n rescue HL7::Error\n # this should hardly happen as the message will have been parsed successfully\n # once to get into the DB\n partial= 'pit'\n message = \"Parsing error of HL7 - %s\" % $!.to_s\n end\n return [message,partial]\n end", "def processRegularUserMessage(message)\r\n return formatMessageText(message[:message])\r\n end", "def update_message(data); end", "def update_message(data); end", "def message\n __getobj__\n end", "def message\n __getobj__\n end", "def message\n __getobj__\n end", "def message\n data.message\n end", "def to_messages()\n\t\t\t[]\n\t\tend", "def copy_fields(to_msg)\n\t\tend", "def to_s\n case @tipo \n when Tipo_casilla::SORPRESA\n mensaje = \"Nombre: #{@nombre}, Tipo: #{@tipo}, Mazo: #{@mazo}\"\n when Tipo_casilla::CALLE\n mensaje = \"Nombre: #{@nombre}, Tipo: #{@tipo}, Importe: #{@importe}\"\n when Tipo_casilla::DESCANSO\n mensaje = \"Nombre: #{@nombre}, Tipo: #{@tipo}\"\n when Tipo_casilla::JUEZ\n mensaje = \"Nombre: #{@nombre}, Tipo: #{@tipo}, Número Cárcel: #{@@carcel}\"\n when Tipo_casilla::IMPUESTO\n mensaje = \"Nombre: #{@nombre}, Tipo: #{@tipo}, Número Cárcel: #{@importe}\"\n end\n end", "def message\n @message\n end", "def converter; end", "def message\n \n end", "def to_s\n message\n end", "def to_s\n message\n end", "def to_s\n message\n end", "def to_s\n message\n end", "def to_s\n message\n end", "def to_s\n message\n end", "def to_s\n message\n end", "def to_s\n message\n end", "def message\n @_message\n end", "def message\n @_message\n end", "def generate_message(payload)\n if payload.is_a? Fixnum\n payload.to_json\n else\n if payload.nil?\n nil\n elsif payload.respond_to?(:empty?) && payload.empty?\n nil\n elsif payload.respond_to? :to_edible\n payload.to_edible\n elsif payload.is_a? String\n payload\n else\n # Not sure that this is the appropriate implementation, perhaps to_s is better\n payload.to_json\n end\n end\n end", "def message_buffer; end", "def message; Message.new; end", "def massage\n begin\n @massage ||= lookup.first % to_var( '_copy' )\n rescue => exception \n raise( exception, self.inspect )\n end \n end", "def message\n MESSAGE\n end", "def message\n MESSAGE\n end", "def message\n MESSAGE\n end", "def message\n MESSAGE\n end", "def processa_mensagem(d0)\n\tif d0 == \"REG\"\n\t\t# chama o método para o registro no bd\n\t\t\"A mensagem foi de REGISTRO\"\n\telsif d0 == \"IP\"\n\t\t# executa o códido de consulta no BD e retorna o resultado\n\t\t\" A mensagem foi de CONSULTA\"\n\telse\n\t\t\"ERRO!!!!\"\n\tend\nend", "def next_message; end", "def next_message; end", "def message\n process_mess\n end", "def encode_message\n self.convert(@numeric_encoded_message, @encoded_message)\n end", "def message\n end", "def to_s\n @message.to_s\n end", "def message_template; end", "def to_usmf status\n\n\t\tlogger.fatal('The method to_usmf in Converter must be implemented')\n\t\traise 'This method must be implemented'\n\n\tend", "def process_message(message)\n end", "def to_s\n return self.message\n end", "def message\n @data['message']\n end", "def format_conversion\n { account_id: self.account_id.to_s, app_id: self.app_id.to_s, actor_id: self.actor_id.to_s, properties: self.properties, time: self.updated_at}\n rescue => e\n Rails.logger.error(\"**** ERROR **** #{e.message}\")\n {}\n end", "def message text\n $status_message.value = text # trying out 2011-10-9 \n end", "def to_s\n @full_message\n end", "def to_s\n evaluated_message.to_s\n end", "def clean_message(message); end", "def unified_message\n notice.message.gsub(/(#<.+?):[0-9a-f]x[0-9a-f]+(>)/, '\\1\\2')\n end", "def getMessage()\n return @message\n end", "def to_s\n @message\n end", "def to_s\n @message\n end", "def messages; end", "def messages; end", "def messages; end", "def get_creation_success_message\n log('returned text is - \" + success_msg.text()')\n return success_msg.text()\n end", "def create_msg(txt)\n if :locale == 'de'\n self.action = \"Nachricht: '#{txt}'\"\n else\n self.action = \"Message: '#{txt}'\"\n end\n end", "def to_messages(*args)\n data = [args.dup].flatten\n if data.all? { |item| note?(item) }\n Message.to_note_ons(*data) # string note names\n elsif data.all? { |item| message?(item) }\n data # messages\n end\n end", "def force_message m; send_message format_message(nil, Time.now, m) end", "def msg=(_); end" ]
[ "0.64140266", "0.63430846", "0.6216361", "0.6216361", "0.6211695", "0.6204494", "0.61525667", "0.6145731", "0.6113799", "0.6089263", "0.60553664", "0.6018015", "0.60098916", "0.59779716", "0.59779716", "0.5956814", "0.5937646", "0.5937646", "0.59304756", "0.5866444", "0.58425814", "0.58336234", "0.5822643", "0.5796852", "0.5796852", "0.5796852", "0.5796852", "0.5796852", "0.5796852", "0.57877827", "0.57877827", "0.5785383", "0.5773255", "0.5769916", "0.5734076", "0.5730672", "0.5726132", "0.5726132", "0.57247514", "0.5724077", "0.57222587", "0.57127756", "0.57127756", "0.57005817", "0.57005817", "0.57005817", "0.5685114", "0.56842244", "0.56579816", "0.56557137", "0.56308717", "0.5607302", "0.5606803", "0.5595395", "0.5595395", "0.5595395", "0.5595395", "0.5595395", "0.5595395", "0.5595395", "0.5595395", "0.55809814", "0.55809814", "0.5579904", "0.55768794", "0.55661345", "0.55608124", "0.55602986", "0.55602986", "0.55602986", "0.55602986", "0.5559589", "0.55583173", "0.55583173", "0.5553907", "0.5541962", "0.55185497", "0.5518351", "0.55115485", "0.5509502", "0.55062115", "0.55015045", "0.5498773", "0.54974", "0.5486757", "0.54838073", "0.5480257", "0.54749656", "0.5474262", "0.5469636", "0.5464455", "0.5464455", "0.54639524", "0.54639524", "0.54639524", "0.54594785", "0.54533285", "0.5448595", "0.5447434", "0.54424113" ]
0.6226916
2
Main engine for analyse of excel file
def run parse do self.current_sheet.processing! ss = Roo::Spreadsheet.open(self.new_file_path) current_uploader = Uploader.find(self.uploader_id) total_count = ss.last_row - 1 current_uploader.update_total_row(total_count) case current_uploader.category when Uploader::TYPES[:default] upload_indicator(ss, current_uploader) when Uploader::TYPES[:indicator_2_0] upload_health_care_indicators(ss, current_uploader) when Uploader::TYPES[:resources] upload_resources(ss, current_uploader) when Uploader::TYPES[:indicator_map_color] upload_indicators_map_color(ss, current_uploader) else upload_description_template(ss, current_uploader) end end self.current_sheet.completed! end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n case @options.scan_type\n when :directory\n scan_dirs\n parse_files\n excel_report\n when :file\n @scan_files = Array.new\n @scan_files << @options.scan_file\n parse_files\n excel_report\n end\n end", "def setup(file)\r\n base_xl = (file).gsub('/','\\\\').chomp('rb')<<'xls'\r\n excel = xls_timestamp(base_xl) # timestamped instance of excel\r\n end", "def run\t\t\n\t\t\t# Check if XSSF plugin is loaded\n\t\t\tactive = false\n\t\t\tframework.plugins.each {|x| active = true if (x.name == \"xssf\")}\n\n\t\t\tif (!active)\n\t\t\t\tprint_error(\"XSSF plugin must be started first ! [load xssf]\")\n\t\t\t\treturn\n\t\t\tend\n\n\t\t\tbegin\n\t\t\t\tprint_status(\"Auxiliary module execution started, press [CTRL + C] to stop it !\") \n\t\t\t\tstart_service;\n\n\t\t\t\turl = \"http://#{(datastore['SRVHOST'] == '0.0.0.0') ? Rex::Socket.source_address('1.2.3.4') : datastore['SRVHOST']}:#{datastore['SRVPORT']}#{get_resource}\"\n\t\t\t\tdatastore['VictimIDs'] = datastore['VictimIDs'].gsub(/\\s*/, '')\n\t\t\t\n\t\t\t\t# If victim ID are provided : Process victims IDs and attacks given victims\n\t\t\t\tprocess_victims_string(datastore['VictimIDs'], \"attack_victim\", url, self.fullname) if (datastore['VictimIDs'].upcase != \"NONE\")\n\t\n\t\t\t\tputs \"\"; attacked_victims\n\t\t\t\t\n\t\t\t\t# Loop and wait for console interruption\n\t\t\t\twhile (true) do; Rex::ThreadSafe.sleep(5); end;\n\t\t\trescue ::Interrupt\n\t\t\t\tprint_error(\"Auxiliary interrupted by the console user\")\n\t\t\trescue ::Exception\n\t\t\t\tprint_error(\"Error : #{$!}\")\n\t\t\tend\n\t\tend", "def index\n @input_file = RubyXL::Parser.parse(open(params[:path_to_file])) \n @rankmi_sheet=@input_file[1]\n @input_sheet=@input_file[0]\n end", "def setup(g,file,rs_name = nil)\r\n systemos #Determine whether the OS is Chinese or English\r\n base_xl = (file).gsub('/','\\\\').chomp('rb')<<'xls'\r\n if(ARGV.length != 0) # called from controller\r\n excel = xls_timestamp(g,base_xl,nil,ARGV[2]) # called ,connect to existing excel instance. # ARGV[2] is the result sub-folder name.\r\n g.attach_ie(excel[1][2]) # test site ip\r\n else\r\n excel = xls_timestamp(g,base_xl,'ind',rs_name) # independent, start new excel instance\r\n g.open_ie(excel[1][2])\r\n support(g,excel[0])\r\n g.ver_info(excel[0])\r\n end\r\n return excel\r\nend", "def b71Parse(eventNumsArray, bandsArraywDates)\n # MOVE TO TEMP_B7\n mvDirB7()\n # COLLECTS FILE(S) WITH .XLSX FORMAT (SHOULD ONLY BE ONE) IN ORDER TO PARSE IT\n fileNamesArray = []\n fileNamesArray = Dir[\"./*.xlsx\"]\n i = 0\n bandNum = 0\n while i < eventNumsArray.length\n workbookB7first = RubyXL::Parser.parse(\"#{fileNamesArray[0]}\")\n # DEFINES WORKBOOK AS WORKSHEET (DONT DELETE)\n worksheet = workbookB7first[0]\n # ASSIGNS BAND OBJECT FROM ARRAY\n band = bandsArraywDates[i]\n bandNumber = eventNumsArray[bandNum]\n adminCount = adminCounterb71(bandNumber, band, worksheet)\n parserb71(bandNumber, band, worksheet, adminCount)\n resultsB7(band.eventName, band, worksheet)\n i += 1\n bandNum += 1\n end\nend", "def generate_test_from_ms_xls\n\nend", "def collect_data\n puts 'Collecting data...'\n\n @files.each do |file|\n parse_table(file) if File.extname(file) == '.xlsx' || File.extname(file) == '.xls'\n end\n puts 'Collecting data...Done'\n end", "def treatments\n begin\n if is_extractable_spreadsheet?\n\t xml = spreadsheet_xml\n Seek::Treatments.new xml\n else\n Seek::Treatments.new\n end\n rescue Exception=>e\n Rails.logger.error(\"Error reading spreadsheet #{e.message}\")\n Seek::Treatments.new\n end\n end", "def load_ss\n @report_out = []\n @report = IngestReport.new\n @created_ao_refs = []\n @first_level_aos = []\n @date_labels = EnumList.new('date_label')\n @date_certainty = EnumList.new('date_certainty')\n @container_types = EnumList.new('container_type')\n @extent_types = EnumList.new('extent_extent_type')\n @extent_portions = EnumList.new('extent_portion')\n @instance_types ||= EnumList.new('instance_instance_type')\n @parents = ParentTracker.new\n @start_position\n @need_to_move = false\n begin\n rows = initialize_info(params)\n while @headers.nil? && (row = rows.next)\n @counter += 1\n if row[0] && row[0].value =~ START_MARKER\n @headers = row_values(row)\n # Skip the human readable header too\n rows.next\n @counter += 1 # for the skipping\n end\n end\n raise ExcelImportException.new(I18n.t('plugins.aspace-import-excel.error.no_header')) if @headers.nil?\n begin\n while (row = rows.next)\n @counter += 1 \n values = row_values(row)\n next if values.compact.empty?\n @row_hash = Hash[@headers.zip(values)]\n ao = nil\n begin\n @report.new_row(@counter)\n ao = process_row\n @rows_processed += 1\n @error_level = nil\n Pry::ColorPrinter.pp \"no ao\" if !ao\n rescue StopExcelImportException => se\n @report.add_errors([se.message, I18n.t('plugins.aspace-import-excel.error.stopped', :row => @counter)])\n raise StopIteration.new\n rescue ExcelImportException => e\n @error_rows += 1\n @report.add_errors( e.message)\n @error_level = @hier\n Pry::ColorPrinter.pp \"Error level: #{@error_level}\"\n end\n @report.end_row\n end\n rescue StopIteration\n # we just want to catch this without processing further\n end\n if @rows_processed == 0\n raise ExcelImportException.new( I18n.t('plugins.aspace-import-excel.error.no_data'))\n end\n rescue Exception => e\n if e.is_a?( ExcelImportException) || e.is_a?( StopExcelImportException)\n @report.add_terminal_error(I18n.t('plugins.aspace-import-excel.error.excel', :errs => e.message), @counter)\n else # something else went wrong\n @report.add_terminal_error(I18n.t('plugins.aspace-import-excel.error.system', :msg => e.message), @counter)\n Pry::ColorPrinter.pp \"EXCEPTION!\"\n \n Pry::ColorPrinter.pp e.message\n Pry::ColorPrinter.pp e.backtrace\n end\n @report.end_row\n return render_aspace_partial :status => 400, :partial => \"resources/bulk_response\", :locals => {:rid => params[:rid],\n :report => @report}\n end\n move_archival_objects if @need_to_move\n @report.end_row\n Pry::ColorPrinter.pp \"Number of Archival Object created: #{@created_ao_refs.length}\"\n return render_aspace_partial :partial => \"resources/bulk_response\", :locals => {:rid => params[:rid], :report => @report}\n end", "def extract_data_from_worksheets\n worksheets do |name, xml_filename|\n \n extract ExtractValues, xml_filename, [name, 'Values']\n apply_rewrite RewriteValuesToAst, [name, 'Values']\n \n extract ExtractSimpleFormulae, xml_filename, [name, 'Formulae (simple)']\n apply_rewrite RewriteFormulaeToAst, [name, 'Formulae (simple)']\n\n extract ExtractSharedFormulae, xml_filename, [name, 'Formulae (shared)']\n apply_rewrite RewriteFormulaeToAst, [name, 'Formulae (shared)']\n\n extract ExtractSharedFormulaeTargets, xml_filename, [name, 'Formulae (shared targets)']\n\n extract ExtractArrayFormulae, xml_filename, [name, 'Formulae (array)']\n apply_rewrite RewriteFormulaeToAst, [name, 'Formulae (array)']\n \n extract_tables_for_worksheet(name,xml_filename)\n end\n end", "def treatments\n begin\n if content_blob.is_extractable_spreadsheet?\n xml = spreadsheet_xml\n Seek::Data::Treatments.new xml\n else\n Seek::Data::Treatments.new\n end\n rescue Exception => e\n Rails.logger.error(\"Error reading spreadsheet #{e.message}\")\n raise(e) if Rails.env==\"test\"\n Seek::Data::Treatments.new\n end\n end", "def render_output\n self.render_xls\n end", "def info; @xlsx.info; end", "def eval_file; end", "def init()\n\n p \"=======================\"\n p \"Iniciando o script...\"\n\n #\n # First Step\n # => Open file\n ############################\n data = Roo::Spreadsheet.open('./data/exemplo-curto.xlsx')\n p \"Abrindo o arquivo\"\n persons = organize_data(data)\n # validation\n # => verify if a valid email\n ############################\n #p \"validando os emails...\"\n #emails = validate_emails(data)\n #valid_emails = emails['validos']\n #invalid_emails = emails['invalidos']\n\n\n p \"OK\"\n #export_to_csv(\"emails_validos\", valid_emails)\n #export_to_xlsx(\"emails_validos\", valid_emails)\n #export_to_csv(\"emails_invalidos\", invalid_emails)\n #export_to_xlsx(\"emails_invalidos\", invalid_emails)\n #\n # Second Step\n # => organize for atributes\n # 1. UF\n # 2. DT_NASCIMENTO\n # 3. IF\n # 4. ESCOLARIDADE\n ##########################\n uf_mails = organize_to_uf (persons)\n uf_mails.each do | key, est |\n if est.length == 0 then\n p \"vazio #{key} \"\n else\n export_to_csv(key, est)\n export_to_xlsx(key, est)\n end\n\n end\n\n dt_nascimento_mails = organize_to_dt_nasc(persons)\n dt_nascimento_mails.each do | key, value |\n if value.length == 0 then\n p \"empty: #{key} \"\n else\n export_to_csv(key, value)\n export_to_xlsx(key, value)\n end\n\n end\n\n if_mails = organize_to_if (persons)\n if_mails.each do | key, value |\n if value.length == 0 then\n p \"empty: #{key} \"\n else\n export_to_csv(key, value)\n export_to_xlsx(key, value)\n end\n end\n\n escolaridade_mails = organize_to_escolaridade (persons)\n escolaridade_mails.each do | key, value |\n if value.length == 0 then\n p \"empty: #{key} \"\n else\n export_to_csv(key, value)\n export_to_xlsx(key, value)\n end\n end\n #\n # Third Step\n # => Export to xlsx\n ##########################\n p \"exportando arquivo\"\n #export_table(valid_emails)\n p \"Ok\"\n p \"FINALIZANDO\"\n\n end", "def parse_xlsx\n 2.upto(@spreadsheet.last_row).each do |row_index|\n row = info_hash(row_index)\n \n unless row.nil?\n @data[row[:name]] ||= {\n code: row[:code],\n worlds: [],\n areas: [],\n positions: []\n }\n\n @data[row[:name]][:worlds] << row[:world] if !row[:world].blank? && !@data[row[:name]][:worlds].include?(row[:world])\n @data[row[:name]][:areas] << row[:area] if !row[:area].blank? && !@data[row[:name]][:areas].include?(row[:area])\n @data[row[:name]][:positions] << row[:position] if !row[:position].blank? && !@data[row[:name]][:positions].include?(row[:position])\n end\n end\n end", "def parse_excel_file(subtopic_id,topic_id,question_bank_id,excel_file,tenant_id)\n import = Import.new(excel_file)\n if import.save!\n mime = (MIME::Types.type_for(import.excel.path)[0])\n mime_obj = mime.extensions[0]\n #do not process further if the uploaded file is other than xls,xlsx\n if (!mime_obj.nil? and !mime_obj.blank?) and (mime_obj.include? \"xls\" or mime_obj.include? \"xlsx\" or mime_obj.include? \"ods\") then\n @roo = create_roo_instance(import.excel.path,mime_obj)\n process_the_excel_file(import.id,subtopic_id,topic_id,question_bank_id,tenant_id)\n else\n flash[:notice] = 'Upload only document or excel file'\n end\n delete_excel(import.excel.path)\n import.destroy\n else\n flash[:notice] = 'Excel data import failed'\n end\n end", "def create_pdf_script\n\t begin\n\t\t@text_data = \"\"\n\t if params[:dump][:excel_file] then temp = params[:dump][:excel_file].tempfile else render :index and return end\n file = File.join(\"public/rubyxl\",params[:dump][:excel_file].original_filename)\n FileUtils.cp temp.path, file\n ##debugger app = WIN32OLE.new('Excel.Application')\n\t\tWIN32OLE.ole_initialize\n app = WIN32OLE.new('Excel.Application')\n WIN32OLE.const_load(app, ExcelConst)\n @books = app.Workbooks.Open(File.expand_path(file, ENV['RAILS_ROOT']))\n savestyle = ExcelConst::XlLineStyleNone\n saveweight = ExcelConst::XlThin ##太さ\n savecolor = 0\n\t\tinit_starrt\n @books.Worksheets.each do |sheet|\n\t\t @report_code = sheet.name.downcase\n\t\t\treport = plsql.select(:first,\"select * from r_reports where pobject_code_rep = '#{@report_code}' and report_expiredate > sysdate\") \n\t\t\tif report.nil?\n @books.Close\n logger.debug\t \"line #{__LINE__} error : missing report_code #{@report_code}\"\n\t\t\t\t@text_data << \"<p>line #{__LINE__} error : missing report_code #{@report_code}</p>\"\n render :text => @text_data and return\n\t\t\tend\n\t\t\t@viewname = report[:pobject_code_view]\n if PLSQL::View.find(plsql, @viewname).nil?\n @books.Close\n\t\t\t\t@text_data << \"<p>line #{__LINE__} error : missing view #{@viewname}</p>\"\n render :text => @text_data and return\n end\n\t\t\t@screencode = report[:pobject_code_scr]\n\t\t\tif sheet.cells(1,1).value.nil?\n @books.Close\n logger.debug\t \"line #{__LINE__} error : cell(1,1) : must set some value sheet_name:#{sheet.name}\"\n @text_data << \"<p>line #{__LINE__} error : cell(1,1) : must set some value sheet_name:#{sheet.name}</p>\" and return\n render :text => @text_data and return\n\t\t\tend\n\t\t\t@margin = []\n @margin << sprintf(\"%.3f\",sheet.PageSetup.TopMargin * 0.394 /2).to_f\n @margin << sprintf(\"%.3f\",sheet.PageSetup.RightMargin * 0.394/2).to_f\n @margin << sprintf(\"%.3f\",sheet.PageSetup.BottomMargin * 0.394/2).to_f\n @margin << sprintf(\"%.3f\",sheet.PageSetup.LeftMargin * 0.394/2).to_f\n @paper[:orientation] = sheet.PageSetup.Orientation ##縦1 横 2\n @paper[:size] = sheet.PageSetup.PaperSize.to_i ## A3:8, A4:9, A5:11\n rowpos = 0.0 ##縦位置\n saverowpos = 0.0 #線種の始まり\n savecolumnpos = 0.0\n savecellrow = 0\n savecellcolumn = 0 \n rectsavecolor = 0\n rectsaverowpos = 0\n rectsavecolumnpos = 0\n rectwidthvalue = 0\n rectheight = 0 \n rectsavecellrow = 0\n rectsavecellcolumn = 0\n\t\t\trno_row = {}\n\t\t\trno_column = {}\n #### 横線種 box 項目作成\n sheet.UsedRange.Rows.each do |row|\n widthvalue = 0.0 ##横線長さ\n columnpos = 0.0 ##横位置\n rowpos += row.Height\n ###背景色処理\n rectrowpos = 0.0 ##縦位置\n rectcolumnpos = 0.0 ##縦位置\n @fill_rectangle_color << [rectsavecellrow,rectsavecellcolumn,rectsaverowpos,rectsavecolumnpos,rectwidthvalue,rectheight,rectsavecolor] if rectsavecolor != 0\n rectsavecellrow = 0\n rectsavecellcolumn = 0\n rectsavecolor = 0\n rectsaverowpos = 0\n rectsavecolumnpos = 0\n rectwidthvalue = 0\n rectheight = 0\n @wline << [savecellrow,savecellcolumn,saverowpos,savecolumnpos,widthvalue,savestyle,saveweight,savecolor] if savestyle != ExcelConst::XlLineStyleNone or saveweight != ExcelConst::XlThin or savecolor != 0\n savestyle = ExcelConst::XlLineStyleNone\n saveweight = ExcelConst::XlThin ##太さ\n savecolor = 0\n row.Columns.each do |cell|\n\t\t\t\t if cell.column == 1 \n\t\t\t\t\t if cell.value.to_s =~ /\\d/ then rno_row[cell.row] = cell.value.to_i else rno_row[cell.row] = 0 end\n\t\t\t\t\tend\t\n\t\t\t\t if cell.row == 1 \n\t\t\t\t\t if cell.value.to_s =~ /\\d/ then rno_column[cell.column] = cell.value.to_i else rno_column[cell.column] = 0 end\n\t\t\t\t\tend\t\n if cell.MergeCells\n if cell.MergeArea.Item(1,1).row == cell.row and cell.MergeArea.Item(1,1).column == cell.column and cell.column != 1 and cell.row != 1 \n\t @box_fields << [rno_row[cell.row]+rno_column[cell.column],\n\t\t\t\t\t\t\t [cell.row,cell.column,rowpos - row.Height,columnpos,cell.MergeArea.Font.size,cell.MergeArea.Item(1,1).Value.to_s,\n \t\t\t\t\t\t\t\t\t\tcell.MergeArea.Width,cell.MergeArea.Height,cell.MergeArea.Font.color,cell.MergeArea.HorizontalAlignment,\n\t\t\t\t\t\t\t\t\t\t\tcell.MergeArea.VerticalAlignment]] if cell.MergeArea.Item(1,1).Value\n\t end\n else\n\t if cell.Value and cell.column != 1 and cell.row != 1 \n\t @fields<< [rno_row[cell.row]+rno_column[cell.column],\n \t\t\t\t\t\t\t[cell.row,cell.column,rowpos,columnpos,cell.Font.size,cell.value.to_s,cell.Font.color]] ##if cell.Value.class != String\n\t end\n\t end ##cell.MergeCells\t\n\t if savestyle != cell.Borders(ExcelConst::XlEdgeBottom).LineStyle or saveweight != cell.Borders(ExcelConst::XlEdgeBottom).Weight or savecolor != cell.Borders(ExcelConst::XlEdgeBottom).Color then \n\t if savestyle != ExcelConst::XlLineStyleNone or saveweight != ExcelConst::XlThin or savecolor != 0 \n\t @wline << [savecellrow,savecellcolumn,saverowpos,savecolumnpos,widthvalue,savestyle,saveweight,savecolor]\n\t end ##if saveborder != ExcelConst::XlLineStyleNone\n\t widthvalue = 0.0\n\t if cell.Borders(ExcelConst::XlEdgeBottom).LineStyle == ExcelConst::XlLineStyleNone and cell.Borders(ExcelConst::XlEdgeBottom).Weight == ExcelConst::XlThin and cell.Borders(ExcelConst::XlEdgeBottom).Color == 0 then\n\t saverowpos = 0.0\n\t\t savecolumnpos = 0.0\n\t\t else\n\t\t saverowpos = rowpos \n\t\t savecellcolumn = cell.column\n\t\t savecellrow = cell.row\n\t\t savecolumnpos = columnpos\n end ## if cell.Borders(ExcelConst::XlEdgeBottom).LineStyle == ExcelConst::XlLineStyleNone\n\t savestyle = cell.Borders(ExcelConst::XlEdgeBottom).LineStyle \n saveweight = cell.Borders(ExcelConst::XlEdgeBottom).Weight\n savecolor = cell.Borders(ExcelConst::XlEdgeBottom).Color\n\t end ##if saveboder != cell.Borders(ExcelConst::XlEdgeBottom).LineStyle then \n\t widthvalue += cell.Width\n\t ################# 罫線処理終了\n\t #背景色処理開始\n\t if cell.MergeCells\t \n\t if cell.MergeArea.Item(1,1).row == cell.row and cell.MergeArea.Item(1,1).column == cell.column then\n\t\t if rectsavecolor != cell.MergeArea.Interior.Color then\n if rectsavecolor != 0 then\n\t\t @fill_rectangle_color << [rectsavecellrow,rectsavecellcolumn,rectsaverowpos,rectsavecolumnpos,rectwidthvalue,rectheight,rectsavecolor]\n\t\t\t rectwidthvalue = 0\n end\n\t\t if cell.MergeArea.Interior.Color == 0 then \n rectsavecellrow = rectsavecellcolumn = rectsaverowpos = rectsavecolumnpos = rectwidthvalue = rectheight = 0\n\t \t else\n\t\t rectsaverowpos = rowpos - cell.MergeArea.Height\n\t\t rectsavecellcolumn = cell.column\n\t\t rectsavecellrow = cell.row\n\t\t rectsavecolumnpos = columnpos\n\t\t rectsavecolor = cell.MergeArea.Interior.Color\n\t\t rectheight = cell.MergeArea.Height\n\t end ## cell.Interior.Color == \n\t\t end\n\t end ##cell.MergeArea.Item(1,1).row == cell.row and cell.MergeArea.Item(1,1).column == cell.column\n\t else\n\t if rectsavecolor != cell.Interior.Color then\n\t if rectsavecolor != 0 then \n\t\t @fill_rectangle_color << [rectsavecellrow,rectsavecellcolumn,rectsaverowpos,rectsavecolumnpos,rectwidthvalue,rectheight,rectsavecolor]\n\t\t rectwidthvalue = 0\n end\n\t if cell.Interior.Color == 0 then \n rectsavecellrow = rectsavecellcolumn = rectsaverowpos = rectsavecolumnpos = rectwidthvalue = rectheight = 0\n\t\t else\n\t\t rectsaverowpos = rowpos - cell.Height\n\t\t rectsavecellcolumn = cell.column\n\t\t rectsavecellrow = cell.row\n\t\t rectsavecolumnpos = columnpos\n\t\t rectsavecolor = cell.Interior.Color\n\t\t rectheight = cell.Height\n\t end ## cell.Interior.Color == \n\t end ####rectsavecolor != cell.Interior.Color\n\t end ### cell.MergeCells\n\t rectwidthvalue += cell.Width ##色の幅\n columnpos += cell.Width\n end ##column\n end ##row\n @fill_rectangle_color << [rectsavecellrow,rectsavecellcolumn,rectsaverowpos,rectsavecolumnpos,rectwidthvalue,rectheight,rectsavecolor] if rectsavecolor != 0\n @wline << [savecellrow,savecellcolumn,saverowpos,savecolumnpos,widthvalue,savestyle,saveweight,savecolor] if savestyle != ExcelConst::XlLineStyleNone\n rowpos = 0.0\n columnpos = 0.0\n saverowpos = 0.0\n savecolumnpos = 0.0\n saveheight = 0 \n savecellrow = 0\n savecellcolumn = 0\n sheet.UsedRange.Columns.each do |column| ###縦の罫線\n heightvalue = 0.0\n rowpos = 0.0\n\t @hline << [savecellrow,savecellcolumn,saverowpos,savecolumnpos,heightvalue,savestyle,saveweight,savecolor] if savestyle != ExcelConst::XlLineStyleNone or saveweight != ExcelConst::XlThin or savecolor != 0\n\t savestyle = column.Borders(ExcelConst::XlEdgeLeft).LineStyle\n\t saveweight = column.Borders(ExcelConst::XlEdgeLeft).Weight\n\t savecolor = column.Borders(ExcelConst::XlEdgeLeft).Color\n column.Rows.each do |cell|\n if savestyle != cell.Borders(ExcelConst::XlEdgeLeft).LineStyle or saveweight != cell.Borders(ExcelConst::XlEdgeLeft).Weight or savecolor != cell.Borders(ExcelConst::XlEdgeLeft).Color then \n\t if savestyle != ExcelConst::XlLineStyleNone or saveweight != ExcelConst::XlThin or savecolor != 0 then\n\t @hline << [savecellrow,savecellcolumn,saverowpos,savecolumnpos,heightvalue,savestyle,saveweight,savecolor]\n\t end ##if saveborder != ExcelConst::XlLineStyleNone\n\t heightvalue = 0.0\n\t if cell.Borders(ExcelConst::XlEdgeLeft).LineStyle == ExcelConst::XlLineStyleNone and saveweight == ExcelConst::XlThin and savecolor == 0 then\n\t saverowpos = 0.0\n\t\t savecolumnpos = 0.0\n\t\t else\n\t\t saverowpos = rowpos \n\t\t savecellcolumn = cell.column\n\t\t savecellrow = cell.row\n\t\t savecolumnpos = columnpos\n end ## if cell.Borders(ExcelConst::XlEdgeLeft).LineStyle == -4142 \n\t savestyle = cell.Borders(ExcelConst::XlEdgeLeft).LineStyle \n saveweight = cell.Borders(ExcelConst::XlEdgeLeft).Weight\n\t savecolor = cell.Borders(ExcelConst::XlEdgeLeft).Color\n\t end ##if saveboder != cell.Borders(ExcelConst::XlEdgeLeft).LineStyle then \n heightvalue += cell.Height\n\t rowpos += cell.Height\n end ##row\n\t @hline << [savecellrow,savecellcolumn,saverowpos,savecolumnpos,heightvalue,savestyle,saveweight,savecolor] if savestyle != ExcelConst::XlLineStyleNone\n columnpos += column.Width\n end ##column\n @prwanstr = \"### start ###\\n\"\n ##crt_prwan_pdf\n @subfields = plsql.__send__(@viewname).column_names\n chng_tblfield \n crt_prwan_org_pdf\n @prwanstr << \"##### /@sum = #{@sum} /###\\n\" \n strorderby = \"\"\n @sortkey.sort.each do |key,value|\n\t strorderby << value + \",\"\n end\n @prwanstr << \"##### /order by #{strorderby.chop} /#\\n\" if @sortkey.size>0\n @prwanstr << \"##### /pagekey = #{@pagekey} /#\\n\" if @pagekey.size>0\n ###crt_prwan_tst_pdf\t\t\n foo = File.open(\"#{Rails.root}/vendor/blk_pdf/#{@report_code}.rb\", \"w:UTF-8\") # 書き込みモード\n foo.puts @prwanstr\n foo.close\n\t\t\treplace_rep = {}\n\t\t\treplace_rep[:filename] = \"/vendor/blk_pdf/#{@report_code}.rb\"\n\t\t\treplace_rep[:where] = {:id=>report[:id]}\n\t\t\tplsql.reports.update replace_rep\n\t\t @text_data << \"<br><P>create pdf script #{@screencode}</p></br>\"\n end ##sheet\n @books.Close\t\t\n\t\trender :text => @text_data\n\t\trescue\n logger.debug\"class #{self} : LINE #{__LINE__} $@: #{$@} \" \n ##logger.debug\"class #{self} : LINE #{__LINE__} $!: #{$!} \"\n\t\t if @books\n\t\t\t @books.Close if respond_to?(\"@books.Close\")\n\t\t\tend\n\t\t\t@text_data << \"error check log \" \n\t\t\trender :text => @text_data and return\n\t\tend ##beigin\n end", "def processEnclaveControlsFile(filePath)\n # setup\n sql = ActiveRecord::Base.connection();\n fileName = \"#{FileUtils.pwd()}/upload/#{filePath}.xls\"\n fileName = fileName.gsub(/\\//, '\\\\')\n \n # set up two pointers for spreadsheet to work on different tabs\n s = Excel.new(fileName)\n s2 = Excel.new(fileName)\n s.default_sheet = s.sheets[1]\n s2.default_sheet = s2.sheets[4]\n \n # process each record in spreadsheet\n 8.upto(s.last_row) do |line|\n # get line of info from spreadsheet\n line2 = line + 1\n #baseControlNumber = s.cell(line, 'A')\n baseControlNumber = s2.cell(line2, 'F')\n #controlName = s.cell(line, 'B')\n controlName = s2.cell(line2, 'G')\n cagControla = s.cell(line, 'E')\n cagControl = s2.cell(line2, 'K')\n implementationStatus = s.cell(line, 'F')\n implementationDescription = s.cell(line, 'G')\n testMethod = s.cell(line, 'H')\n poam = s.cell(line, 'I')\n \n # debug info to log\n #Rails.logger.error \"\\n\" + \"#{line}-a: #{baseControlNumber}, b: #{controlName}, c: #{cagControl}, d: #{implementationStatus}, e: #{implementationDescription}, f: #{testMethod}\\n\"\n \n if baseControlNumber != nil then #Skip empty lines\n # determin cybercontrol referenced\n controlFamily = ''\n controlNumber = 0\n enhancement = nil\n parts = baseControlNumber.split(/-/)\n controlFamily = parts[0]\n controlNumber = parts[1]\n if (/^\\([0-9]*\\)$/ =~ controlName) then\n enhancement = controlName.gsub(/\\(/,'')\n enhancement = enhancement.gsub(/\\)/, '')\n end\n \n # get matching cyber control\n cc = nil\n if enhancement != nil then\n cc = Cybercontrol.where(:controlFamilyCode => controlFamily, :controlNumber => controlNumber, :enhancement => enhancement).first\n else\n cc = Cybercontrol.where(\"controlFamilyCode=? AND controlNumber=? AND enhancement IS NULL\", controlFamily, controlNumber).first\n end\n \n # Post data to enclave controls table\n #sqlcode = \"UPDATE enclavecontrols SET SSPImplementationStatus=?, SSPImplementationDescription=?, testMethod=?\" + ((cagControl='RMF') ? \", RMF=1\" : \"\") + \" WHERE cybercontrol_id=#{cc.id}\"\n #status = sql.execute(sqlcode, implementationStatus, implementationDescription, )\n ecSet = Enclavecontrol.where(:cybercontrol_id => cc.id)\n ecSet.each do |ec|\n ec.SSPImplementationStatus = implementationStatus\n ec.SSPImplementationDescription = implementationDescription\n ec.testMethod = testMethod\n if (cagControla==\"RMF\") then\n ec.RMF = 1\n else\n ec.RMF = 0\n end\n ec.save\n end\n end\n \n end\n end", "def process\n uploaded_workbook = Spreadsheet.open self.path\n @records_matched = 0\n @records_updated = 0\n @records_failed = 0\n @failed_queries = 0\n @skipped_records = 0\n\n product_sheet = uploaded_workbook.worksheet(0)\n perform(product_sheet)\n\n if not uploaded_workbook.worksheet(1).nil?\n variant_sheet = uploaded_workbook.worksheet(1)\n perform(variant_sheet)\n end\nend", "def runAnalyzer(num_samples,inhash)\n # select profile for run\n show do \n title \"Select #{QIAXCEL_TEMPLATE[inhash[:sampleTypes]]}\" # this is just a profile name, should be ok for other polymerases\n note \"Click <b>Back to Wizard</b> if previous data is displayed.\"\n check \"Under <b>Process -> Process Profile</b>, make sure <b>#{QIAXCEL_TEMPLATE[inhash[:sampleTypes]]}</b> is selected.\"\n end\n \n # select alignment marker\n ref_marker = (inhash[:sampleTypes] == 'DNA') ? REF_MARKERS[inhash[:type_ind]][inhash[:cutoff_ind]] : REF_MARKERS[inhash[:type_ind] ]\n show do \n title \"Select alignment marker\"\n check \"Under <b>Marker</b>, in the <b>Reference Marker </b> drop-down, select <b>#{ref_marker}</b>. A green dot should appear to the right of the drop-down.\"\n end\n \n # empty rows\n if inhash[:sampleTypes] == 'RNA'\n num_samples = num_samples + 1 # Include the ladder in the first well of the first stripwell\n nonempty_rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n (num_samples % WELLS_PER_STRIPWELL) > 0 ? nonempty_rows + 1 : nonempty_rows\n else\n nonempty_rows = (num_samples/WELLS_PER_STRIPWELL.to_f).ceil\n end\n show do \n title \"Deselect empty rows\"\n check \"Under <b>Sample selection</b>, deselect all rows but the first #{nonempty_rows}.\"\n end\n \n # check \n show do \n title \"Perform final check before running analysis\"\n note \"Under <b>Run Check</b>, manually confirm the following:\"\n check \"Selected rows contain samples.\"\n check \"Alignment marker is loaded (changed every few weeks).\"\n end\n \n # run and ask tech for remaining number of runs\n run_data = show do \n title \"Run analysis\"\n note \"If you can't click <b>Run</b>, and there is an error that reads <b>The pressure is too low. Replace the nitrogen cylinder or check the external nitrogen source</b>, close the software, and reopen it. Then restart at title - <b>Select #{QIAXCEL_TEMPLATE[inhash[:sampleTypes]]} </b>\"\n check \"Otherwise, click <b>Run</b>\"\n note \"Estimated time of experiment is given at the bottom of the screen\"\n get \"number\", var: \"runs_left\", label: \"Enter the number of <b>Remaining Runs</b> left in this cartridge\", default: 0\n #image \"frag_an_run\"\n end\n \n # return\n run_data[:runs_left]\n \n end", "def import_master\n begin\n if request.post?\n raise \"Please attach an excel file for import master tables\" if params[:import_file].blank? \n status = \"\"\n set_original_path(params[:import_file]) \n data = Roo::Spreadsheet.open(@original_path) \n data.each_with_pagename do |name, sheet|\n table_name = name.downcase\n case table_name\n when \"bill_footer_setting\" \n status = FooterSetting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"bill_group\" \n status = BillGroup.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"combooffer\" \n status = ComboOffer.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"creditcard_master\" \n status = CreditCard.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"cust_detail\"\n status = Customer.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"item_groups\" \n status = ItemGroup.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"item_groups_kot_print\" \n status = ItemGroupsKotPrint.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"item_sub_group\" \n status = ItemSubGroup.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"items\" \n status = Item.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"table_master\"\n status = Table.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"settings\" \n status = Setting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"remarksmaster\"\n status = RemarkMaster.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"table_section\" \n status = TableSection.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"tax\"\n status = Tax.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"user_validation\" \n status = StaffSubMenuSetting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"usermainmenu\" \n status = StaffMenuSetting.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"waiter\" \n status = Waiter.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"outlet_master\" \n status = Outlet.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"combopackage\" \n status = ComboPackage.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"user_master\" \n status = Staff.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"strtable\" \n status = Company.checked_attributes(sheet)\n raise status[1] if status [0] == false \n when \"happyhour\" \n status = HappyHour.checked_attributes(sheet)\n raise status[1] if status [0] == false \n end \n end \n \n begin\n data.default_sheet = \"Outlet_Master\"\n status = Outlet.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false\n begin\n data.default_sheet = \"ComboPackage\"\n status = ComboPackage.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false \n begin\n data.default_sheet = \"Table_Section\"\n status = TableSection.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false \n begin\n data.default_sheet = \"User_Master\"\n status = Staff.import(data, current_location)\n rescue Exception => e \n end \n raise status[1] if status [0] == false\n \n data.each_with_pagename do |name, sheet|\n table_name = name.downcase\n case table_name\n when \"bill_footer_setting\"\n status = FooterSetting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"bill_group\" \n status = BillGroup.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"combooffer\"\n status = ComboOffer.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"creditcard_master\"\n status = CreditCard.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"cust_detail\"\n status = Customer.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"item_groups\"\n status = ItemGroup.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"item_groups_kot_print\"\n status = ItemGroupsKotPrint.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"item_sub_group\" \n status = ItemSubGroup.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"items\"\n status = Item.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"table_master\"\n status = Table.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"settings\"\n status = Setting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"remarksmaster\"\n status = RemarkMaster.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false\n when \"tax\"\n status = Tax.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"user_validation\" \n status = StaffSubMenuSetting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"usermainmenu\" \n status = StaffMenuSetting.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"waiter\" \n status = Waiter.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"strtable\" \n status = Company.import(sheet, current_client) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n when \"happyhour\" \n status = HappyHour.import(sheet, current_location) unless sheet.last_row <= 1\n raise status[1] if status [0] == false \n end \n end\n flash[:notice] = \"Master data is imported successfully.\"\n redirect_to client_path\n end\n rescue Exception => e\n flash.now[:info] = e.message\n render :import_master\n end\n end", "def driver\n\n @steps.each do |step|\n begin\n next if step['Run'].to_s.downcase != 'x'\n displayDescription(step)\n @skipCurrentStep = false\n @step = step\n @action = step['Action'].clone\n\n methodName = getMethodName(step['Action'])\n begin\n send(methodName, step)\n rescue Exception => e\n screenActions\n end\n rescue Exception => e\n @report << [step['Action'], step['Description'], e.message, 'False']\n end\n end\n\n generateReport\n system(\"start excel #{@reportFolder}/report.csv\")\n end", "def run\n connect if cn.state.zero?\n sql || get_sql\n replace_placeholders\n \n # If we already hold a Sheet\n if result \n \n # Take the Workbook which holds the current Sheet\n rwb = result.parent\n \n # Run the Report and bring back a new Sheet\n self.result = query( sql )\n \n # Add the new Sheet onto the existing Workbook\n rwb << result\n \n else\n \n # Create a new Sheet\n self.result = query( sql )\n \n end\n \n # Use the SQL report naming convention to guess at a sheet name.\n # Max Sheet name length in Excel is 31 characters.\n result.name = clean_name if name\n \n # Set the result to be invisible by default\n result.parent.standalone = true\n \n # Return the Sheet\n result\n \n end", "def index\n\n\t\t\n\n\n\t\t$beginning = Time.now\n\n \n\t\t# Load the source Excel file, with all the special products info\n\t\t$source = Excel.new(\"Template_2013_05_10/source.xls\")\n\t\t#$source = Csv.new(\"Template_2013_05_10/source.csv\")\n\t\t$source.default_sheet = $source.sheets.first\n\t\t\n\t\t# Load the Magento template, which is in Open Office format\n\t\t#template = Openoffice.new(\"http://beta.topart.com/csv/Template_2012_11_28/template.ods\")\n\t\t#template = Csv.new(\"Template_2013_05_10/template.csv\")\n\t\tglobal_template = Openoffice.new(\"Template_2013_05_10/template.ods\")\n\t\tglobal_template.default_sheet = global_template.sheets.first\n\n\t\t# Automatically scan the template column names and store them in an associative array\n\t\t$template_dictionary = Hash.new\n\t\t\"A\".upto(\"GC\") do |alphabet_character|\n\t\t\tcell_content = \"#{global_template.cell(1, alphabet_character)}\"\n\t\t\t$template_dictionary[cell_content] = alphabet_character\n\t\tend\n\n\t\t#global_template = nil\n\n\t\tp \"Template headers loaded.\"\n\n\t\t# Automatically scan the source column names and store them in an associative array\n\t\t$source_dictionary = Hash.new\n\t\t\"A\".upto(\"BU\") do |alphabet_character|\n\t\t\tcell_content = \"#{$source.cell(1, alphabet_character)}\"\n\t\t\t$source_dictionary[cell_content] = alphabet_character\n\t\tend\n\n\t\tp \"Source headers loaded.\"\n\n\t\t# Load the retail_material_size spreadsheet file for paper\n\t\t$retail_photo_paper = Excel.new(\"Template_2013_05_10/retail_master.xls\")\n\t\t$retail_photo_paper.default_sheet = $retail_photo_paper.sheets[0]\n\n\t\t# Load the retail_material_size spreadsheet file for canvas\n\t\t$retail_canvas = Excel.new(\"Template_2013_05_10/retail_master.xls\")\n\t\t$retail_canvas.default_sheet = $retail_canvas.sheets[2]\n\n\t\t# Load the retail_framing spreadsheet file to extract framing, stretching and matting information\n\t\tretail_framing = Excel.new(\"Template_2013_05_10/retail_master.xls\")\n\t\tretail_framing.default_sheet = retail_framing.sheets[3]\n\n\n\t\t# MATERIAL -> PAPER\n\t\t# Automatically scan the source column names and store them in an associative array\n\t\t$retail_photo_paper_dictionary = Hash.new\n\t\t\"A\".upto(\"T\") do |alphabet_character|\n\t\t\tcell_content = \"#{$retail_photo_paper.cell(1, alphabet_character)}\"\n\t\t\t$retail_photo_paper_dictionary[cell_content] = alphabet_character\n\t\tend\n\n\t\tp \"Retail photo paper headers correctly loaded.\"\n\n\t\t# MATERIAL -> CANVAS\n\t\t# Automatically scan the source column names and store them in an associative array\n\t\t$retail_canvas_dictionary = Hash.new\n\t\t\"A\".upto(\"AR\") do |alphabet_character|\n\t\t\tcell_content = \"#{$retail_canvas.cell(1, alphabet_character)}\"\n\t\t\t$retail_canvas_dictionary[cell_content] = alphabet_character\n\t\tend\n\n\t\tp \"Retail canvas headers correctly loaded.\"\n\n\t\t$retail_framing_dictionary = Hash.new\n\t\t\"A\".upto(\"R\") do |alphabet_character|\n\t\t\tcell_content = \"#{retail_framing.cell(1, alphabet_character)}\"\n\t\t\t$retail_framing_dictionary[cell_content] = alphabet_character\n\t\tend\n\n\n\t\t# FRAMING, STRETCHING, MATTING\n\t\t# Automatically scan the source column names and store them in an associative array\n\t\t# Declare and fill the retail framing table\n\t\t$retail_framing_table = Array.new(retail_framing.last_row, 18)\n\t\ti = 0\n\n\t\t# Scan all the source rows and process the F21066 items only, and only once at the beginning for efficiency\n\t\t2.upto($source.last_row) do |source_line|\n\n\t\t\tprimary_vendor_no = \"#{$source.cell(source_line, $source_dictionary[\"PrimaryVendorNo\"])}\"\n\n\t\t\tif primary_vendor_no == \"F21066\" or primary_vendor_no == \"S73068\"\n\t\t\t\t$retail_framing_table[i] = Hash.new\n\n\t\t\t\t# Store all the MAS specific fields, which means the majority of them\n\t\t\t\t\"A\".upto(\"R\") do |alphabet_character|\n\t\t\t\t\theader = \"#{retail_framing.cell(1, alphabet_character)}\"\n\t\t\t\t\t$retail_framing_table[i][header] = \"#{$source.cell(source_line, $source_dictionary[header])}\"\n\t\t\t\tend\n\n\t\t\t\t# Store the spreadsheet retail prices only\n\t\t\t\t2.upto(retail_framing.last_row) do |k|\n\t\t\t\t\t#$retail_framing_table[i] = Hash.new\n\n\t\t\t\t\t\"C\".upto(\"F\") do |alphabet_character|\n\t\t\t\t\t\tcell_content = \"#{retail_framing.cell(1, alphabet_character)}\"\n\n\t\t\t\t\t\tif $retail_framing_table[i][\"Item Code\"] == \"#{retail_framing.cell(k, $retail_framing_dictionary[\"Item Code\"])}\"\n\t\t\t\t\t\t\t$retail_framing_table[i][cell_content] = \"#{retail_framing.cell(k, alphabet_character)}\"\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\ti = i + 1\n\n\t\t\tend\n\n\t\tend\n\n\t\tp \"The F21066 items have been correctly loaded.\"\n\n\t\t#written_categories = []\n\t\t$global_alternate_size_array = Array.new\n\n\t\t# Load a hash table with all the item codes from the products spreadsheet. Used to check the presence of DGs and corresponding posters\n\t\t$item_source_line = Hash.new\n\n\t\t#7000.upto($source.last_row) do |source_line|\n\t\t2.upto($source.last_row) do |source_line|\n\t\t\titem_code = \"#{$source.cell(source_line, $source_dictionary[\"Item Code\"])}\"\n\t\t\t$item_source_line[item_code] = source_line\n\t\tend\n\n\t\tp \"All the source lines have been correctly mapped.\"\n\n\t\t# We use the following hash table to track DG products that should contain the additional poster size as a custom option\n\t\t$posters_and_dgs_hash_table = Hash.new\n\t\t$poster_only_hash_table = Hash.new\n\n\t\t$template_counter = 1\n\n\t\t#thread_i = 2\n\t\t#row_range = 50\n\t\t#limit = $source.last_row\n\t\t#limit = 100\n\t\t#thread_pool = Array.new\n\n\t\t#while thread_i < limit\n\t\t#\tthread_pool << Thread.new{parallel_write(thread_i, thread_i + row_range - 1)}\n\t\t#\tthread_i = thread_i + row_range\n\t\t#end\t\n\n\t\t\n\t\t#for thread in thread_pool\n\t\t#\tthread.join\n\t\t#end\n\n\t\t#$global_alternate_size_array << \"XWL4870\"\n\n\n\t\tdef pre_process_alternate_sizes(start, finish)\n\n\t\t\ttemp_i = start\n\t\t\ttemp_x = finish\n\n\t\t\twhile temp_i <= temp_x\n\n\t\t\t\titem_code = \"#{$source.cell(temp_i, $source_dictionary[\"Item Code\"])}\"\n\n\t\t\t\ta = \"#{$source.cell(temp_i, $source_dictionary[\"UDF_ALTS1\"])}\".gsub(' ','')\n\t\t\t\tb = \"#{$source.cell(temp_i, $source_dictionary[\"UDF_ALTS2\"])}\".gsub(' ','')\n\t\t\t\tc = \"#{$source.cell(temp_i, $source_dictionary[\"UDF_ALTS3\"])}\".gsub(' ','')\n\t\t\t\td = \"#{$source.cell(temp_i, $source_dictionary[\"UDF_ALTS4\"])}\".gsub(' ','')\n\t\t\t\t\n\t\t\t\tif !a.blank?\n\t\t\t\t\t\n\t\t\t\t\t$global_alternate_size_array << a\n\t\t\t\tend\n\t\t\t\tif !b.blank?\n\t\t\t\t\n\t\t\t\t\t$global_alternate_size_array << b\n\t\t\t\tend\n\t\t\t\tif !c.blank?\n\t\t\t\t\t\n\t\t\t\t\t$global_alternate_size_array << c\n\t\t\t\tend\n\t\t\t\tif !d.blank?\n\t\t\t\t\t\n\t\t\t\t\t$global_alternate_size_array << d\n\t\t\t\tend\n\n\t\t\t\t# If the current sku is an alternate size of a sku we have already met, then skip it and go to the next item number\n\t\t\t\tif ($global_alternate_size_array.include?(item_code))\n\t\t\t\t\t\n\t\t\t\t\tp item_code + \" already scanned.\"\n\n\t\t\t\t\t$global_alternate_size_array << item_code\n\t\t\t\tend\n\n\t\t\t\ttemp_i = temp_i + 1\n\n\t\t\tend\n\t\tend\n\n\n\t\tpre_process_alternate_sizes(2, 14400)\n\n\t\tt1 = Thread.new{parallel_write(14402, $source.last_row)}\n\t\t#t1 = Thread.new{parallel_write(2, 10)}\n\t\t#t1 = Thread.new{parallel_write(9020, 9030)}\n\t\t#t1 = Thread.new{parallel_write(2, 51)}\n\t\t#t2 = Thread.new{parallel_write(52, 101)}\n\t\t#t3 = Thread.new{parallel_write(102, 151)}\n\t\t#t4 = Thread.new{parallel_write(152, 201)}\n\n\t\tt1.join\n\t\t#t2.join\n\t\t#t3.join\n\t\t#t4.join\n\n\t\tputs \"The overall running time has been #{Time.now - $beginning} seconds.\"\n\n\t\t# Accessing this view launch the service automatically\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\tend\n\n\tend", "def a2Parse(eventNumsArray, bandsArray)\n\n # MOVE TO TEMP_A2\n mvDirA2()\n\n # COLLECTS FILE(S) WITH .XLSX FORMAT (SHOULD ONLY BE ONE) IN ORDER TO PARSE IT\n fileNamesArray = []\n fileNamesArray = Dir[\"./*.xlsx\"]\n\n i = 0\n bandNum = 0\n while i < eventNumsArray.length\n workbookB7first = RubyXL::Parser.parse(\"#{fileNamesArray[0]}\")\n \n # DEFINES WORKBOOK AS WORKSHEET (DONT DELETE)\n worksheet = workbookB7first[0]\n \n # ASSIGNS BAND OBJECT FROM ARRAY OF BANDS\n band = bandsArray[i]\n \n bandNumber = eventNumsArray[bandNum]\n parserA2(bandNumber, band, worksheet)\n resultsA2(band.eventName, band, worksheet)\n i += 1\n bandNum += 1\n end\nend", "def index\n @excels = Excel.all\n end", "def process_excel_project(filename, output_path)\n analyses = OpenStudio::Analysis.from_excel(filename)\n if analyses.size != 1\n puts 'ERROR: EXCEL-PROJECT -- More than one seed model specified. This feature is deprecated'.red\n fail 1\n end\n analysis = analyses.first\n analysis.save \"#{output_path}.json\"\n analysis.save_zip \"#{output_path}.zip\"\n\n OpenStudio::Analysis.aws_instance_options(filename)\nend", "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n # get sql, model, and web assets\n setup = OsLib_Reporting.setup(runner)\n unless setup\n return false\n end\n model = setup[:model]\n # workspace = setup[:workspace]\n sql_file = setup[:sqlFile]\n web_asset_path = setup[:web_asset_path]\n\n # assign the user inputs to variables\n args = OsLib_HelperMethods.createRunVariables(runner, model, user_arguments, arguments)\n unless args\n return false\n end\n\n # reporting final condition\n runner.registerInitialCondition('Gathering data from EnergyPlus SQL file and OSM model.')\n\n # create a array of sections to loop through in erb file\n @sections = []\n # check units of tabular E+ results\n column_units_query = \"SELECT DISTINCT units FROM tabulardatawithstrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' and TableName='Building Area'\"\n energy_plus_area_units = sql_file.execAndReturnVectorOfString(column_units_query)\n if energy_plus_area_units.is_initialized\n if energy_plus_area_units.get.empty?\n runner.registerError(\"Can't find any contents in Building Area Table to get tabular units. Measure can't run\")\n return false\n end\n else\n runner.registerError(\"Can't find Building Area to get tabular units. Measure can't run\")\n return false\n end\n \n begin\n runner.registerValue('standards_gem_version', OpenstudioStandards::VERSION)\n rescue\n end\n begin\n runner.registerValue('workflow_gem_version', OpenStudio::Workflow::VERSION)\n rescue\n end\n \n if energy_plus_area_units.get.first.to_s == 'm2'\n\n # generate data for requested sections\n sections_made = 0\n possible_sections.each do |method_name|\n begin\n next unless args[method_name]\n section = false\n eval(\"section = OsLib_Reporting.#{method_name}(model,sql_file,runner,false)\")\n display_name = eval(\"OsLib_Reporting.#{method_name}(nil,nil,nil,true)[:title]\")\n if section\n @sections << section\n sections_made += 1\n # look for emtpy tables and warn if skipped because returned empty\n section[:tables].each do |table|\n if !table\n runner.registerWarning(\"A table in #{display_name} section returned false and was skipped.\")\n section[:messages] = [\"One or more tables in #{display_name} section returned false and was skipped.\"]\n end\n end\n else\n runner.registerWarning(\"#{display_name} section returned false and was skipped.\")\n section = {}\n section[:title] = display_name.to_s\n section[:tables] = []\n section[:messages] = []\n section[:messages] << \"#{display_name} section returned false and was skipped.\"\n @sections << section\n end\n rescue StandardError => e\n display_name = eval(\"OsLib_Reporting.#{method_name}(nil,nil,nil,true)[:title]\")\n if display_name.nil? then display_name == method_name end\n runner.registerWarning(\"#{display_name} section failed and was skipped because: #{e}. Detail on error follows.\")\n runner.registerWarning(e.backtrace.join(\"\\n\").to_s)\n\n # add in section heading with message if section fails\n section = {}\n section[:title] = display_name.to_s\n section[:tables] = []\n section[:messages] = []\n section[:messages] << \"#{display_name} section failed and was skipped because: #{e}. Detail on error follows.\"\n section[:messages] << [e.backtrace.join(\"\\n\").to_s]\n @sections << section\n end\n end\n\n else\n wrong_tabular_units_string = 'IP units were provided, SI units were expected. Leave EnergyPlus tabular results in SI units to run this report.'\n runner.registerWarning(wrong_tabular_units_string)\n section = {}\n section[:title] = 'Tabular EnergyPlus results provided in wrong units.'\n section[:tables] = []\n section[:messages] = []\n section[:messages] << wrong_tabular_units_string\n @sections << section\n end\n\n # read in template\n html_in_path = \"#{File.dirname(__FILE__)}/resources/report.html.erb\"\n if File.exist?(html_in_path)\n html_in_path = html_in_path\n else\n html_in_path = \"#{File.dirname(__FILE__)}/report.html.erb\"\n end\n html_in = ''\n File.open(html_in_path, 'r') do |file|\n html_in = file.read\n end\n\n # configure template with variable values\n renderer = ERB.new(html_in)\n html_out = renderer.result(binding)\n\n # write html file\n html_out_path = './report.html'\n File.open(html_out_path, 'w') do |file|\n file << html_out\n # make sure data is written to the disk one way or the other\n begin\n file.fsync\n rescue StandardError\n file.flush\n end\n end\n\n # adding additional runner.registerValues needed for project scripts in 2.x PAT\n # note: these are not in begin rescue like individual sections. Won't fail gracefully if any SQL query's can't be found\n\n # annual_peak_electric_demand\n annual_peak_electric_demand_k_query = \"SELECT Value FROM tabulardatawithstrings WHERE ReportName='DemandEndUseComponentsSummary' and ReportForString='Entire Facility' and TableName='End Uses' and RowName= 'Total End Uses' and ColumnName='Electricity' and Units='W'\"\n annual_peak_electric_demand_kw = OpenStudio.convert(sql_file.execAndReturnFirstDouble(annual_peak_electric_demand_k_query).get, 'W', 'kW').get\n runner.registerValue('annual_peak_electric_demand', annual_peak_electric_demand_kw, 'kW')\n\n # get base year for use in first_year_cap_cost\n baseYrString_query = \"SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' and ReportForString='Entire Facility' and TableName='Life-Cycle Cost Parameters' and RowName= 'Base Date' and ColumnName= 'Value'\"\n baseYrString = sql_file.execAndReturnFirstString(baseYrString_query).get\n # get first_year_cap_cost\n first_year_cap_cost_query = \"SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' and ReportForString='Entire Facility' and TableName='Capital Cash Flow by Category (Without Escalation)' and RowName= '#{baseYrString}' and ColumnName= 'Total'\"\n first_year_cap_cost = sql_file.execAndReturnFirstDouble(first_year_cap_cost_query).get\n runner.registerValue('first_year_capital_cost', first_year_cap_cost, '$')\n\n # annual_utility_cost\n annual_utility_cost = sql_file.annualTotalUtilityCost\n if annual_utility_cost.is_initialized\n runner.registerValue('annual_utility_cost', annual_utility_cost.get, '$')\n else\n runner.registerValue('annual_utility_cost', 0.0, '$')\n end\n\n # total_lifecycle_cost\n total_lifecycle_cost_query = \"SELECT Value FROM tabulardatawithstrings WHERE ReportName='Life-Cycle Cost Report' and ReportForString='Entire Facility' and TableName='Present Value by Year' and RowName= 'TOTAL' and ColumnName= 'Present Value of Costs'\"\n runner.registerValue('total_lifecycle_cost', sql_file.execAndReturnFirstDouble(total_lifecycle_cost_query).get, '$')\n\n # closing the sql file\n sql_file.close\n\n # reporting final condition\n runner.registerFinalCondition(\"Generated report with #{sections_made} sections to #{html_out_path}.\")\n\n true\n end", "def perform(report)\n generate_excel_file(report)\n end", "def analtsisExcel(excel)\r\n\t\tworkbook = nil\r\n\t\tif (ARGV[0] == nil)\r\n\t\t\tbegin\r\n\t\t\t\tputs \"Please input excel file path:\"\r\n\t\t\t\tfilePath = gets\r\n\t\t\t\tworkbook =excel.Workbooks.Open(filePath)\r\n\t\t\trescue Exception\r\n\t\t\t\tputs \"something is error, please try agin\"\r\n\t\t\t\texit()\r\n\t\t\telse\r\n\t\t\t\tputs \"found file succee, start...\"\r\n\t\t\tensure\r\n\t\t\t\tif workbook == nil\r\n\t\t\t\t\tworkbook.close\r\n\t\t\t\t\texcel.Quit #close excel stream\r\n\t\t\t\t\texit()\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\telse\r\n\t\t\tworkbook = excel.Workbooks.Open(ARGV[0])\r\n\t\tend\r\n\t\treturn workbook\r\n\tend", "def output\n File.read(result_xlsx)\n end", "def perform(xlsx_file)\n Solution.destroy_all\n\n xlsx = Roo::Spreadsheet.open(xlsx_file)\n xlsx.default_sheet = xlsx.sheets[1]\n\n (3..xlsx.last_row).each do |row|\n record = xlsx.row(row)\n\n # attributes with _ are pending\n solution = Solution.create(\n number: record[0],\n # _sector: record[1],\n # _subsector: record[2],\n title: record[3],\n description: record[4],\n solution_of: solution_of_helper(record[5]),\n guiding_public_policies: record[6],\n technical_references: record[7],\n examples_of_municipal_application: record[8],\n applicable_regions: applicable_regions_helper(record[9]),\n applicable_population_ranges: applicable_population_ranges_helper(record[10]),\n fundamental_sector: fundamental_sector_helper(record[11]),\n impact_on_emissions: impact_on_emissions_helper(record[12]),\n action_category: record[13],\n sustainable_development_goals: sustainable_development_goals_helper(record[14]),\n environmental_cobenefits: record[15],\n social_cobenefits: record[16],\n economic_cobenefits: record[17],\n sphere: sphere_helper(record[18]),\n municipal_operating_mode: record[19],\n alignment_with_ndc: record[20],\n necessary_investment: record[21],\n financing: record[22],\n key_actors: record[23],\n challenges: record[24],\n implementation_time: record[25]\n )\n end\n end", "def generate_excel(technical=false)\n @package = Axlsx::Package.new\n wb = @package.workbook\n @blue_cell = wb.styles.add_style :fg_color => \"0000FF\", :sz => 12, :alignment => { :horizontal=> :center }\n @wrap_text= wb.styles.add_style({:alignment => {:horizontal => :left, :vertical => :top, :wrap_text => true}} )\n add_canonical_documents(wb, technical)\n\n end", "def store_yardi_summary_files\n doc = Document.find_by_id(@options[:doc_id])\n period = ''\n date_err = false\n month = year = nil\n get_all_sheets.each do |sheet|\n if !read_via_numeral_abs(1, 1, sheet).blank? and read_via_numeral_abs(1, 1, sheet).downcase == 'boxscore summary'\n unless read_via_numeral_abs(3, 1, sheet).blank?\n dts = read_via_numeral_abs(3, 1, sheet).split(' = ').last.split('-')\n begin\n dts[0] = dts[0].to_date\n dts[1] = dts[1].to_date\n rescue\n date_err = true\n end\n unless date_err\n if dts[0] < dts[1] && dts[0].month == dts[1].month && (dts[1] - dts[0]).to_i > 27 && dts[1].year == dts[0].year\n month = dts[0].month\n year = dts[0].year\n period = 'year'\n elsif dts[0] < dts[1] && (dts[1] - dts[0]).to_i == 6\n period = 'weekly'\n else\n period = 'quit'\n doc.update_attribute('parsing_done',false)\n end\n end\n end\n if period == 'year'\n 6.upto find_last_base_cell(sheet) do |row|\n if read_via_numeral_abs(row, 1, sheet).blank? and !read_via_numeral_abs(row, 2, sheet).blank? and read_via_numeral_abs(row, 2, sheet).strip == 'Total'\n property_occupancy_summary = PropertyOccupancySummary.find_or_create_by_real_estate_property_id_and_year_and_month(doc.real_estate_property_id, year, month)\n property_occupancy_summary.total_building_rentable_s = read_via_numeral_abs(row, 3, sheet)\n property_occupancy_summary.current_year_sf_occupied_actual = (property_occupancy_summary.total_building_rentable_s.to_f * (read_via_numeral_abs(row,17,sheet).blank? ? 1 : read_via_numeral_abs(row,17,sheet).to_f)) / 100 rescue 0\n property_occupancy_summary.current_year_sf_vacant_actual = property_occupancy_summary.total_building_rentable_s - property_occupancy_summary.current_year_sf_occupied_actual rescue 0\n property_occupancy_summary.vacant_leased_number = read_via_numeral_abs(row, 7, sheet).blank? ? 0 : read_via_numeral_abs(row, 7, sheet).to_i\n property_occupancy_summary.vacant_leased_percentage = (property_occupancy_summary.vacant_leased_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.currently_vacant_leases_number = property_occupancy_summary.vacant_leased_number + (read_via_numeral_abs(row, 8, sheet).blank? ? 0 : read_via_numeral_abs(row, 8, sheet).to_f)\n property_occupancy_summary.currently_vacant_leases_percentage = ( property_occupancy_summary.currently_vacant_leases_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.occupied_preleased_number = read_via_numeral_abs(row, 9, sheet).blank? ? 0 : read_via_numeral_abs(row, 9, sheet).to_i\n property_occupancy_summary.occupied_preleased_percentage = (property_occupancy_summary.occupied_preleased_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.occupied_on_notice_number = property_occupancy_summary.occupied_preleased_number + (read_via_numeral_abs(row, 10, sheet).blank? ? 0 : read_via_numeral_abs(row, 10, sheet).to_i)\n property_occupancy_summary.occupied_on_notice_percentage = (property_occupancy_summary.occupied_on_notice_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.net_exposure_to_vacancy_number = (property_occupancy_summary.currently_vacant_leases_number - property_occupancy_summary.vacant_leased_number) + (property_occupancy_summary.occupied_on_notice_number - property_occupancy_summary.occupied_preleased_number)\n property_occupancy_summary.net_exposure_to_vacancy_percentage = (property_occupancy_summary.net_exposure_to_vacancy_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.current_year_units_total_actual = read_via_numeral_abs(row, 5, sheet).to_f\n property_occupancy_summary.current_year_units_occupied_actual = (property_occupancy_summary.current_year_units_total_actual.to_f * (read_via_numeral_abs(row,17,sheet).blank? ? 1 : read_via_numeral_abs(row,17,sheet).to_f)) / 100 rescue 0\n property_occupancy_summary.current_year_units_vacant_actual = property_occupancy_summary.current_year_units_total_actual - property_occupancy_summary.current_year_units_occupied_actual rescue 0\n property_occupancy_summary.save\n break\n end\n end if !date_err && month && year && period # check the excel file is valid.\n elsif period == \"weekly\"\n index_hash = {}\n availability, conversion = false, false\n 4.upto find_last_base_cell(sheet) do |row|\n if !read_via_numeral_abs(row, 1, sheet).blank? && [\"Availability\", \"Conversion Ratios\", \"Resident Activity\"].include?(read_via_numeral_abs(row, 1, sheet))\n availability = true if read_via_numeral_abs(row, 1, sheet) == \"Availability\"\n conversion = true if read_via_numeral_abs(row, 1, sheet) == \"Conversion Ratios\"\n elsif read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank? && read_via_numeral_abs(row, 2, sheet) == 'Total'\n availability, conversion = false, false\n elsif !read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank?\n if availability\n index_hash.update({read_via_numeral_abs(row, 1, sheet)=> ''})\n elsif conversion\n index_hash.update({read_via_numeral_abs(row, 1, sheet)=> row}) if index_hash.include? read_via_numeral_abs(row, 1, sheet)\n end\n end\n end\n 4.upto find_last_base_cell(sheet) do |row|\n unless read_via_numeral_abs(row, 1, sheet) == 'Code' && index_hash.include?(read_via_numeral_abs(row, 1, sheet))\n obj = PropertyWeeklyOsr.find_or_initialize_by_real_estate_property_id_and_floor_plan_and_time_period(doc.real_estate_property_id, read_via_numeral_abs(row, 1, sheet),dts[1].strftime(\"%Y-%m-%d\"))\n obj.user_id = doc.user_id\n obj.units = read_via_numeral_abs(row, 5, sheet)\n obj.prelsd = read_via_numeral_abs(row, 7, sheet).blank? ? 0 : read_via_numeral_abs(row, 7, sheet).to_i\n obj.vacant_total = obj.prelsd + (read_via_numeral_abs(row, 8, sheet).blank? ? 0 : read_via_numeral_abs(row, 8, sheet).to_i)\n obj.prelsd2 = read_via_numeral_abs(row, 9, sheet).blank? ? 0 : read_via_numeral_abs(row, 9, sheet).to_i\n obj.ntv_status_total = obj.prelsd2 + (read_via_numeral_abs(row, 10, sheet).blank? ? 0 : read_via_numeral_abs(row, 10, sheet).to_i)\n obj.current = obj.vacant_total + obj.ntv_status_total\n obj.pi_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 3, sheet)\n obj.wi_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 4, sheet)\n obj.dep_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 9, sheet)\n obj.dep_rej = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 14, sheet)\n obj.dep_canc = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 15, sheet)\n obj.save\n end if !read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank?\n break if read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank? && read_via_numeral_abs(row, 2, sheet) == 'Total'\n end unless index_hash.empty?\n end\n end\n end\n end", "def parse_upload\n\t@worksheet = (params[:uploaded_doc][:workbook])\n \t@file_path = [Rails.root, 'public', 'upload', @worksheet.original_filename].join('/')\n\t@worksheet_class = (params[:uploaded_doc][:workbook]).class\n\t@worksheet_type = (params[:uploaded_doc][:workbook]).content_type\n\t@worksheet_name = (params[:uploaded_doc][:workbook]).original_filename \n\tFile.open(Rails.root.join('public', 'uploads', @worksheet.original_filename), 'r') do |file|\n\t\t@worksheet_array << file.gets \n\tend\n=begin\t@worksheet_array = RubyXL::Parser.parse(params[:uploaded_doc][:workbook]).worksheets[0].extract_data\n \t@worksheet = RubyXL::Parser.parse(Rails.root.join('public', 'uploads', (params[:uploaded_doc][:workbook]).original_filename , 'w'))#.worksheets[0].extract_data\n\tFile.open(Rails.root.join('public', 'uploads', @worksheet.original_filename), 'r') do |file|\n\t\t@worksheet_array << file.gets \n\tend\n\n=end\n end", "def validate\n puts \"Validating input file #{@filename}...\\n\\n\"\n # Generates sheet object\n @sheet = spreadsheet\n # Check that all required headers are present\n validate_header\n # Parse data columns based on headers\n @rows = @sheet.parse(sequence: 'sequence', root: 'root', druid: 'druid').drop(1)\n # Hash\n @root_sequence = {}\n # Array to hold errors\n @errors = []\n check_empty_and_integer\n check_sequence\n # If no errors, returns sheet object\n puts \"Validation successful\\n\\n\"\n @sheet\n end", "def build\r\n\t \tbuffer = \"\"\r\n\t\t xml = Builder::XmlMarkup.new(buffer)\r\n\t\t xml.instruct! :xml, :version=>\"1.0\", :encoding=>\"UTF-8\" \r\n\t\t xml.Workbook({\r\n\t\t 'xmlns' => \"urn:schemas-microsoft-com:office:spreadsheet\", \r\n\t\t 'xmlns:o' => \"urn:schemas-microsoft-com:office:office\",\r\n\t\t 'xmlns:x' => \"urn:schemas-microsoft-com:office:excel\", \r\n\t\t 'xmlns:html' => \"http://www.w3.org/TR/REC-html40\",\r\n\t\t 'xmlns:ss' => \"urn:schemas-microsoft-com:office:spreadsheet\" \r\n\t\t }) do\r\n\t \r\n\t\t\t xml.Styles do\r\n\t\t\t xml.Style 'ss:ID' => 'Default', 'ss:Name' => 'Normal' do\r\n\t\t\t xml.Alignment 'ss:Vertical' => 'Bottom'\r\n\t\t\t xml.Borders\r\n\t\t\t xml.Font 'ss:FontName' => 'Arial'\r\n\t\t\t xml.Interior\r\n\t\t\t xml.NumberFormat\r\n\t\t\t xml.Protection\r\n\t\t\t end\r\n\t\t\t \r\n\t\t\t xml.Style 'ss:ID' => 'DefaultBold' do\r\n\t\t\t xml.Font 'ss:Bold' => '1'\r\n\t\t end\r\n\t\t\t \r\n\t\t\t xml.Style 'ss:ID' => 'Date' do\r\n\t\t\t xml.NumberFormat 'ss:Format' => 'mm/dd/yy'\r\n\t\t\t end\r\n\r\n\t\t\t xml.Style 'ss:ID' => 'DateBold' do\r\n\t\t\t xml.NumberFormat 'ss:Format' => 'mm/dd/yy'\r\n\t\t\t xml.Font 'ss:Bold' => '1'\r\n\t\t\t end\r\n\t\t\t \r\n\t\t\t xml.Style 'ss:ID' => 'Currency' do\r\n\t\t\t xml.NumberFormat 'ss:Format' => '\"$\"#,##0.00'\r\n\t\t\t end\t\t\t \r\n\r\n\t\t\t xml.Style 'ss:ID' => 'CurrencyBold' do\r\n\t\t\t xml.NumberFormat 'ss:Format' => '\"$\"#,##0.00'\r\n\t\t\t xml.Font 'ss:Bold' => '1'\r\n\t\t\t end\t\t\t \r\n\t\t\t end\r\n\t\t\t \r\n\t\t\t for object in @worksheets\r\n\t\t \t\t# use the << operator to prevent the < > and & characters from being converted.\r\n\t\t \t\t# this will concat them together.\r\n\t\t \t\tif object[1] =='array'\r\n\t\t \t\t xml << worksheetFromArray(object[0], object[2])\r\n\t elsif object[1]=='table'\r\n\t xml << worksheetFromTable(object[0], object[2])\r\n\t else\r\n\t xml << worksheet(object[0], object[1], object[2])\r\n\t end\r\n\t\t\t end # for records\r\n\t\t\t end\r\n\t\t\t \r\n\t return xml.target! \r\n\t end", "def initialize(workbook, name, index, encoding)\n super()\n\n @workbook = workbook\n @name = name\n @index = index\n @encoding = encoding\n\n @url_format = @workbook.url_format\n @parser = @workbook.parser\n @tempdir = @workbook.tempdir\n @date_1904 = @workbook.date_1904\n @compatibility = @workbook.compatibility\n @str_table = @workbook.str_table\n\n @table = []\n @row_data = {}\n\n @type = 0x0000\n @ext_sheets = []\n @fileclosed = false\n @offset = 0\n @xls_rowmax = RowMax\n @xls_colmax = ColMax\n @xls_strmax = StrMax\n @dim_rowmin = nil\n @dim_rowmax = nil\n @dim_colmin = nil\n @dim_colmax = nil\n @colinfo = []\n @selection = [0, 0]\n @panes = []\n @active_pane = 3\n @frozen = 0\n @frozen_no_split = 1\n @selected = 0\n @hidden = 0\n @active = 0\n @tab_color = 0\n\n @first_row = 0\n @first_col = 0\n @display_formulas = 0\n @display_headers = 1\n @display_zeros = 1\n @display_arabic = 0\n\n @paper_size = 0x0\n @orientation = 0x1\n @header = ''\n @footer = ''\n @header_encoding = 0\n @footer_encoding = 0\n @hcenter = 0\n @vcenter = 0\n @margin_header = 0.50\n @margin_footer = 0.50\n @margin_left = 0.75\n @margin_right = 0.75\n @margin_top = 1.00\n @margin_bottom = 1.00\n\n @title_rowmin = nil\n @title_rowmax = nil\n @title_colmin = nil\n @title_colmax = nil\n @print_rowmin = nil\n @print_rowmax = nil\n @print_colmin = nil\n @print_colmax = nil\n\n @print_gridlines = 1\n @screen_gridlines = 1\n @print_headers = 0\n\n @page_order = 0\n @black_white = 0\n @draft_quality = 0\n @print_comments = 0\n @page_start = 1\n @custom_start = 0\n\n @fit_page = 0\n @fit_width = 0\n @fit_height = 0\n\n @hbreaks = []\n @vbreaks = []\n\n @protect = 0\n @password = nil\n\n @col_sizes = {}\n @row_sizes = {}\n\n @col_formats = {}\n @row_formats = {}\n\n @zoom = 100\n @print_scale = 100\n @page_view = 0\n\n @leading_zeros = false\n\n @outline_row_level = 0\n @outline_style = 0\n @outline_below = 1\n @outline_right = 1\n @outline_on = 1\n\n @write_match = []\n\n @object_ids = []\n @images = {}\n @images_array = []\n @charts = {}\n @charts_array = []\n @comments = {}\n @comments_array = []\n @comments_author = ''\n @comments_author_enc = 0\n @comments_visible = 0\n\n @num_images = 0\n @image_mso_size = 0\n\n @filter_area = []\n @filter_count = 0\n @filter_on = 0\n @filter_cols = []\n\n @writing_url = 0\n\n @db_indices = []\n\n @validations = []\n end", "def parse(options={})\n @sheets.each do |x|\n if !options[:paginate].nil?\n lines = options[:paginate][0]; page = options[:paginate][1]\n sheet = PagSheet.new(lines, page)\n elsif !options[:cellrange].nil?\n range = options[:cellrange]\n sheet = Cellrange.new(range)\n else\n sheet = Xlsheet.new()\n end\n\n File.open(@destination+\"/xl/#{x[:filename]}\", 'r') do |f|\n Ox.sax_parse(sheet, f)\n end\n comments = mkcomments(x[:comments])\n sheet.cellarray.each do |sh|\n sh.numformat = @styles.styleary[sh.style.to_i]\n if sh.type==\"s\"\n sh.value = @sharedstrings[sh.value.to_i]\n end\n if !comments.nil?\n comm=comments.select {|c| c[:ref]==(sh.xlcoords)}\n if comm.size > 0\n sh.comment=comm[0][:comment]\n end\n comments.delete_if{|c| c[:ref]==(sh.xlcoords)}\n end\n end\n x[:cells] = sheet.cellarray\n x[:mergedcells] = sheet.mergedcells\n end\n matrixto options\n end", "def readInfo(expFileName)\n puts \"[readInfo] going to open sheet\"\n #openoffice.default_sheet = openoffice.sheets[1]\n #puts \"[readInfo] #{openoffice.default_sheet.to_s}\"\n expMap = {}\n CSV.foreach(File.path(expFileName+\"_WORDSPOTINFOEXP.csv\"),:headers => true) do |col|\n filename = col[1].to_s()#openoffice.cell(i, 'B').to_s()\n break if filename.empty?\n expMap[filename]=Spnt::Exp::Data::ExpInfoResult.new(filename)\n expMap[filename].processedTime=col[2].to_i()#openoffice.cell(i, 'C').to_i()\n expMap[filename].audioLength=col[5].to_i()#openoffice.cell(i, 'F').to_i()\n #puts \"[readInfo] #{filename}: #{expMap[filename].processedTime}\"\n end\n\n # (2..10000).each { |i|\n # start = Time.now.to_f\n # aRow = openoffice.row(i)\n # puts \"[readInfo] seeking #{i} aRow: #{}\"\n # filename = aRow[1].to_s()#openoffice.cell(i, 'B').to_s()\n # break if filename.empty?\n # expMap[filename]=Spnt::Exp::Data::ExpInfoResult.new(filename)\n # expMap[filename].processedTime=aRow[2].to_i()#openoffice.cell(i, 'C').to_i()\n # expMap[filename].audioLength==aRow[5].to_i()#openoffice.cell(i, 'F').to_i()\n #\n # }\n expMap\n end", "def compareExcel\n p \"hola\"\nend", "def open_spreadsheet(file)\n case File.extname(file.original_filename)\n when \".csv\" then Roo::Csv.new(file.path, file_warning: :ignore)\n when \".xls\" then Roo::Excel.new(file.path, file_warning: :ignore)\n when \".xlsx\" then Roo::Excelx.new(file.path, file_warning: :ignore)\n when \".ods\" then Roo::OpenOffice.new(file.path, file_warning: :ignore)\n else raise \"Unknown file type: #{file.original_filename}\"\n end\n end", "def read_excel_file(file_loc)\r\n file_loc = file_exists(file_loc)\r\n $excel_file = file_exists(file_loc)\r\n puts \"=====#{@excel_file}\"\r\n workbook = RubyXL::Parser.parse(file_loc)\r\n workbook.worksheets.count.times do |k|\r\n @test_data = {}\r\n convert_excel_to_yml(workbook[k])\r\n write_to_file(workbook[k], file_loc)\r\n end\r\n end", "def excel2mysql\n moas_file_param = params[:excel_file]\n catalog_file_param = params[:excel_catalog_file]\n ymal_file_param = params[:excel_ymal_file]\n language = params[:language]\n table = language == 'english' ? 'atg_moas' : 'atg_moas_fr'\n\n # initial AtgMoasImporting\n atg_import = AtgMoasImporting.new table\n\n # get temporary path of uploaded files\n path = File.join(Dir.tmpdir, \"#{File.basename(Rails.root.to_s)}_#{Time.now.to_i}_#{rand(100)}\")\n Dir.mkdir(path)\n\n # upload file\n moas_file_name = moas_file_param.blank? ? false : ModelCommon.upload_file(path, moas_file_param)\n catalog_file_name = catalog_file_param.blank? ? false : ModelCommon.upload_file(path, catalog_file_param)\n ymal_file_name = ymal_file_param.blank? ? false : ModelCommon.upload_file(path, ymal_file_param)\n\n # import to mysql\n if moas_file_name || catalog_file_name || ymal_file_name\n moas_file = File.join(path, moas_file_name) if moas_file_name\n catalog_file = File.join(path, catalog_file_name) if catalog_file_name\n ymal_file = File.join(path, ymal_file_name) if ymal_file_name\n @message = atg_import.import_atg_data moas_file, catalog_file, ymal_file, language\n else\n @message = '<p class=\"alert alert-error\">Please select correct .xls/.xlsx file</p>'\n end\n\n FileUtils.rm_rf(path)\n\n render 'index'\n end", "def method_missing(method, *args, &block)\n if ExcelToolsMethods.include?( method )\n require_relative 'rubyexcel/excel_tools.rb'\n send( method, *args, &block )\n else\n super\n end\n end", "def open_spreadsheet\r\n case File.extname(file.original_filename)\r\n when \".csv\" then\r\n Roo::Csv.new(file.path, nil, :ignore)\r\n when \".xls\" then\r\n Roo::Excel.new(file.path, nil, :ignore)\r\n when \".xlsx\" then\r\n Roo::Excelx.new(file.path, nil, :ignore)\r\n else\r\n raise \"Unknown file type: #{file.original_filename}\"\r\n end\r\n end", "def extract_data_from_workbook\n extract_shared_strings\n extract_named_references\n extract_worksheet_names\n extract_dimensions_from_worksheets\n end", "def run\n @options[:hmes_frags] = File.expand_path @options[:hmes_frags]\n @options[:bfr_frags] = File.expand_path @options[:bfr_frags]\n analysis = Implementer.new(@options)\n analysis.run\n end", "def main\n operations.each { |op|\n template = [['sample: Sample Name', '', '', '', ''],['title: Title 1', 'title 1\\'s step 1', 'title 1\\'s step 2','title: Title n', '...'],['Ingredient 1', 'Ingredient 1\\'s quantity', 'Ingredient k', 'Ingredient k\\'s quantity', '...']]\n show {\n title \"File format (csv)\"\n table template\n }\n \n ups = upload_file\n if ups.nil?\n show { note \"No files found...\"}\n return\n end\n\n file = ups[0]\n data = read_url(file)\n \n # Remove nils from the data array.\n remove_data_nils data\n \n if(data.empty?)\n show { note \"no data, returning...\" } \n return\n end\n \n # Look through data for duplicates\n create_samples data\n \n }\n end", "def compute_simple_stats(workbook)\n data_sheet = workbook[configuration.data_sheet_name]\n puts \"Data sheet loaded for '#{configuration.data_sheet_name}': computing simple stats...\"\n\n current_column = configuration.data_column_idx\n header_string = Helper.cell_value data_sheet, configuration.data_row_idx, current_column\n\n start_row_index = current_row = find_data_series_start data_sheet, configuration.data_row_idx + 1, current_column\n columns_count = find_colums_extent data_sheet, configuration.data_row_idx, configuration.data_column_idx\n @data_samples_count = find_data_series_extent data_sheet, start_row_index, configuration.data_column_idx, columns_count\n\n puts \"Data extent indexes row #{start_row_index} -- col #{configuration.data_column_idx} to row #{start_row_index + @data_samples_count} -- col #{configuration.data_column_idx + columns_count}\"\n\n (configuration.data_column_idx..configuration.data_column_idx + columns_count).each_with_index do |col_idx|\n header_string = Helper.cell_value data_sheet, configuration.data_row_idx, col_idx\n puts \"Processing column #{header_string}\"\n\n (start_row_index..start_row_index + @data_samples_count - 1).each_with_index do |row_idx|\n rules = configuration.rules[header_string]\n\n cell_value = Helper.cell_value data_sheet, row_idx, col_idx\n compute_simple_stats_for_cell cell_value, row_idx, header_string, rules unless rules.nil?\n end\n\n header_string = Helper.cell_value data_sheet, configuration.data_row_idx, current_column\n end\n\n puts 'Simple stats computed'\n end", "def readSample(expFileName)\n #openoffice.default_sheet = openoffice.sheets[2]\n #puts openoffice.default_sheet.to_s\n file_WORDSPOTSAMPLEEXP = File.path(expFileName+\"_WORDSPOTSAMPLEEXP.csv\")\n puts \"[readSample] started: #{file_WORDSPOTSAMPLEEXP}\"\n #sheet = openoffice.sheets[2]\n sampleMapByKey = {}\n CSV.foreach(file_WORDSPOTSAMPLEEXP,:headers => true) do |col|\n ekey = col[1].to_s()#B\n break if ekey.empty?\n sampleElement =Spnt::Exp::Data::ExpFoundResult.new(ekey)\n sampleElement.id = col[0].to_i()#A\n sampleElement.filename = col[2].to_s()#C\n sampleElement.label = col[3].to_s()#D\n sampleElement.shouldStart = col[4].to_i()#E\n sampleElement.shouldEnd = col[5].to_i()#F\n sampleMapByKey[ekey] = sampleElement\n end\n\n # (2..10000).each { |i|\n # ekey = openoffice.cell(i, 'B').to_s()\n # break if ekey.empty?\n # sampleElement =Spnt::Exp::Data::ExpFoundResult.new(ekey)\n # sampleElement.id = openoffice.cell(i, 'A').to_i()\n # sampleElement.filename = openoffice.cell(i, 'C').to_s()\n # sampleElement.label = openoffice.cell(i, 'D').to_s()\n # sampleElement.shouldStart = openoffice.cell(i, 'E').to_i()\n # sampleElement.shouldEnd = openoffice.cell(i, 'F').to_i()\n # sampleMapByKey[ekey] = sampleElement\n # puts \"[readSample] done #{i}: #{ekey}\"\n # }\n sampleMapByKey\n end", "def parse_ri_goals_xls(path_to_xls)\n spreadsheet = Spreadsheet.open path_to_xls\n sheet = spreadsheet.worksheet 'Science'\n domain_regex = @domains.keys.join(\"|\")\n regex = /(#{domain_regex})(\\d+)\\(([K|0-9]\\s*[-|#{EMDASH}]\\s*[K|0-9]+)\\)\\s*[-|#{EMDASH}]\\s*([0-9]+)([a-b])(.+)/\n sheet.each do |row| \n if (row[1])\n begin\n matches = (row[1]).match(regex) # we are only after column #2\n if (matches) # PS3(9-11)-10b Comparing and contrasting electromagnetic waves to mechanical waves.\n (domain_key,someNumber,grade_span,target_number,expectaton_ordinal,description) = matches.captures\n if (domain_key)\n if (domain_key !=\"PS\") # we already have all of these\n expectation = RiGse::Expectation.new(:description => description, :ordinal => expectaton_ordinal)\n expectation.save\n end\n end\n end\n rescue\n logger.warn \"problem reading #{row} / #{sheet}\"\n end\n end\n end\n end", "def get_excel_content(file, sheet_name, type)\n excel = (type == 'xlsx') ? Roo::Excelx.new(file.path) : Roo::Excel.new(file.path)\n excel.default_sheet = sheet_name unless sheet_name.nil?\n content = excel.to_csv\n end", "def create\n\t\t@analyzer = Analyzer.new\n\t\t@files = []\n\t\t@rows = []\n @metrics = []\n @qty_components_type = {:model => 0, :controller => 0, :view => 0, :multi_type => 0}\n\t\t#@analyzer = Analyzer.new(analyzer_params)\n\t\t\n\t\tparam_scripts = params[:analyzer][:scripts].reject(&:blank?) unless params[:analyzer].nil?\n\t\t\n\t\t#puts YAML::dump(params[:images])\n\t\t#Realizar un try catch pra la lectura de los archivos temporales.\n\t\tif !param_scripts.nil?\n\t\t\t\t \n\t\t\t\t\tparams[:analyzer][:scripts].each { |script|\n\t\t\t\t\t\t#@fichero = script.read \n\t\t\t\t\t\t\tex_file = script.content_type.split(\"/\")\n\t\t\t\t\t\t\tfile = script.read\n\t\t\t\t\t\t\tfile_name = script.original_filename\n file_path = script.tempfile.path\n file_original_path = find_original_path(script.headers)\n\t\t\t\t\t\t\tscript = script.open()\n\t\t\t\t\t\t\tscript.each do | lines |\n\t\t\t\t\t\t\t\t@rows.push(lines)\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t#puts ex_file[1]\n\t\t\t\t\t\t\t#puts file\n if (ex_file[1] == \"x-php\")\n @analyzed_metrics = MetricAnalyzer.new.analyze_metrics(file_path, file_original_path)\n end\n\t\t\t\t\t\t\tif (ex_file[1] == \"x-php\") || (ex_file[1] == \"html\")\n\t\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t\tsections = MVCEngine.new.getSections(file.downcase,@rows,file_original_path) #creo que es más preciso indicar la ruta completa por si hay casos donde haya archivos con el mismo nombre pero en distintas subcarpetas del proyecto\n self.getStadistics(sections)\n\n (!@analyzed_metrics.nil? && !@analyzed_metrics.empty?)? \n sections[:metrics] = @analyzed_metrics : \n FALSE # generar algún mensaje cuando no hay métricas para ese archivo\n\t\t\t\t\t\t\t\t\t@files.push(sections)\n\t\t\t\t\t\t\t\trescue => e\n\t\t\t\t\t\t\t\t\tputs \"se ha producido una excepcion. ------>\"+file_name.to_s\n pp e.to_s\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tif ex_file[1] == \"x-trash\"\n\t\t\t\t\t\t\t\t\tflash[:notice] = 'El archivo #{file_name} que se ingresado se encuentra abierto y se esta editando.'\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t@rows = []\n\t\t\t\t\t}\n\t\telse\n\t\t\tflash[:notice] = 'El directorio que se ha ingresado no contiene archivos para analizar.'\n\t\t\trender 'new'\n\t\t\treturn\n\t\tend\n\t\t$stadistics = @qty_components_type\n\t\t$results = @files\n\t\trespond_to do |format|\n\t\t\tif @files.nil?\n\t\t\t\tformat.html { redirect_to @analyzer, notice: 'Se ha analizado con éxito todos sus archivos' }\n\t\t\t\tformat.json { render :new, status: :created, location: @analyzer }\n\t\t\telse\n\t\t\t\tformat.html { render :show }\n\t\t\t\tformat.json { render json: @analyzer.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def perform_load( _options = {} )\n require 'csv'\n\n raise \"Cannot load - failed to create a #{klass}\" unless load_object\n\n logger.info \"Starting bulk load from CSV : #{file_name}\"\n\n # TODO: - can we abstract out what a 'parsed file' is - headers plus value of each node\n # so a common object can represent excel,csv etc\n # then we can make load() more generic\n\n parsed_file = CSV.read(file_name)\n\n # assume headers are row 0\n header_idx = 0\n header_row = parsed_file.shift\n\n set_headers( DataShift::Headers.new(:csv, header_idx, header_row) )\n\n # maps list of headers into suitable calls on the Active Record class\n bind_headers(headers)\n\n begin\n puts 'Dummy Run - Changes will be rolled back' if(DataShift::Configuration.call.dummy_run)\n\n load_object_class.transaction do\n logger.info \"Processing #{parsed_file.size} rows\"\n\n parsed_file.each_with_index do |row, i|\n\n logger.info \"Processing Row #{i} : #{row}\"\n\n # Iterate over the bindings, creating a context from data in associated Excel column\n\n @binder.bindings.each_with_index do |method_binding, i|\n\n unless method_binding.valid?\n logger.warn(\"No binding was found for column (#{i}) [#{method_binding.pp}]\")\n next\n end\n\n # If binding to a column, get the value from the cell (bindings can be to internal methods)\n value = method_binding.index ? row[method_binding.index] : nil\n\n context = doc_context.create_node_context(method_binding, i, value)\n\n logger.info \"Processing Column #{method_binding.index} (#{method_binding.pp})\"\n\n begin\n context.process\n rescue StandardError => x\n if doc_context.all_or_nothing?\n logger.error(\"ERROR at : #{x.backtrace.first.inspect}\")\n logger.error(x.inspect)\n logger.error('Complete Row aborted - All or nothing set and Current Column failed.')\n doc_context.failed!\n end\n end\n end # end of each column(node)\n\n doc_context.reset and next if doc_context.errors?\n\n doc_context.save_and_monitor_progress\n\n doc_context.reset unless doc_context.node_context.next_update?\n end # all rows processed\n\n if(DataShift::Configuration.call.dummy_run)\n puts 'CSV loading stage done - Dummy run so Rolling Back.'\n raise ActiveRecord::Rollback # Don't actually create/upload to DB if we are doing dummy run\n end\n end # TRANSACTION N.B ActiveRecord::Rollback does not propagate outside of the containing transaction block\n rescue StandardError => e\n puts \"ERROR: CSV loading failed : #{e.inspect}\"\n raise e\n ensure\n report\n end\n\n puts 'CSV loading stage Complete.'\n end", "def generate_Excel\r\n @db_list.each{|category,value|\r\n# f = open(file,\"w\")\r\n db_name = value[2]\r\n table = \"historical\"\r\n db = SQLite3::Database.new(\"#{@db_dir}/#{db_name}\")\r\n case db_name\r\n when /eurusd/, /audusd/,/nzdusd/\r\n num = 6\r\n else\r\n num = 4\r\n end\r\n# getCSV(f,db,table,num)\r\n file = \"#{@result_dir}/#{value[0]}\"\r\n printf(\"@I:generate %s\\n\",file)\r\n make_excel(file,db,table,num,100)\r\n file = \"#{@result_dir}/ALL_#{value[0]}\"\r\n printf(\"@I:generate %s\\n\",file)\r\n make_excel(file,db,table,num,nil)\r\n \r\n# f.close\r\n }\r\n=begin\r\n # All days CSV\r\n @db_list.each{|category,value|\r\n file = \"#{@result_dir}/ALL_#{value[0]}\"\r\n printf(\"@I:generate %s\\n\",file)\r\n f = open(file,\"w\")\r\n db_name = value[2]\r\n table = \"historical\"\r\n db = SQLite3::Database.new(\"#{@db_dir}/#{db_name}\")\r\n case db_name\r\n when /eurusd/, /audusd/,/nzdusd/\r\n num = 6\r\n else\r\n num = 4\r\n end\r\n getCSV_all(f,db,table,num)\r\n make_excel(file,db,table,num,nil)\r\n f.close\r\n }\r\n=end\r\n end", "def spreadsheet\n @spreadsheet ||= case File.extname(@filename)\n when '.csv' then Roo::Spreadsheet.open(@filename, extension: :csv)\n when '.xls' then Roo::Spreadsheet.open(@filename, extension: :xls)\n when '.xlsx' then Roo::Spreadsheet.open(@filename, extension: :xlsx)\n else raise \"\\n\\n***Unknown file type: #{@filename} (must be .csv, .xls, or .xlsx)***\\n\\n\"\n end\n end", "def to_excel(opts={})\n asigna_columnas_extra # Para columnas que tienen un grupo de columnas\n xlsx = RubyXL::Workbook.new\n sheet = xlsx[0]\n sheet.sheet_name = 'Resultados'\n fila = 1 # Para no sobreescribir la cabecera\n columna = 0\n\n # cols = if columnas_array.present?\n # columnas_array\n # else\n # columnas.split(',') if columnas.present?\n # end\n\n ordena_columnas\n cols = columnas_array\n\n # Para la cabecera\n cols.each do |a|\n sheet.add_cell(0,columna,I18n.t(\"listas_columnas.generales.#{a}\", default: I18n.t(\"listas_columnas.categorias.#{a}\", default: a)))\n columna+= 1\n end\n\n # Elimina las 3 primeras, para que no trate de evaluarlas mas abajo\n cols.slice!(0..2) if opts[:asignar]\n\n if opts[:es_busqueda] # Busqueda basica o avanzada\n r = Especie.find_by_sql(opts[:busqueda])\n datos_descarga(r)\n elsif opts[:region] # Descarga taxa de la busqueda por region\n self.hash_especies = opts[:hash_especies]\n r = Especie.select_basico.left_joins(:categoria_taxonomica, :adicional, :scat).where(\"#{Scat.attribute_alias(:catalogo_id)} IN (?)\", hash_especies.keys).includes(:tipos_distribuciones, :catalogos, :adicional, :nombres_comunes, :bibliografias, :scat)\n datos_descarga(r)\n end\n\n taxones.each do |taxon|\n if opts[:asignar]\n # Viene del controlador validaciones, taxon contiene, estatus, el taxon y mensaje\n if taxon[:estatus] # Si es un sinónimo\n if taxon[:taxon_valido].present?\n self.taxon = taxon[:taxon_valido]\n else # La rewspuesta es el taxon que encontro\n self.taxon = taxon[:taxon]\n end\n\n nombre_cientifico = self.taxon.nombre_cientifico\n\n else # Si tiene muchos taxones como coincidencia\n self.taxon = Especie.none\n\n if taxon[:taxones].present? # Cuando coincidio varios taxones no pongo nada\n nombre_cientifico = taxon[:taxones].map{|t| t.nombre_cientifico}.join(', ')\n else\n nombre_cientifico = ''\n end\n end\n\n asigna_datos\n columna = 3 # Asigna la columna desde el 3, puesto que contiene las sig posiciones antes:\n\n # El nombre original, el (los) que coincidio, y el mensaje\n sheet.add_cell(fila,0,taxon[:nombre_orig])\n sheet.add_cell(fila,1,nombre_cientifico)\n sheet.add_cell(fila,2,taxon[:msg])\n\n else # Cuando viene de una descarga normal de resultados, es decir todos los taxones existen\n self.taxon = taxon\n columna = 0\n end\n\n cols.each do |a|\n begin\n sheet.add_cell(fila,columna,self.taxon.try(a))\n rescue # Por si existe algun error en la evaluacion de algun campo\n sheet.add_cell(fila,columna,'¡Hubo un error!')\n end\n columna+= 1\n end\n\n fila+= 1\n end\n\n # Escribe el excel en cierta ruta\n fecha = Time.now.strftime(\"%Y-%m-%d\")\n ruta_dir = Rails.root.join('public','descargas_resultados', fecha)\n nombre_archivo = Time.now.strftime(\"%Y-%m-%d_%H-%M-%S-%L\") + '_taxa_EncicloVida.xlsx'\n FileUtils.mkpath(ruta_dir, :mode => 0755) unless File.exists?(ruta_dir)\n ruta_excel = ruta_dir.join(nombre_archivo)\n xlsx.write(ruta_excel)\n\n if File.exists? ruta_excel\n excel_url = \"#{CONFIG.site_url}descargas_resultados/#{fecha}/#{nombre_archivo}\"\n\n if opts[:correo].present?\n EnviaCorreo.descargar_taxa(excel_url, opts[:correo], opts[:original_url]).deliver\n end\n\n {estatus: true, excel_url: excel_url}\n else\n {estatus: true, msg: 'No pudo guardar el archivo'}\n end\n\n end", "def process_data()\n \tSpreadsheet.client_encoding='UTF-8'\n\tbook=Spreadsheet::Workbook.new\n\tsheet = book.create_worksheet\n\tsheet.row(0).push 'Link Text','Link Url','Description' #For including headers to the spreadsheet.\n\n\tmain_content=Array.new\n\ts=''\n\ts1=''\n\tvalue=0\n\trow_count=1\n\titerate=@range1.to_i\n\twhile iterate <= @range2.to_i\n \t\tif iterate==1\n \t\t\turl='http://www.google.co.in/search?q='+@query_string.to_s\n \t\t\tlink_count=11\n \t\telsif iterate>1\n \t\t\tvalue=(iterate-1)*10\n \t\t\tlink_count=10\n \t\t\turl='http://www.google.co.in/search?q='+@query_string.to_s+'&start='+value.to_s\n \t\tend\n \t\tdoc = Pismo::Document.new(url)\n \t\tcontent=doc.body.to_s\n \t\tmain_content=content.split('*',11)\n \t\ttmp=1\n \t\twhile tmp <= link_count\n \t\t\ts=main_content[tmp]\n \t\t\ts1=s.lines.map(&:chomp) #s1=s.split(/[\\n]+/)\n \t\t\t#print \"Link #{j} : \" + s1[1].to_s + \"\\nUrl #{j} : \" + s1[2].to_s + \"\\nDesc #{j} : \" + s1[3].to_s + \"\\n\"\n \t\t\tsheet.row(row_count).push s1[1].to_s,s1[2].to_s,s1[3].to_s\n \t\t\tbook.write('/home/chandrasekar/training-ruby/shekar/18_September/website_link.xls')\n \t\t\trow_count+=1\n \t\t\ttmp+=1\n \t\tend\n \t\titerate+=1\n\tend\n end", "def str1_upload_xls\n @title=\"Import Users\"\n Spreadsheet.client_encoding='UTF-8'\n if params[:file].present?\n book=Spreadsheet.open params[:file].tempfile\n sheet1=book.worksheet 0\n sheet1.each 1 do |row|\n @store = Businessnew.new(:address=>row[3], :category=>row[10], :city=>row[4], :id=>row[0],\n :latitude=>row[9], :longitude=>row[8], :name=>row[1], :phone=>row[7],\n :postal_code=>row[6].split(\" \").join(''), :state=>row[5], :url=>row[2])\n if @store.present?\n @store.save\n end\n end\n end\n redirect_to '/'\n end", "def build_xlsx_and_parse(script_file)\n temp_script_data = DocBuilderWrapper.change_output_file(script_file, :xlsx)\n build_doc(temp_script_data[:temp_script_file])\n OoxmlParser::XlsxParser.parse_xlsx(temp_script_data[:temp_output_file])\n end", "def excel_parse\n excel = Spreadsheet.open \"clientes.xls\"\n hoja = excel.worksheet 0\n\n# @filas = []\n hoja.each 1 do |fila|\n #solo añadimos aquellos clientes que no existan, comprobamos que el codigo no exista\n #\n ficha = Cliente.find_by_codigo( fila[4])\n if not ficha then\n ficha = Cliente.new\n ficha.user_id = 1 #usuario de test, para cuando sea MMO\n ficha.codigo = fila[4]\n ficha.nombre = fila[3]\n ficha.provincia = fila[25]\n ficha.direccion = fila[26]\n ficha.ciudad = fila[27]\n ficha.cp = fila[28]\n ficha.telefono = fila[29]\n ficha.grupo_id = fila[1]\n ficha.notas = \"\"\n ficha.save!\n# @filas << ficha\n end\n\n #parseamos la marca a la que pertenece la venta\n m = Marca.find_by_codigo( fila[10])\n if not m then\n m = Marca.new\n m.codigo = fila[10]\n m.user = 0\n m.save!\n end\n\n #parseamos las ventas de esa fila suponiendo que el cliente existe\n vdata = Venta.new do |v|\n v.user= 1\n v.cliente= ficha.id\n #v.marca = Marca.find_by_codigo(fila[10]).id\n v.marca = m.id\n v.piezas_12m = fila[23]\n v.piezas_fact_last_mes = fila[12]\n v.piezas_last_pedido = fila[18]\n v.piezas_pendientes = fila[11]\n end\n vdata.save!\n end\n end", "def initialize(filename, name, index, encoding, activesheet, firstsheet)\n @filename = filename\n @name = name\n @index = index\n @encoding = encoding\n @activesheet = activesheet\n @firstsheet = firstsheet\n\n @type = 0x0200\n @ext_sheets = []\n @using_tmpfile = 1\n @filehandle = \"\"\n @fileclosed = false\n @offset = 0\n @xls_rowmax = 0\n @xls_colmax = 0\n @xls_strmax = 0\n @dim_rowmin = 0\n @dim_rowmax = 0\n @dim_colmin = 0\n @dim_colmax = 0\n @dim_changed = 0\n @colinfo = []\n @selection = [0, 0]\n @panes = []\n @active_pane = 3\n @frozen = 0\n @selected = 0\n @hidden = 0\n\n @paper_size = 0x0\n @orientation = 0x1\n @header = ''\n @footer = ''\n @hcenter = 0\n @vcenter = 0\n @margin_head = 0.50\n @margin_foot = 0.50\n @margin_left = 0.75\n @margin_right = 0.75\n @margin_top = 1.00\n @margin_bottom = 1.00\n\n @title_rowmin = nil\n @title_rowmax = nil\n @title_colmin = nil\n @title_colmax = nil\n @print_rowmin = nil\n @print_rowmax = nil\n @print_colmin = nil\n @print_colmax = nil\n\n @print_gridlines = 1\n @screen_gridlines = 1\n @print_headers = 0\n\n @fit_page = 0\n @fit_width = 0\n @fit_height = 0\n\n @hbreaks = []\n @vbreaks = []\n\n @protect = 0\n @password = nil\n\n @col_sizes = {}\n @row_sizes = {}\n\n @col_formats = {}\n @row_formats = {}\n\n @zoom = 100\n @print_scale = 100\n\n @leading_zeros = 0\n\n @outline_row_level = 0\n @outline_style = 0\n @outline_below = 1\n @outline_right = 1\n @outline_on = 1\n\n _initialize\n end", "def abc_analysis\n infile, result, *others = params\n abc_filename = \"ABC-analysis-#{others[0] || File.basename(infile, '.*')}.csv\"\n\n puts; print \"Assigning machine count to customers...\"\n\n aggregator = Sycsvpro::Aggregator.new(infile: infile, \n outfile: \"aggregate.csv\", \n cols: \"45\", \n sum: \"Total:1,Machines\")\n\n aggregator.execute\n\n puts; print \"Sort customers based on machine count descending...\"\n\n sorter = Sycsvpro::Sorter.new(infile: \"aggregate.csv\",\n outfile: \"sort.csv\",\n cols: \"n:1\",\n df: \"%Y-%m-%d\",\n desc: \"d\")\n \n sorter.execute\n\n puts; print \"Categorize customers in regard to machine count...\"\n\n counter = Sycsvpro::Counter.new(infile: \"sort.csv\",\n outfile: \"count.csv\",\n rows: \"1-#{result.row_count}\",\n key: \"0:customer,1:machines\",\n cols: \"1:<10,1:10-50,1:>50\",\n sort: false)\n\n counter.execute\n\n puts; print \"Conducting ABC-analysis...\"\n\n calculator = Sycsvpro::Calculator.new(infile: \"count.csv\",\n outfile: abc_filename,\n header: \"*,A,B,C\",\n rows: \"2-#{result.row_count}\",\n cols: \"5:c4*c1,6:c3*c1,7:c2*c1\",\n sum: true)\n \n calculator.execute\n\n clean_up([\"aggregate.csv\", \"sort.csv\", \"count.csv\"])\n\n puts; puts \"You can find the result of the ABC Analysis in '#{abc_filename}'\"\n\nend", "def initialize(filename, packed=nil, file_warning = :error) #, create = false)\n super()\n @file_warning = file_warning\n @tmpdir = \"oo_\"+$$.to_s\n @tmpdir = File.join(ENV['ROO_TMP'], @tmpdir) if ENV['ROO_TMP'] \n unless File.exists?(@tmpdir)\n FileUtils::mkdir(@tmpdir)\n end\n filename = open_from_uri(filename) if filename[0,7] == \"http://\"\n filename = unzip(filename) if packed and packed == :zip\n begin\n file_type_check(filename,'.xlsx','an Excel-xlsx')\n @cells_read = Hash.new\n @filename = filename\n unless File.file?(@filename)\n raise IOError, \"file #{@filename} does not exist\"\n end\n @@nr += 1\n @file_nr = @@nr\n extract_content(@filename)\n file = File.new(File.join(@tmpdir, @file_nr.to_s+\"_roo_workbook.xml\"))\n # TODO: @workbook_doc = XML::Parser.io(file).parse\n @workbook_doc = Nokogiri::XML(file)\n\n\n file.close\n @shared_table = []\n if File.exist?(File.join(@tmpdir, @file_nr.to_s+'_roo_sharedStrings.xml'))\n file = File.new(File.join(@tmpdir, @file_nr.to_s+'_roo_sharedStrings.xml'))\n #TODO: @sharedstring_doc = XML::Parser.io(file).parse\n @sharedstring_doc = Nokogiri::XML(file)\n file.close\n read_shared_strings(@sharedstring_doc)\n end\n @styles_table = []\n @style_definitions = Array.new # TODO: ??? { |h,k| h[k] = {} }\n if File.exist?(File.join(@tmpdir, @file_nr.to_s+'_roo_styles.xml'))\n file = File.new(File.join(@tmpdir, @file_nr.to_s+'_roo_styles.xml'))\n #TODO: @styles_doc = XML::Parser.io(file).parse\n @styles_doc = Nokogiri::XML(file)\n file.close\n read_styles(@styles_doc)\n end\n @sheet_doc = []\n @sheet_files.each_with_index do |item, i|\n file = File.new(item)\n #TODO: @sheet_doc[i] = XML::Parser.io(file).parse\n @sheet_doc[i] = Nokogiri::XML(file)\n file.close\n end\n ensure\n #if ENV[\"roo_local\"] != \"thomas-p\"\n FileUtils::rm_r(@tmpdir)\n #end\n end\n @cell = Hash.new\n @cell_type = Hash.new\n @formula = Hash.new\n @first_row = Hash.new\n @last_row = Hash.new\n @first_column = Hash.new\n @last_column = Hash.new\n @header_line = 1\n @excelx_type = Hash.new\n @excelx_value = Hash.new\n @s_attribute = Hash.new # TODO: ggf. wieder entfernen nur lokal benoetigt\n self.default_sheet = self.sheets.first\n end", "def run\n if !self.file.blank?\n xlsx = Roo::Excelx.new(self.file.path)\n\n xlsx.to_a.collect {|i|i[0]}.each do |phone|\n if group\n cm = group.group_members.where(:phone=>phone).first || group.group_members.build(:phone=>phone)\n cm.started_at = DateTime.now\n cm.ended_at = DateTime.now + 1.year\n cm.client_id = client_id\n cm.save\n end\n end\n else\n return []\n end\n end", "def read_cells(sheet=nil)\n sheet = @default_sheet unless sheet\n sheet_found = false\n raise ArgumentError, \"Error: sheet '#{sheet||'nil'}' not valid\" if @default_sheet == nil and sheet==nil\n raise RangeError unless self.sheets.include? sheet\n n = self.sheets.index(sheet)\n #TODO: @sheet_doc[n].find(\"//*[local-name()='c']\").each do |c|\n @sheet_doc[n].xpath(\"//*[local-name()='c']\").each do |c|\n #TODO: s_attribute = c.attributes.to_h['s'].to_i # should be here\n s_attribute = c['s'].to_i # should be here\n #TODO: if (c.attributes.to_h['t'] == 's')\n # c: <c r=\"A5\" s=\"2\">\n # <v>22606</v>\n # </c>, format: , tmp_type: float\n\n if c['t'] == 's'\n tmp_type = :shared\n #TODO: elsif (c.attributes.to_h['t'] == 'b')\n elsif c['t'] == 'b'\n tmp_type = :boolean\n else\n #s_attribute = c.attributes.to_h['s'].to_i # was here\n s_attribute = c['s'].to_i # was here\n format = attribute2format(s_attribute)\n tmp_type = format2type(format)\n end\n formula = nil\n #TODO: c.each_element do |cell|\n c.children.each do |cell|\n #TODO: if cell.name == 'f'\n if cell.name == 'f'\n formula = cell.content\n end\n #TODO: if cell.name == 'v'\n if cell.name == 'v'\n if tmp_type == :time or tmp_type == :datetime\n if cell.content.to_f >= 1.0 \n if (cell.content.to_f - cell.content.to_f.floor).abs > 0.000001 \n tmp_type = :datetime \n else\n tmp_type = :date\n end\n else\n end \n end\n excelx_type = [:numeric_or_formula,format.to_s]\n excelx_value = cell.content\n if tmp_type == :shared\n vt = :string\n str_v = @shared_table[cell.content.to_i]\n excelx_type = :string\n elsif tmp_type == :boolean\n vt = :boolean\n cell.content.to_i == 1 ? v = 'TRUE' : v = 'FALSE'\n elsif tmp_type == :date\n vt = :date\n v = cell.content\n elsif tmp_type == :time\n vt = :time\n v = cell.content\n elsif tmp_type == :datetime\n vt = :datetime\n v = cell.content\n elsif tmp_type == :formula\n vt = :formula\n v = cell.content.to_f #TODO: !!!!\n else\n vt = :float\n v = cell.content\n end\n #puts \"vt: #{vt}\" if cell.text.include? \"22606.5120\"\n #TODO: x,y = split_coordinate(c.attributes.to_h['r'])\n x,y = split_coordinate(c['r'])\n tr=nil #TODO: ???s\n set_cell_values(sheet,x,y,0,v,vt,formula,tr,str_v,excelx_type,excelx_value,s_attribute)\n end\n end\n end\n sheet_found = true #TODO:\n if !sheet_found\n raise RangeError\n end\n @cells_read[sheet] = true\n end", "def run(runner, user_arguments)\n super(runner, user_arguments)\n\n #use the built-in error checking\n if not runner.validateUserArguments(arguments(), user_arguments)\n return false\n end\n \n # get the last model and sql file\n\n model = runner.lastOpenStudioModel\n if model.empty?\n runner.registerError(\"Cannot find last model.\")\n return false\n end\n model = model.get\n\n sqlFile = runner.lastEnergyPlusSqlFile\n if sqlFile.empty?\n runner.registerError(\"Cannot find last sql file.\")\n return false\n end\n sqlFile = sqlFile.get\n model.setSqlFile(sqlFile)\n \n # Load geometry.rb resource\n resources_dir = File.absolute_path(File.join(File.dirname(__FILE__), \"..\", \"..\", \"lib\", \"resources\")) # Should have been uploaded per 'Other Library Files' in analysis spreadsheet\n geometry_file = File.join(resources_dir, \"geometry.rb\")\n require File.join(File.dirname(geometry_file), File.basename(geometry_file, File.extname(geometry_file)))\n \n # Load helper_methods\n helper_methods_file = File.join(resources_dir, \"helper_methods.rb\")\n require File.join(File.dirname(helper_methods_file), File.basename(helper_methods_file, File.extname(helper_methods_file)))\n \n total_site_units = \"MBtu\"\n elec_site_units = \"kWh\"\n gas_site_units = \"therm\"\n other_fuel_site_units = \"MBtu\"\n \n # Get PV electricity produced\n pv_query = \"SELECT -1*Value FROM TabularDataWithStrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='Electric Loads Satisfied' AND RowName='Total On-Site Electric Sources' AND ColumnName='Electricity' AND Units='GJ'\"\n pv_val = sqlFile.execAndReturnFirstDouble(pv_query)\n \n # TOTAL\n \n report_sim_output(runner, \"total_site_energy_mbtu\", [sqlFile.totalSiteEnergy], \"GJ\", total_site_units)\n report_sim_output(runner, \"net_site_energy_mbtu\", [sqlFile.totalSiteEnergy, pv_val], \"GJ\", total_site_units)\n \n # ELECTRICITY\n \n report_sim_output(runner, \"total_site_electricity_kwh\", [sqlFile.electricityTotalEndUses], \"GJ\", elec_site_units)\n report_sim_output(runner, \"net_site_electricity_kwh\", [sqlFile.electricityTotalEndUses, pv_val], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_heating_kwh\", [sqlFile.electricityHeating], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_cooling_kwh\", [sqlFile.electricityCooling], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_interior_lighting_kwh\", [sqlFile.electricityInteriorLighting], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_exterior_lighting_kwh\", [sqlFile.electricityExteriorLighting], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_interior_equipment_kwh\", [sqlFile.electricityInteriorEquipment], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_fans_kwh\", [sqlFile.electricityFans], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_pumps_kwh\", [sqlFile.electricityPumps], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_water_systems_kwh\", [sqlFile.electricityWaterSystems], \"GJ\", elec_site_units)\n report_sim_output(runner, \"electricity_pv_kwh\", [pv_val], \"GJ\", elec_site_units)\n \n # NATURAL GAS\n \n report_sim_output(runner, \"total_site_natural_gas_therm\", [sqlFile.naturalGasTotalEndUses], \"GJ\", gas_site_units)\n report_sim_output(runner, \"natural_gas_heating_therm\", [sqlFile.naturalGasHeating], \"GJ\", gas_site_units)\n report_sim_output(runner, \"natural_gas_interior_equipment_therm\", [sqlFile.naturalGasInteriorEquipment], \"GJ\", gas_site_units)\n report_sim_output(runner, \"natural_gas_water_systems_therm\", [sqlFile.naturalGasWaterSystems], \"GJ\", gas_site_units)\n \n # OTHER FUEL\n \n report_sim_output(runner, \"total_site_other_fuel_mbtu\", [sqlFile.otherFuelTotalEndUses], \"GJ\", other_fuel_site_units)\n report_sim_output(runner, \"other_fuel_heating_mbtu\", [sqlFile.otherFuelHeating], \"GJ\", other_fuel_site_units)\n report_sim_output(runner, \"other_fuel_interior_equipment_mbtu\", [sqlFile.otherFuelInteriorEquipment], \"GJ\", other_fuel_site_units)\n report_sim_output(runner, \"other_fuel_water_systems_mbtu\", [sqlFile.otherFuelWaterSystems], \"GJ\", other_fuel_site_units)\n \n # LOADS NOT MET\n \n report_sim_output(runner, \"hours_heating_setpoint_not_met\", [sqlFile.hoursHeatingSetpointNotMet], nil, nil)\n report_sim_output(runner, \"hours_cooling_setpoint_not_met\", [sqlFile.hoursCoolingSetpointNotMet], nil, nil)\n \n # HVAC CAPACITIES\n \n cooling_coils = [\n 'coil:cooling:dx:singlespeed',\n 'coil:cooling:dx:twospeed',\n 'coil:cooling:dx:multispeed',\n 'coil:cooling:dx:variablespeed',\n 'coil:cooling:dx:variablerefrigerantflow'\n ]\n cooling_capacity_fields = [\n 'user-specified gross rated total cooling capacity',\n 'speed 4 user-specified total cooling capacity',\n 'speed 2 user-specified total cooling capacity'\n ]\n cooling_capacity_w = nil\n cooling_coils.each do |cooling_coil|\n cooling_capacity_query = \"SELECT SUM(Value) FROM ComponentSizes WHERE lower(CompType) == '#{cooling_coil}' AND lower(Description) IN ('#{cooling_capacity_fields.join(\"','\")}')\"\n cooling_capacity_w = sqlFile.execAndReturnFirstDouble(cooling_capacity_query)\n break if cooling_capacity_w.is_initialized and cooling_capacity_w.get > 0\n end\n report_sim_output(runner, \"hvac_cooling_capacity_w\", [cooling_capacity_w], \"W\", \"W\")\n \n heating_coils = [\n 'coil:heating:fuel',\n 'coil:heating:dx:singlespeed',\n 'coil:heating:dx:multispeed',\n 'coil:heating:dx:variablespeed',\n 'coil:heating:dx:variablerefrigerantflow',\n #'boiler:hotwater', # TEMPORARY: See https://github.com/NREL/OpenStudio-BuildStock/issues/57\n 'coil:heating:electric',\n 'zonehvac:baseboard:convective:electric',\n 'zonehvac:baseboard:convective:water' # TEMPORARY: See https://github.com/NREL/OpenStudio-BuildStock/issues/57\n ]\n heating_capacity_fields = [\n 'user-specified nominal capacity',\n 'user-specified heating design capacity',\n 'user-specified gross rated heating capacity',\n 'speed 2 user-specified total cooling capacity',\n 'speed 4 user-specified total cooling capacity',\n 'user-specified maximum water flow rate' # TEMPORARY: See https://github.com/NREL/OpenStudio-BuildStock/issues/57\n ]\n heating_capacity_w = nil\n heating_coils.each do |heating_coil|\n heating_capacity_query = \"SELECT SUM(Value) FROM ComponentSizes WHERE lower(CompType) == '#{heating_coil}' AND lower(Description) IN ('#{heating_capacity_fields.join(\"','\")}')\"\n if heating_coil == 'zonehvac:baseboard:convective:water' # TEMPORARY: See https://github.com/NREL/OpenStudio-BuildStock/issues/57\n heating_capacity_query = \"SELECT SUM(Value*23213695.555555556) FROM ComponentSizes WHERE lower(CompType) == '#{heating_coil}' AND lower(Description) IN ('#{heating_capacity_fields.join(\"','\")}')\"\n end\n heating_capacity_w = sqlFile.execAndReturnFirstDouble(heating_capacity_query)\n break if heating_capacity_w.is_initialized and heating_capacity_w.get > 0\n end\n report_sim_output(runner, \"hvac_heating_capacity_w\", [heating_capacity_w], \"W\", \"W\")\n \n # WEIGHT\n \n weight = get_value_from_runner_past_results(runner, \"weight\", \"build_existing_model\", false)\n if not weight.nil?\n runner.registerValue(\"weight\", weight.to_f)\n runner.registerInfo(\"Registering #{weight} for weight.\")\n end\n \n # UPGRADE NAME\n upgrade_name = get_value_from_runner_past_results(runner, \"upgrade_name\", \"apply_upgrade\", false)\n if upgrade_name.nil?\n upgrade_name = \"\"\n end\n runner.registerValue(\"upgrade_name\", upgrade_name)\n runner.registerInfo(\"Registering #{upgrade_name} for upgrade_name.\")\n \n # UPGRADE COSTS\n \n upgrade_cost_name = \"upgrade_cost_usd\"\n \n # Get upgrade cost value/multiplier pairs from the upgrade measure\n cost_pairs = []\n for option_num in 1..10 # Sync with ApplyUpgrade measure\n for cost_num in 1..2 # Sync with ApplyUpgrade measure\n cost_value = get_value_from_runner_past_results(runner, \"option_#{option_num}_cost_#{cost_num}_value_to_apply\", \"apply_upgrade\", false)\n next if cost_value.nil?\n cost_mult_type = get_value_from_runner_past_results(runner, \"option_#{option_num}_cost_#{cost_num}_multiplier_to_apply\", \"apply_upgrade\", false)\n next if cost_mult_type.nil?\n cost_pairs << [cost_value.to_f, cost_mult_type]\n end\n end\n \n if cost_pairs.size == 0\n runner.registerValue(upgrade_cost_name, \"\")\n runner.registerInfo(\"Registering (blank) for #{upgrade_cost_name}.\")\n return true\n end\n \n # Obtain cost multiplier values from simulation results and calculate upgrade costs\n upgrade_cost = 0.0\n cost_pairs.each do |cost_value, cost_mult_type|\n cost_mult = 0.0\n \n if cost_mult_type == \"Fixed (1)\"\n cost_mult = 1.0\n \n elsif cost_mult_type == \"Conditioned Floor Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='AnnualBuildingUtilityPerformanceSummary' AND ReportForString='Entire Facility' AND TableName='Building Area' AND RowName='Net Conditioned Building Area' AND ColumnName='Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Conditioned Foundation Slab Area (ft^2)\"\n # Surface area between conditioned space and ground\n floor_area = 0\n model.getSurfaces.each do |surface|\n next if surface.surfaceType.downcase != \"floor\"\n next if surface.outsideBoundaryCondition.downcase != \"ground\"\n next if not surface.adjacentSurface.is_initialized\n next if not surface.adjacentSurface.get.space.is_initialized\n adjacent_space = surface.adjacentSurface.get.space.get\n next if not Geometry.space_is_finished(adjacent_space)\n floor_area += surface.grossArea\n end\n cost_mult = OpenStudio::convert(floor_area,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Lighting Floor Area (ft^2)\"\n # Get zone names where Lighting > 0\n sql_query = \"SELECT RowName FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND ColumnName='Lighting' AND Units='W/m2' AND CAST(Value AS DOUBLE)>0\"\n sql_results = sqlFile.execAndReturnVectorOfString(sql_query)\n if sql_results.is_initialized\n sql_results.get.each do |lighting_zone_name|\n # Get floor area for this zone\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND RowName='#{lighting_zone_name}' AND ColumnName='Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult += OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n end\n end\n \n elsif cost_mult_type == \"Above-Grade Conditioned Wall Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND RowName='Conditioned Total' AND ColumnName='Above Ground Gross Wall Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Above-Grade Total Wall Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND RowName='Total' AND ColumnName='Above Ground Gross Wall Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Below-Grade Conditioned Wall Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND RowName='Conditioned Total' AND ColumnName='Underground Gross Wall Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Below-Grade Total Wall Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND RowName='Total' AND ColumnName='Underground Gross Wall Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Window Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Zone Summary' AND RowName='Total' AND ColumnName='Window Glass Area' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Roof Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='InputVerificationandResultsSummary' AND ReportForString='Entire Facility' AND TableName='Skylight-Roof Ratio' AND RowName='Gross Roof Area' AND ColumnName='Total' AND Units='m2'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n cost_mult = OpenStudio::convert(sql_result.get,\"m^2\",\"ft^2\").get\n \n elsif cost_mult_type == \"Door Area (ft^2)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='EnvelopeSummary' AND ReportForString='Entire Facility' AND TableName='Exterior Door' AND ColumnName='Gross Area' AND Units='m2'\"\n sql_results = sqlFile.execAndReturnVectorOfDouble(sql_query)\n if sql_results.is_initialized\n sql_results.get.each do |sql_result|\n cost_mult += OpenStudio::convert(sql_result,\"m^2\",\"ft^2\").get\n end\n end\n \n elsif cost_mult_type == \"Water Heater Tank Size (gal)\"\n sql_query = \"SELECT Value FROM TabularDataWithStrings WHERE ReportName='EquipmentSummary' AND ReportForString='Entire Facility' AND TableName='Service Water Heating' AND ColumnName='Storage Volume' AND Units='m3'\"\n sql_result = sqlFile.execAndReturnFirstDouble(sql_query)\n if sql_result.is_initialized\n cost_mult = OpenStudio::convert(sql_result.get,\"m^3\",\"gal\").get\n end\n \n elsif cost_mult_type == \"HVAC Cooling Capacity (kBtuh)\"\n if cooling_capacity_w.is_initialized\n cost_mult = OpenStudio::convert(cooling_capacity_w.get,\"W\",\"kBtu/h\").get\n end\n \n elsif cost_mult_type == \"HVAC Heating Capacity (kBtuh)\"\n if heating_capacity_w.is_initialized\n cost_mult = OpenStudio::convert(heating_capacity_w.get,\"W\",\"kBtu/h\").get\n end\n \n elsif cost_mult_type != \"\"\n runner.registerError(\"Unhandled cost multiplier: #{cost_mult_type.to_s}. Aborting...\")\n return false\n \n end\n runner.registerInfo(\"Upgrade cost addition: $#{cost_value} x #{cost_mult} [#{cost_mult_type}].\")\n upgrade_cost += cost_value * cost_mult\n end\n upgrade_cost_str = upgrade_cost.round(2).to_s\n runner.registerValue(upgrade_cost_name, upgrade_cost_str)\n runner.registerInfo(\"Registering #{upgrade_cost_str} for #{upgrade_cost_name}.\")\n\n sqlFile.close()\n\n runner.registerFinalCondition(\"Report generated successfully.\")\n\n return true\n\n end", "def process_xls_file\n return unless file.instance.file_content_type.eql?(\"application/x-ole-storage\") &&\n CONTENT_TYPES.include?(\"application/vnd.ms-excel\")\n file.instance.file_content_type = \"application/vnd.ms-excel\"\n end", "def emp_report\n \n end", "def convertExcel exceldoc, fname, tmpdir\n uniqName = fname\n begin\n if File.extname(fname) == \"\"\n fname = \"#{fname}.xml\"\n else\n fname = File.basename(fname, File.extname(fname)) + \".xml\"\n end\n fname = File.join(tmpdir, fname)\n excelXML exceldoc.path, fname, @lock\n File.open(fname)\n rescue Exception => e\n errorStore(uniqName,e.message)\n false\n end\n end", "def import_spreadsheet\n @project = Yogo::Project.get(params[:id])\n @total_steps = 3\n\n case params[:step]\n when '2'\n file = copy_uploaded_file(params[:spreadsheet])\n session[:import_file] = file\n contents = FasterCSV.read(file)\n @headers = contents[0]\n @rows = contents.length - 1\n @measurements = params[:measurements].keys.map{|k| @project.data_collections.get k }\n @import_step = 2\n when '3'\n @measurements, @example, @sheet_rows = {}, {}, 0\n params['measurements'].each do |m_id, parameters|\n m = @project.data_collections.get m_id\n m_hash = {}\n m_hash['measurement'] = [m.measurement_schema.id, parameters.delete('measurement')]\n m_hash['parameters'] = []\n parameters.each do |p_id, header|\n p = m.schema.get p_id\n m_hash['parameters'] << [p, header]\n end\n @measurements[m] = m_hash\n @measurements[m]['count'] = 0\n @measurements[m]['example'] = {}\n end\n\n FasterCSV.foreach(session[:import_file], :headers => true) do |row|\n @headers ||= row.headers\n \n @measurements.each do |m, v|\n if @measurements[m]['example'].empty?\n @headers.each { |h| @measurements[m]['example'][h] = [] } \n end\n unless row[v['measurement'][1]].blank?\n if @measurements[m]['count'] < 5\n row.each { |h, v| @measurements[m]['example'][h] << v }\n end\n @measurements[m]['count'] += 1 \n end\n end\n @sheet_rows += 1\n end\n session_hash = {}\n @measurements.each do |m,v|\n session_hash[m.id] = {\n 'parameters' => v['parameters'].map{|p| [p[0].id, p[1]] }, \n 'measurement' => v['measurement']\n }\n end\n session[:measurements] = session_hash\n @import_step = 3\n when '4'\n @measurements = {}\n session[:measurements].each do |m_id,v|\n m = @project.data_collections.get(m_id)\n @measurements[m] = v\n end\n @measurements.each do |m,v|\n @measurements[m]['initial'] = m.items.all.count\n if params['replace_data'] && (params['replace_data'][m.id.to_s] == 'DELETE')\n m.items.all.destroy\n end\n @measurements[m]['deleted'] = @measurements[m]['initial'] - m.items.all.count\n @measurements[m]['added'] = 0\n @measurements[m]['errors'] = []\n end\n FasterCSV.foreach(session[:import_file], :headers => true) do |row|\n @headers ||= row.headers\n @measurements.each do |m, v|\n values = {}\n unless row[v['measurement'][1]].blank?\n fields = {}\n m.schema.each{|s| fields[s.id.to_s] = s.to_s.intern }\n v['parameters'].each do |p,h|\n values[fields[p.to_s]] = row[h]\n end\n values[fields[v['measurement'][0].to_s]] = row[v['measurement'][1]]\n d = m.data_model.new(values)\n if d.valid?\n d.save\n else\n @measurements[m]['errors'] << d.errors.full_messages.join(\", \")\n end\n @measurements[m]['added'] += 1\n end\n end\n end\n @measurements.each_key{|m| @measurements[m]['total'] = m.items.all.count }\n @import_step = 4\n else\n @import_step = 1\n end\n\n render(\"import_spreadsheet_#{@import_step}\")\n end", "def index\n @microsites = Microsite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @microsites }\n format.xls {ModelXls.new(Microsite) ;send_file \"#{Rails.root}/tmp/xls/Microsites.xls\"}\n end\n end", "def perform_spreadsheet_load( file_name, options = {} )\n\n @mandatory = options[:mandatory] || []\n\n @excel = Spreadsheet.open file_name\n \n puts \"\\nLoading from Excel file: #{file_name}\"\n\n sheet_number = options[:sheet_number] || 0\n\n @sheet = @excel.sheet( sheet_number )\n\n header_row_index = options[:header_row] || 0\n @header_row = @sheet.getRow(header_row_index)\n\n raise MissingHeadersError, \"No headers found - Check Sheet #{@sheet} is complete and Row #{header_row_index} contains headers\" unless(@header_row)\n\n @headers = []\n \n (0..JExcelFile::MAX_COLUMNS).each do |i|\n cell = @header_row.getCell(i)\n break unless cell\n header = \"#{@excel.cell_value(cell).to_s}\".strip\n break if header.empty?\n @headers << header\n end\n\n raise MissingHeadersError, \"No headers found - Check Sheet #{@sheet} is complete and Row #{header_row_index} contains headers\" if(@headers.empty?)\n\n # Create a method_mapper which maps list of headers into suitable calls on the Active Record class\n map_headers_to_operators( @headers, options)\n\n load_object_class.transaction do\n @loaded_objects = []\n\n (1..@excel.num_rows).collect do |row|\n\n # Excel num_rows seems to return all 'visible' rows, which appears to be greater than the actual data rows\n # (TODO - write spec to process .xls with a huge number of rows)\n #\n # This is rubbish but currently manually detect when actual data ends, this isn't very smart but\n # got no better idea than ending once we hit the first completely empty row\n break if @excel.sheet.getRow(row).nil?\n\n contains_data = false\n\n # TODO - Smart sorting of column processing order ....\n # Does not currently ensure mandatory columns (for valid?) processed first but model needs saving\n # before associations can be processed so user should ensure mandatory columns are prior to associations\n\n # as part of this we also attempt to save early, for example before assigning to\n # has_and_belongs_to associations which require the load_object has an id for the join table\n\n # Iterate over the columns method_mapper found in Excel,\n # pulling data out of associated column\n @method_mapper.method_details.each_with_index do |method_detail, col|\n\n value = value_at(row, col)\n\n contains_data = true unless(value.nil? || value.to_s.empty?)\n\n #puts \"DEBUG: Excel process METHOD :#{method_detail.inspect}\", value.inspect\n prepare_data(method_detail, value)\n \n process()\n end\n \n break unless(contains_data == true)\n\n # TODO - requirements to handle not valid ?\n # all or nothing or carry on and dump out the exception list at end\n #puts \"DEBUG: FINAL SAVE #{load_object.inspect}\"\n save\n #puts \"DEBUG: SAVED #{load_object.inspect}\"\n\n # don't forget to reset the object or we'll update rather than create\n new_load_object\n\n end\n end\n puts \"Spreadsheet loading stage complete - #{loaded_objects.size} rows added.\"\n end", "def import_exe execution\n raise \"import_exe must be redefined in children classes\"\n end", "def replace_formulae_with_calculated_values \n worksheets do |name,xml_filename|\n r = ReplaceFormulaeWithCalculatedValues.new\n r.excel_file = excel_file\n replace r, [name, 'Formulae'], [name, 'Formulae']\n @replacements_made_in_the_last_pass += r.replacements_made_in_the_last_pass\n end\n end", "def import\n begin\n movements = Roo::Excelx.new(params[:file].path, file_warning: :ignore)\n export_file_path = [Rails.root, \"public\", \"cartola_correcta.xls\"].join(\"/\")\n\n if File.file?(export_file_path)\n movements_old = Roo::Spreadsheet.open(export_file_path, extension: :xls)\n if movements.last_row < movements_old.last_row\n especial_movement(movements,movements_old)\n else\n validate_movement(movements,movements_old)\n end\n else\n create_movement(movements)\n end\n return render json: {status: true}\n rescue Exception => e\n puts e\n return false\n end\n end", "def performance_xls\n plate = Plate.find(params['id'])\n path = plate.get_performance_xls\n send_file(path, :type => \"application/vnd.ms-excel\")\n end", "def call(sheet: 0, skiprows: 0, skipcols: 0, order: true, index: false)\n @order = order\n @index = index\n worksheet = @file_data.sheet(sheet)\n @data = strip_html_tags(skip_data(worksheet.to_a, skiprows, skipcols))\n @index = process_index\n @order = process_order || (0..@data.first.length-1)\n @data = process_data\n\n Daru::DataFrame.rows(@data, order: @order, index: @index)\n end", "def buildSampleSheet()\n laneBarcodes = AnalysisInfo.getBarcodeList(@baseCallsDir + \"/FCDefinition.xml\")\n\n formattedFCName = PipelineHelper.formatFlowcellNameForLIMS(@fcName)\n\n outFile = File.new(@baseCallsDir + \"/SampleSheet.csv\", \"w\")\n headerLine = \"flowcell,lane,sample,reference,index,description,\" +\n \"control,recipe,operator,project\"\n outFile.puts(headerLine)\n\n laneBarcodes.each do |laneBC|\n laneNum = laneBC.slice(/^\\d/) # Lane number without barcode\n fcBarcode = formattedFCName + \"-\" + # Flowcell name in LIMS\n laneBC.to_s\n\n # Remove the lane name from lane barcode\n if laneBC.match(/^\\d$/)\n bcName = laneBC.gsub(/^\\d/,\"\") # Barcode name without lane\n else\n bcName = laneBC.gsub(/\\d-/,\"\")\n end\n\n if bcName == nil || bcName.empty?()\n indexSeq = \"\" # Actual index sequence\n else\n indexSeq = BarcodeDefinitionBuilder.findBarcodeSequence(@baseCallsDir, bcName)\n end\n\n line = @fcName + \",\" + laneNum.to_s + \",\" + fcBarcode + \",sequence,\" +\n indexSeq + \",desc,n,r1,fiona,\" + @fcName\n outFile.puts line\n end\n outFile.close()\n end", "def worksheet (sheetname, objectType,objects)\r\n\t\r\n\t buffer =\"\"\r\n\t xm = Builder::XmlMarkup.new(buffer) # stream to the text buffer\r\n\t type = ActiveRecord::Base.const_get(objectType.classify)\r\n\t \r\n\t xm.Worksheet 'ss:Name' => sheetname do\r\n \t xm.Table do\r\n \t \r\n \t # Header\r\n \t xm.Row do\r\n \t for column in type.columns do\r\n \t xm.Cell do\r\n \t xm.Data column.human_name, 'ss:Type' => 'String'\r\n \t end\r\n \t end\r\n \t end\r\n \t \r\n \t # Rows\r\n \t for record in objects\r\n \t xm.Row do\r\n \t for column in type.columns do\r\n \t xm.Cell do\r\n \t xm.Data record.send(column.name), 'ss:Type' => 'String'\r\n \t end\r\n \t end\r\n \t end\r\n \t end # for\r\n \t \r\n \t end # table\r\n\t end #worksheet\r\n\t \r\n\t return xm.target! # retrieves the buffer\r\n\t\r\n\t end", "def store_workbook # :nodoc:\n # Add a default worksheet if non have been added.\n add_worksheet if @worksheets.empty?\n\n # Ensure that at least one worksheet has been selected.\n @worksheets.visible_first.select if @activesheet == 0\n\n # Set the active sheet.\n @activesheet = @worksheets.visible_first.index if @activesheet == 0\n @worksheets[@activesheet].activate\n\n # Convert the SST strings data structure.\n prepare_sst_string_data\n\n # Prepare the worksheet VML elements such as comments and buttons.\n prepare_vml_objects\n # Set the defined names for the worksheets such as Print Titles.\n prepare_defined_names\n # Prepare the drawings, charts and images.\n prepare_drawings\n # Add cached data to charts.\n add_chart_data\n\n # Prepare the worksheet tables.\n prepare_tables\n\n # Prepare the metadata file links.\n prepare_metadata\n\n # Package the workbook.\n packager = Package::Packager.new(self)\n packager.set_package_dir(tempdir)\n packager.create_package\n\n # Free up the Packager object.\n packager = nil\n\n # Store the xlsx component files with the temp dir name removed.\n ZipFileUtils.zip(\"#{tempdir}\", filename)\n\n IO.copy_stream(filename, fileobj) if fileobj\n Writexlsx::Utility.delete_files(tempdir)\n end", "def reports\n battery = Battery.find(params[:battery_id])\n @date1 = Date.parse(params[:date1])\n @date2 = Date.parse(params[:date2])\n @station = battery.station\n package = Axlsx::Package.new\n workbook = package.workbook\n @tests = BatteryWeeklyTest.find(:all, :conditions => [\"DATE(created_at) >= ? AND DATE(created_at) <= ?\", @date1, @date2], :order => \"created_at DESC\")\n\n workbook.add_worksheet(name: \"Sheet 1\") do |sheet|\n # sheet.add_image(:image_src => Rails.root.join('public','images','ntlogo.png').to_s, :noSelect => true, :noMove => true) do |image|\n # image.width=70\n # image.height=71\n # image.start_at 22, 14\n # image.end_at 1, 1\n # end\n sheet.add_row [\"Weekly Test Report on #{@date} of station #{@station.name}\"]\n @tests.each_slice(24).with_index do |slice, index|\n sheet.add_row [\"Bank No #{ index + 1}\"]\n sheet.add_row [\"Cell No.\", \"Total Voltage\", \"Visual Inspection\", \"Reported by\", \"Reported date\"], :style => Axlsx::STYLE_THIN_BORDER\n slice.each_with_index do |t, i|\n sheet.add_row [i+1, t.cell_voltage, t.visual_inspection,t.inserted_by, t.created_at.to_s], :style => Axlsx::STYLE_THIN_BORDER \n end\n sheet.column_widths 10,nil, 23, 23, 23\n sheet.merge_cells(\"A1:D1\")\n end\n end\n send_data package.to_stream.read, :filename => 'report.xlsx', :type => \"application/vnd.openxmlformates-officedocument.spreadsheetml.sheet\"\n end", "def index\n @worksheet.index\n end", "def elems_in_wh_and_quality_original_calculate_all_at_once\n # Los Secado de process rec_seco los muestra por tarja todos separados\n respond_to do |format|\n format.xlsx {\n @elements = Element.all.includes(:product_type, :drying_method, :warehouse)#.to_a\n\n # Applying filters\n f_params = params.reject{|k, v| v.blank?}\n if !f_params[:product_type_id]\n redirect_back(fallback_location: root_path, alert: \"Debe seleccionar un proceso.\")\n end\n @process = ProductType.find(f_params[:product_type_id]).name\n @elements = @elements.product_type(f_params[:product_type_id]) if f_params[:product_type_id]\n @elements = @elements.location(f_params[:location]) if f_params[:location]\n\n logger.info {\"Descargando elems_in_wh_and_quality\"}\n logger.info {\"Tamaño en memoria #{ActiveSupport::JSON.encode(@elements).size} bytes\"}\n\n # Los elems fueron filtrados por cosas comunes a groups\n # Obtengo todos los elems_ids que cumplen los parametros!\n elems_ids = @elements.ids\n group_ids = @elements.distinct.pluck(:elements_group_id)\n # p \"Groups IDS\"\n # p group_ids\n # Busco las muestras que pertenezcan a los elements o group_samples(para damage, caliber and humidity).\n @dam_samples = DamageSample.where(element_id: elems_ids).or(\n DamageSample.where(elements_group_id: group_ids)).to_a\n @cal_samples = CaliberSample.where(element_id: elems_ids).or( #includes(:caliber, :deviation_sample).to_a\n CaliberSample.where(elements_group_id: group_ids)).to_a\n cal_samples_ids = @cal_samples.map {|cs| cs.id}\n @dev_samples = DeviationSample.where(caliber_sample_id: cal_samples_ids).select(:caliber_sample_id, :deviation).to_a\n @humidity_samples = HumiditySample.where(element_id: elems_ids).or(\n HumiditySample.where(elements_group_id: group_ids))\n .select(:element_id, :humidity, :elements_group_id).to_a\n @sorbate_samples = SorbateSample.where(element_id: elems_ids).select(:element_id, :sorbate).to_a\n @carozo_samples = CarozoSample.where(element_id: elems_ids).select(:element_id, :carozo_percentage).to_a\n\n @damages_list = Util.damages_of_product_type(@process)\n response.headers['Content-Disposition'] = 'attachment; filename=\"'+ Date.today.to_s + ' - Productos: Bodega y calidad.xlsx\"'\n }\n end\n end", "def import(file)\n spreadsheet = ModelCommon.open_spreadsheet(file)\n return '<p class = \"alert alert-error\">Try to do the following instructions:<br/>\n 1. Please save as the file to excel format.<br/>\n 2. Make sure MOAS data in the first sheet.<br/>\n 3. Header is in the first row.</p>' if spreadsheet.nil?\n\n header = downcase_array_key spreadsheet.row(1)\n\n # verify header, raise error if not map\n no_failed_hearders = MOASHeader.verify_header(header, @language)\n\n return ('<p class = \"alert alert-error\">Below is the missing header titles list. Please update header title(s) of the excel file || contact your administrator<br/>' << no_failed_hearders.to_s << '</p>') if no_failed_hearders != true\n return ('<p class = \"alert alert-error\">No data in excel file. Please re-check!</p>') if spreadsheet.last_row <= 1\n\n # begin transaction\n begin\n connection = Connection.new\n connection.open_connection_in_config\n connection.con.autocommit false\n\n # 1. DELETE ALL RECORDS\n connection.execute_sql_statement \"delete from #{@table}\"\n pstmt = connection.con.prepare(\"insert into #{@table}(golivedate,appstatus,sku,shorttitle,longtitle,gender,agefrommonths,agetomonths,skill,curriculum,longdesc,platformcompatibility,specialmsg,teaches,licenselegal,licnonlic,license,language,pricetier,category,us,ca,uk,ie,au,row,fr_fr,fr_ca,fr_row) values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)\")\n (2..spreadsheet.last_row).each do |i|\n row = Hash[[header, spreadsheet.row(i)].transpose]\n\n # 2. INSERT DATA TO DATABASE\n insert_data pstmt, row\n end\n\n # 3. UPDATE DATA FOR LOCALE\n update_locale connection\n connection.con.commit # commit transaction\n\n return '<p class = \"alert alert-success\">MOAS file is imported successfully!</p>'\n rescue => e\n connection.con.rollback # rollback transaction\n return '<p class = \"alert alert-error\">PLEASE SELECT CORRECT TABLE. <br/>' << e.message << '</p>'\n ensure\n connection.close_connection if connection\n end # end begin transaction\n end", "def index\n @operators = Operator.all\n respond_to do |format|\n format.xlsx\n end\n end", "def open_spreadsheet(file)\n if file.class == ActionDispatch::Http::UploadedFile\n Rails.logger.info \"-=-=-=#{file.path}\"\n case File.extname(file.original_filename)\n when \".csv\" then convert(file.path)\n when \".xls\" then Roo::Excel.new(file.path, nil, :ignore)\n when \".xlsx\" then Roo::Excelx.new(file.path,nil,:ignore)\n when \".ods\" then Roo::OpenOffice.new(file.path,false,:ignore)\n when \".gpx\" then GpxParser.new.convert(file.path)\n else raise \"Unknown file type: #{file.original_filename}\"\n end\n else\n x = write_temp_file(CSV.parse(open(file) {|f| f.read}))\n spreadsheet = convert(x)\n cleanup_temp_file(x)\n spreadsheet\n end\n end", "def report; end", "def report; end", "def report; end", "def report; end", "def report; end", "def run!\n if valid_header?\n @report = Runner.call(header: header, rows: rows, config: config)\n else\n @report\n end\n rescue CSV::MalformedCSVError => e\n @report = Report.new(status: :invalid_csv_file, parser_error: e.message)\n end", "def upload_product_excel\n require 'spreadsheet'\n\n @excel = Excel.new(name: 'Excel_upload', parse_errors: nil, spreadsheet: params[:file])\n \n logger.info \"********* File: #{params[:file]}\"\n logger.debug \"********** Errors: #{@excel.errors.full_messages}\"\n open_part = Spreadsheet.open(params[:file].tempfile.path)\n\n part = open_part.worksheet(0)\n \n #skip the first column of each row.\n part_row = part.row(1)\n part_size = part.count\n if part_size <= 2\n\n #pulls out the name which is the part number of the product\n #(needs to be a string)\n @excel.part_num = part_row[0].to_int.to_s\n\n #pulls out the category from the product sheet\n #(needs to be a string given the dash in the category)\n @category = part_row[1].to_s\n\n #pulls out the Description from the product sheet\n #(needs to be a string and will have to work to ensure this works when putting into a text format)\n @excel.description = part_row[2].to_s\n\n #pulls out the Item Tax Code\n #(Not sure on this one need to figure out)\n @item_tax_code = part_row[3]#what is this column numbers and letters? Just Numbers\n\n #pulls out the Unit Price of the item\n #(needs to be a decimal)\n @excel.price = part_row[4]\n\n #pulls out the Last purchase cost\n #(needs to be a decimal)\n @excel.LastPurchasecost = part_row[5]\n\n #pulls out the product length (in)\n #(needs to be a decimal)\n @excel.Productlength = part_row[6]\n\n #pulls out the product width (in)\n #(needs to be a decimal)\n @excel.Productwidth = part_row[7].to_s\n\n #pulls out the product height (in)\n #(needs to be a decimal)\n @excel.Productheight = part_row[8].to_s\n\n #pulls out the product weight\n #(needs to be a decimal)\n @excel.Productweight = part_row[9].to_s\n\n #Remarks\n #(needs to be a string)\n #In my opinion this needs to be removed from the table\n remarks = part_row[10].to_s\n\n #application\n #(needs to be a string)\n @excel.Application = part_row[11].to_s\n\n #Location\n #(needs to be a string)\n @excel.Location = part_row[12].to_s\n\n #Condition \n #(needs to be a string)\n condition = part_row[13].to_s\n\n #Cross Reference\n #(needs to be a string)\n @excel.CrossReference = part_row[14].to_s\n\n #Casting number\n #(needs to be an integer)\n @excel.CastingNum = part_row[15]\n unless @excel.CastingNum.nil?\n @excel.CastingNum = @excel.CastingNum.to_int\n end\n\n #Core Charge\n #(needs to be a decimal)\n @excel.CoreCharge = part_row[16]\n\n #For sale (date in which it is for sale)\n #(needs to be a string)\n @excel.ForSale = part_row[17].to_s\n\n #Online store\n #(needs to be a string for now)\n #I may request this to be removed it seems to be redundant at this point\n @excel.OnlineStore = part_row[18].to_s\n\n #IsActive\n #(needs to be a string for now)\n @excel.IsActive = part_row[19].to_s\n\n #Item\n #I believe I would like this to be removed\n item = part_row[20].to_s\n\n #location-duplicate with column [17] above.\n #(needs to be a string)\n loc = part_row[21].to_s\n\n #Sublocation\n #(needs to be a string)\n @excel.Sublocation= part_row[22].to_s\n\n #Quantity\n #(needs to be an integer)\n @excel.Quantity = part_row[23].to_int\n unless @excel.Quantity.nil?\n @excel.Quantity = @excel.Quantity.to_int\n end\n \n # @product = Product.new(name: part_name,description: descrip)\n # #redirect_to admin_product_path(@product)\n # @product.master.price = price\n # if @product.save\n # #flash[:success] = \"Product successfully saved\"\n # redirect_to edit_admin_product_url(@product)\n # else\n # flash[:success] = \"Product didn't save\"\n # end\n if @excel.save\n @product = Product.new\n @product.id = @excel.part_num\n @product.name = @excel.part_num\n @product.master.id = @excel.part_num\n @product.description = @excel.description\n @product.available_on = @excel.ForSale\n if @product.save\n flash[:success] = @product#{}\"Success\"\n else\n flash[:success] = \"Still missing something\"\n end\n\n #redirect_to admin_general_settings_url\n end\n end\n # part.each do |row|\n # #grab each name based upon the location of the data.\n # part_name = part[0]\n # part_name = part_name.to_int\n # part_name = part_name.to_s\n # end\n render :action => :upload\n end", "def open_spreadsheet(file)\n\t\tcase File.extname(file.original_filename)\n\t\twhen '.csv' then Roo::Csv.new(file.path, nil, :ignore)\n\t\twhen '.xls' then Roo::Excel.new(file.path, nil, :ignore)\n\t\twhen '.xlsx' then Roo::Excelx.new(file.path, nil, :ignore)\n\t\telse raise \"Unknown file type: #{file.original_filename}\"\n\t\tend\n\tend", "def analyze\n @analysis = Analysis.new(directory)\n @analysis.scan\n #@analysis.save!\n end", "def convert_to_stagingsXLSX(path, uploaded_io, type)\n\tfields_to_insert = %w{ AccountNum DateRead Consumption DaysUsed }\n\trows_to_insert = []\n\n\tDir[path+\"/\" + uploaded_io.original_filename].each do |file|\n\t\t #handles the first sheet and first sheet only\n file_path = \"#{file}\"\n file_basename = File.basename(file, \".xlsx\")\n xlsx = Roo::Excelx.new(file_path.to_s)\n $i = xlsx.sheets.length - 1\n\t\t xlsx.default_sheet = xlsx.sheets[0]\n\t\t headers = Hash.new\n\t\t xlsx.row(1).each_with_index {|header,i|\n\t\t headers[header] = i\n\t }\n\n \n\t\t #Looks at each row and extracts the data\n ((xlsx.first_row + 1)..xlsx.last_row).each do |row|\n\t\t\t \n\t\t acctnum = xlsx.row(row)[headers['AccountNum']]\n\t\t date = xlsx.row(row)[headers['DateRead']]\n\t\t\t amt_kwh = xlsx.row(row)[headers['Consumption']]\n\t\t\t days_used = xlsx.row(row)[headers['DaysUsed']]\n\t\t \n\t\t\t #Handles excelx formate Dates\n\t\t\t #date = DateTime.new(1899,12,30) + Integer(date).days \n\t\t\t #Creates a staging IF staging does not already exist AND IF recording with same date and acct num does not exist in the Database\n \t\t\t if !Recording.exists?(:acctnum => acctnum.to_i, :read_date=>date)\n\t\t\t \tStaging.where({\"acctnum\"=>acctnum.to_i, \"consumption\"=>amt_kwh, \"days_in_month\"=>days_used, \"read_date\"=>date, \"utility_type_id\" => type}).first_or_create(:locked => false)\n\t\t\t end\n end\n\t\t \n\t\t \n Upload.update_all( {:status => 'Processed', :process_date => Time.now}, {:file_name => uploaded_io.original_filename})\n\n end\n\n end" ]
[ "0.64008296", "0.62122273", "0.6113574", "0.6108469", "0.60747164", "0.5990229", "0.59673196", "0.5962253", "0.5925417", "0.58368325", "0.58032674", "0.57836425", "0.5761572", "0.575149", "0.57249206", "0.5722753", "0.57065755", "0.57028043", "0.569796", "0.5684169", "0.56788653", "0.5665729", "0.5657403", "0.5657076", "0.5641769", "0.56346667", "0.563411", "0.5621162", "0.5594803", "0.55827904", "0.5566278", "0.55640054", "0.55616367", "0.5542217", "0.5528121", "0.5504358", "0.549764", "0.54787195", "0.5467991", "0.54663104", "0.5449829", "0.54424846", "0.54008895", "0.5394579", "0.538441", "0.53744805", "0.53591", "0.53588694", "0.53588176", "0.53525335", "0.5349972", "0.5342612", "0.5341014", "0.53125805", "0.53029466", "0.5269641", "0.52598715", "0.52447754", "0.52317125", "0.52164805", "0.5208794", "0.5208772", "0.5207376", "0.5200933", "0.519961", "0.51987225", "0.5193596", "0.5189339", "0.5185689", "0.51764965", "0.51625603", "0.5160925", "0.5149819", "0.51487803", "0.5130429", "0.51214206", "0.51162386", "0.51064575", "0.51028484", "0.50992274", "0.5094461", "0.50897634", "0.50837594", "0.50826675", "0.50815433", "0.508046", "0.50788176", "0.5073436", "0.50668865", "0.50656176", "0.5063814", "0.5063814", "0.5063814", "0.5063814", "0.5063814", "0.50584084", "0.5056989", "0.5054988", "0.5052094", "0.504691" ]
0.5566543
30
Define a method to convert Cartesian (x,y) coordinates to Polar
def polar(x,y) theta = Math.atan2(y,x) # Compute the angle r = Math.hypot(x,y) # Compute the distance [r, theta] # The last expression is the return value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def polar_point_from(cartesian_point)\n x = cartesian_point.x\n y = cartesian_point.y\n\n r = Math.sqrt((x * x) + (y * y))\n theta = Math.atan2(y, x)\n\n # :Point is the version 2.0.0 point, so it takes r and theta\n Point.new(r, theta)\nend", "def conv_xy_to_polar(x,y)\r\n# - - - - - - - - - - - - - - - - - - - -\r\n if (x == 0)\r\n if (y >= 0)\r\n return 0\r\n else\r\n return 180\r\n end #else\r\n elsif (y == 0)\r\n if (x2 >= 0)\r\n return 90\r\n else\r\n return 270\r\n end #else\r\n end #else\r\n\r\n x = x + 0.0\r\n y = y + 0.0\r\n dist = Math.sqrt((x*x) + (y*y))\r\n slope = y / x\r\n aradian = Math.atan(slope)\r\n degrees = conv_radian_to_degree(aradian) \r\n print \"degrees before adj=\", degrees,\"\\n\"\r\n if (x > 0)\r\n if (y > 0)\r\n # Quadrent 1;\r\n degrees = degrees\r\n else\r\n # Quadrent 2\r\n degrees = 90 - degrees\r\n end # else\r\n else\r\n if (y < 0)\r\n #Quadrent 3\r\n degrees = 270 - degrees\r\n else\r\n # must be Quadrent 4\r\n degrees = 270 - degrees\r\n end # else\r\n end #else\r\n pp = CNCPolar.new(dist, degrees)\r\n return pp\r\nend", "def to_ xy_cncPolar\r\n # # # # # # # # # \r\n return conv_rectangular_to_polar(distance, angle)\r\n end", "def polar\n [abs, arg]\n end", "def cartesian(magnitude, angle)\n[magnitude*Math.cos(angle), magnitude*Math.sin(angle)]\nend", "def to_xy\n a = self\n a = [a[0].x, a[0].y] if length == 1\n return *a\n end", "def polar(x,y)\n theta = Math.atan2(y,x) # Compute the angle\n r = Math.hypot(x,y) # Compute the distance\n [r, theta] # The last expression is the return value\nend", "def polar_to_cartesian(angle, distance)\n [ Math.cos(angle), Math.sin(angle) ].map { |val| distance * val }\n end", "def to_xy\n [x, y]\n end", "def polar\n return abs, arg\n end", "def as_polar\n [r, t]\n end", "def calc_point_rotated_relative(x,y, theta)\r\n# - - - - - - - - - - - - - - - - - - - - - - - - - - -\r\n theta = conv_degree_to_radian(theta)\r\n xr= Math.cos(theta)*x - Math.sin(theta)*y \r\n yr = Math.sin(theta)*x + Math.cos(theta)*y \r\n pRes = CNCPoint.new(xr,yr)\r\nend", "def polar\n Image.run_cmplx(self) { |x| x.complex :polar }\n end", "def coordinates\n row_values.product(col_values)\n end", "def to_cncPoint\r\n # # # # # # # # # \r\n return conv_polar_to_rectangular(distance, angle)\r\n end", "def to_coordinates\n\n CGPointMake(self.x.to_coordinates, self.y.to_coordinates)\n end", "def project x1, y1, a, m\n rad = a * D2R\n [x1 + Math.cos(rad) * m, y1 + Math.sin(rad) * m]\n end", "def to_p\n Point2.new(@x, @y)\n end", "def to_coordinates\n coord = [x, y]\n coord << z if with_z\n coord << m if with_m\n coord\n end", "def perp\n self.class.new( -@y, @x )\n end", "def to_coordinates\n [latitude, longitude]\n end", "def polar_transform(radius)\n clone.polar_transform!(radius)\n end", "def to_a\n [x_point,y_point]\n end", "def to_a; [x, y] end", "def calc_point_from_angle(cx, cy, angle, length)\r\n # - - - - - - - - - - - - - - - - - - - - -\r\n #System.Convert.ToInt32(System.Convert.ToDouble(originX) * Math.Cos(radians)), originY + #System.Convert.ToInt32(System.Convert.ToDouble(originY) * Math.Sin(radians)))\r\n # radians = (90 - angle) * degree_to_radian;\r\n if (angle > 360) \r\n angle = angle % 360\r\n end #if\r\n #print \"(cx=\", cx, \" cy=\", cy, \" angle=\", angle, \", length=\", length, \")\\n\"\r\n\r\n #if (angle > 360)\r\n # angle = angle % 360.0\r\n\r\n \r\n quad = 1\r\n tang = angle\r\n\r\n## if (angle == 9999)\r\n## if (angle == 0)\r\n## return CNCPoint.new(cx, cy - length)\r\n## elsif (angle == 90)\r\n## return CNCPoint.new(cx + length, cy)\r\n## elsif(angle == 180)\r\n## return CNCPoint.new(cx, cy - length)\r\n## elsif (angle == 270)\r\n## return CNCPoint.new(cx - length, cy)\r\n## elsif(angle == 360)\r\n## return CNCPoint.new(cx, cy - length)\r\n## elsif (angle > 90)\r\n## quad = 2\r\n## tang -= 90\r\n## elsif (angle > 180)\r\n## quad = 3\r\n## tang -= 180\r\n## elsif (angle > 270)\r\n## quad = 4\r\n## tang -= 180\r\n## end #else\r\n## end # 99999\r\n## #print \"tang = \", tang, \" quad=\", quad, \"\\n\"\r\n##\r\n\r\n radians = conv_degree_to_radian(tang -90)\r\n\r\n\r\n new_x = cx + Math.cos(radians) * (length)\r\n new_y = cy + Math.sin(radians) * (length)\r\n\r\n #print \"(new_x = \", new_x, \" new_y=\", new_y, \")\\n\"\r\n##\r\n## if (angle == 9999)\r\n## case quad\r\n## when 1\r\n## # nothing needs to be done\r\n## when 2\r\n## # x is ok\r\n## #new_y = 0 - new_y\r\n## when 3\r\n## new_x = 0 - new_x\r\n## new_y = 0 - new_y\r\n## when 4\r\n## new_x = 0 - new_x\r\n## end\r\n## end # 9999\r\n##\r\n\r\n aRes = CNCPoint.new(new_x, new_y)\r\n return aRes\r\n end", "def construct_coordinates\n construct_latitude\n construct_longitude\n end", "def getPolyCoordinates(radius, lat, lon, num_sides)\r\n # Create array to the radian values of the regular polygon\r\n rads = (0..2*Math::PI).step((2 * Math::PI) / num_sides.to_f).to_a\r\n\r\n # Compute angular distance (meters)\r\n ang_dist = (radius.to_f / EARTH_RAD_M.to_f) #*(Math::PI/180.0)\r\n lat_rad = lat * Math::PI/180.0\r\n lon_rad = lon * Math::PI/180.0\r\n\r\n # Constants\r\n a = Math.sin(lat_rad) * Math.cos(ang_dist)\r\n b = Math.cos(lat_rad) * Math.sin(ang_dist)\r\n\r\n # Loop over radians (clockwise) to compute geo points of the polygon\r\n points = Array.new\r\n cnt = 0\r\n rads.each do |r|\r\n # new point latitude (in radians)\r\n new_lat = Math.asin(a + b * Math.cos(r)) \r\n\r\n # new point longitude (in radians)\r\n c = Math.cos(ang_dist) - Math.sin(lat_rad) * Math.sin(new_lat)\r\n new_lon = lon_rad + Math.atan2(Math.sin(r) * Math.sin(ang_dist) * Math.cos(lat_rad), c)\r\n\r\n # Store (in degrees)\r\n points[cnt] = {:lat => new_lat*180.0/Math::PI, :lon => new_lon*180.0/Math::PI}\r\n cnt += 1\r\n end\r\n\r\n return points\r\n end", "def projection_point(p)\n Point.project(p - p1, self.direction.to_point) + p1\n end", "def polar\n theta = 0.0\n if Point.close_to(self.x, 0)\n if self.y > 0\n theta = 90.0\n elsif self.y < 0\n theta = 270.0\n end\n else\n theta = Point.rad2deg(Math.atan(self.y/self.x))\n if self.x < 0.0\n theta += 180.0\n end\n if theta < 0.0\n theta += 360.0\n end\n end\n theta\n end", "def point(x,y)\n [x,y]\nend", "def petunin(points)\n\tif points.size() < 4\n\t\tputs \"Error on #{__LINE__} in #{__FILE__}\"\n\t\texit(1)\n\tend\n\t#return [x,x0,y,y0]\n\trect = find_rect(points)\n\tdx, phi, coef = get_transf_coef(rect)\n\tdx.each {}\n\t#rect = translate(rect, -dx[0], -dx[1])\n\trect = rotate(rect, phi)\n\trect = scale(rect, 1.0, coef)\n\n\t#points = translate(points, -dx[0], -dx[1])\n\tpoints = rotate(points,phi)\n\tpoints = scale(points, 1, coef)\n\n\tcentre = rect[0].zip(rect[2]).to_a.map { |u,v| (u+v)/2 }\n\trs = []\n\tpoints.each do |p|\n\t\trs << [dist(p, centre), p]\n\tend\n\trs = rs.sort\n\n\tres = []\n\n\trs.each do |r,p|\n\t\tel = Ellipse.new\n\t\tel.centre = centre\n\t\tel.axes = [r]*2\n\n\t\t#back\n\t\tel.scale(1, 1/coef)\n\n\t\tel.rotate(-phi)\n\t\tres << [el,p]\n\tend\n\n\treturn res\n\n\t# For testing reasons only\n\n\t#rect = scale(rect, 1, 1/coef)\n\t#points = scale(points, 1, 1/coef)\n\t#rect = rotate(rect, -phi)\n\t#points = rotate(points, -phi)\n\t#points.map! { |x| [x] }\n\n\t#points + [rect] + res.inject([]) { |sum,el| sum + [el.get_draw_data] }\nend", "def to_a\n [x, y]\n end", "def coord_geographic\n FACTORY.unproject(self.coord)\n end", "def perp\n Vect2.new(-@y, @x)\n end", "def coordinates\n [rand(50), rand(90)]\n end", "def trans(coord)\n\treturn [coord[0]+600, -coord[1]+350]\nend", "def translate_to_point(*location)\n p = Point.new(*location)\n Line.new(p, Point.new(p.x + (x2 - x1), p.y + (y2 - y1)))\n end", "def to_coordinates(x, y, size, orientation)\n coords = []\n\n if orientation == :across\n size.times do |n|\n coords << [x+n, y] \n end\n elsif orientation == :down\n size.times do |n|\n coords << [x, y+n]\n end\n end\n\n return coords\n end", "def point\n x = []\n y = []\n case geometry.type\n when 'MultiPolygon'\n coordinates.each { |list| append_list list, x, y }\n when 'LineString'\n append coordinates, x, y\n when 'Point'\n x << coordinates.first\n y << coordinates.last\n else\n append_list coordinates, x, y\n end\n lon = x.reduce(&:+) / x.size\n lat = y.reduce(&:+) / y.size\n [lon.round(7), lat.round(7)]\n end", "def grid_to_geodetic(x, y)\n # Prepare ellipsoid-based stuff.\n e2 = @flattening * (2.0 - @flattening)\n n = @flattening / (2.0 - @flattening)\n a_roof = @axis / (1.0 + n) * (1.0 + n * n / 4.0 + n * n * n * n / 64.0)\n delta1 = n / 2.0 - 2.0 * n * n / 3.0 + 37.0 * n * n * n / 96.0 - n * n * n * n / 360.0\n delta2 = n * n / 48.0 + n * n * n / 15.0 - 437.0 * n * n * n * n / 1440.0\n delta3 = 17.0 * n * n * n / 480.0 - 37 * n * n * n * n / 840.0\n delta4 = 4397.0 * n * n * n * n / 161_280.0\n\n astar = e2 + e2 * e2 + e2 * e2 * e2 + e2 * e2 * e2 * e2\n bstar = -(7.0 * e2 * e2 + 17.0 * e2 * e2 * e2 + 30.0 * e2 * e2 * e2 * e2) / 6.0\n cstar = (224.0 * e2 * e2 * e2 + 889.0 * e2 * e2 * e2 * e2) / 120.0\n dstar = -(4279.0 * e2 * e2 * e2 * e2) / 1260.0\n\n # Convert.\n deg_to_rad = Math::PI / 180\n lambda_zero = @central_meridian * deg_to_rad\n xi = (x - @false_northing) / (@scale * a_roof)\n eta = (y - @false_easting) / (@scale * a_roof)\n xi_prim = xi -\n delta1 * Math.sin(2.0 * xi) * Math.cosh(2.0 * eta) -\n delta2 * Math.sin(4.0 * xi) * Math.cosh(4.0 * eta) -\n delta3 * Math.sin(6.0 * xi) * Math.cosh(6.0 * eta) -\n delta4 * Math.sin(8.0 * xi) * Math.cosh(8.0 * eta)\n eta_prim = eta -\n delta1 * Math.cos(2.0 * xi) * Math.sinh(2.0 * eta) -\n delta2 * Math.cos(4.0 * xi) * Math.sinh(4.0 * eta) -\n delta3 * Math.cos(6.0 * xi) * Math.sinh(6.0 * eta) -\n delta4 * Math.cos(8.0 * xi) * Math.sinh(8.0 * eta)\n phi_star = Math.asin(Math.sin(xi_prim) / Math.cosh(eta_prim))\n delta_lambda = Math.atan(Math.sinh(eta_prim) / Math.cos(xi_prim))\n lng_radian = lambda_zero + delta_lambda\n lat_radian = phi_star + Math.sin(phi_star) * Math.cos(phi_star) *\n (astar +\n bstar * (Math.sin(phi_star)**2) +\n cstar * (Math.sin(phi_star)**4) +\n dstar * (Math.sin(phi_star)**6))\n [lat_radian * 180.0 / Math::PI, lng_radian * 180.0 / Math::PI]\n end", "def create_rod(sPoint, a)\r\n pts = []\r\n pts[0] = sPoint\r\n pts[1] = Geom::Point3d.new(sPoint[0] + a, sPoint[1], sPoint[2])\r\n return pts\r\nend", "def to_a\n [x, y]\n end", "def convert_coords(screen, x, y, z)\n\t\txd = x * $persp / (z + $space_size) + screen.width / 2\n\t\tyd = y * $persp / (z + $space_size) + screen.height / 2\n\t\treturn xd, yd\n\tend", "def normalize_coords(x, y)\n x = x * -1 - 1 if x < 0\n y = y * -1 - 1 if y > -1\n [x, y]\n end", "def to_a\n [x, y]\n end", "def coordinate_array\n\t\t[latitude,longitude]\n\tend", "def new_coords(x, y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end", "def new_coords(x,y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end", "def coords\n [x, y]\n end", "def coord2pos(x, y)\n (y % h)*w+(x % w)\n end", "def proxy_coord\n execute(:proxy, :coord).to_a\n end", "def create_projected_point_from_projected_coord(x, y)\n Rails.logger.debug \"RgeoGeometryAdapter Creating projected point geometry from x = #{x}, y = #{y}\"\n @geometry_factory.projection_factory.point(x, y) \n end", "def relative_coords(x, y)\n diameter = Cfg.galaxy_zone_diameter\n\n # Calculate coordinate in zone. Ensure that in-zone coordinate is\n # calculated correctly if absolute coord is negative.\n calc_coord = lambda do |c|\n return c % diameter if c >= 0\n mod = c.abs % diameter\n mod == 0 ? 0 : diameter - mod\n end\n\n [calc_coord[x], calc_coord[y]]\n end", "def to_p\n Point3.new(@x, @y, @z)\n end", "def coordquery(p)\r\nend", "def perpendicular\n Vector2d.new(-y, x)\n end", "def to_a\n if defined?(@to_a)\n @to_a\n else\n cs = self.coord_seq\n @to_a = if self.has_z?\n [ cs.get_x(0), cs.get_y(0), cs.get_z(0) ]\n else\n [ cs.get_x(0), cs.get_y(0) ]\n end\n end\n end", "def to_image_space p, origin_x, origin_y\n {x: (origin_x - @scale * (p[0] * @canonical_x[0] + p[1] * @canonical_x[1] + \n p[2] * @canonical_x[2] + p[3] * @canonical_x[3])),\n y: (origin_y + @scale * (p[0] * @canonical_y[0] + p[1] * @canonical_y[1] + \n p[2] * @canonical_y[2] + p[3] * @canonical_y[3]))};\n end", "def to_polar(value) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity\n value = case true # rubocop:disable Lint/LiteralAsCondition\n when value.instance_of?(TrueClass) || value.instance_of?(FalseClass)\n { 'Boolean' => value }\n when value.instance_of?(Integer)\n { 'Number' => { 'Integer' => value } }\n when value.instance_of?(Float)\n if value == Float::INFINITY\n value = 'Infinity'\n elsif value == -Float::INFINITY\n value = '-Infinity'\n elsif value.nan?\n value = 'NaN'\n end\n { 'Number' => { 'Float' => value } }\n when value.instance_of?(String)\n { 'String' => value }\n when value.instance_of?(Array)\n { 'List' => value.map { |el| to_polar(el) } }\n when value.instance_of?(Hash)\n { 'Dictionary' => { 'fields' => value.transform_values { |v| to_polar(v) } } }\n when value.instance_of?(Predicate)\n { 'Call' => { 'name' => value.name, 'args' => value.args.map { |el| to_polar(el) } } }\n when value.instance_of?(Variable)\n # This is supported so that we can query for unbound variables\n { 'Variable' => value }\n else\n { 'ExternalInstance' => { 'instance_id' => cache_instance(value), 'repr' => value.to_s } }\n end\n { 'value' => value }\n end", "def coordinates\n [@y_location, @x_location]\n end", "def coordinates\n\t coordinate_array.map(&:to_s).join(\",\")\n\tend", "def coords; {:x => @x, :y => @y} end", "def to_outer(point)\n transform * point\n end", "def pos_to_a\r\n [ pos.x, pos.y ]\r\n end", "def to_chipmunk\n\t\tself.normalize!\n\t\t@points.collect { |point| vec2(point[0] - self.center_x, point[1] - self.center_y) }\n\tend", "def new_coord\n [@position, @@move[@direction]].transpose.map { |coord| coord.reduce(:+) }\n end", "def translate( *args ) \n ## From Martin Rinehart 'Edges to Rubies' chapter 15\n ## May be called with a transformation and a vector, \n ## or with a transformation and r, g, b values.\n\n trans = args[0]\n if args.length == 2\n vec = args[1]\n r = vec[0]; g = vec[1]; b = vec[2] \n else\n r = args[1]; g = args[2]; b = args[3] \n end\n arr = trans.to_a()\n arr[12] += r; arr[13] += g; arr[14] += b \n return Geom::Transformation.new( arr )\n \n\tend", "def poly_vec2s\n points.map do |point|\n x,y = point.split(\",\").map {|p| p.to_i }\n CP::Vec2.new(x,y)\n end.reverse\n end", "def to_gpos\n Point[ self.x, self.y ]\n end", "def perpendicular\n Vector2d.new(-@y, @x)\n end", "def position\n [x, y]\n end", "def to_point\n if length == 2\n p = Point.new(*self)\n elsif length == 1\n p = self[0].clone\n end\n return p\n end", "def vector_to(point2)\n end", "def api\n CLLocationCoordinate2DMake(latitude, longitude)\n end", "def coords(x, y)\n return [x % WIDTH, y % HEIGHT]\n end", "def to_coord\n self[:to_coord].to_sym unless self[:to_coord].blank?\n end", "def coordinates\n return 166, 72\n end", "def rotate\n g = Grid.new\n self.each do |point,v|\n g[Point.new(point.y,point.x)] = v\n end\n (0..g.height - 1).each do |y|\n ( 0..g.width/2.ceil - 1 ).each do |x|\n tmp = g[Point.new(x,y)]\n g[Point.new(x,y)] = g[Point.new(g.width - x - 1, y )]\n g[Point.new(g.width - x - 1,y)] = tmp\n end\n end\n g\n end", "def t2p(x, y)\n Vct.new(y, g_height - x)\n end", "def to(x,y)\n\t\t\tdx = x - @attributes[:cx]\n\t\t\tdy = y - @attributes[:cy]\n\t\t\tr = (dx**2 + dy**2)**(0.5)\n\t\t\t@attributes[:r] = r\n\t\t\t\n\t\t\tyield self if block_given?\n\t\t\treturn self\n\t\tend", "def asteroid_relative(x,y,grid)\n\tpoints = Hash.new\n\tx_root, y_root = x, y\n\tgrid.each do |(x, y), value|\t\t\n\t\tpoints[[x,y]] = Point.from_offset(x_root, y_root, x, y)\n\tend\n\tpoints\nend", "def *(coef)\n Point.new(@x * coef, @y * coef)\n end", "def to_array\n @points.collect { |p| [p.x, p.y] }\n end", "def calc_point_rotated_abs(x,y, angle)\r\n# - - - - - - - - - - - - - - - - - - - - - - - - - -\r\n curr_angle = calc_angle(0,0,x,y)\r\n rel_amt = angle - curr_angle\r\n return calc_point_rotate_relative(x,y,rel_amt)\r\nend", "def sph2cart(azimuth, elevation)\n {\n # x: 180 * Math.cos(elevation) * Math.cos(azimuth),\n # y: 180 * Math.cos(elevation) * Math.sin(azimuth)\n x: 180 * Math.cos(elevation) * Math.sin(azimuth),\n y: 180 * Math.cos(elevation) * Math.cos(azimuth)\n\n }\n end", "def inverse_latlon (x, y, z = nil)\n return inverse_latlon(x, y, z)\n end", "def rotate_x(r, phi)\n s, c = Math.sin(phi), Math.cos(phi)\n a_10 = c * r[1][0] + s * r[2][0]\n a_11 = c * r[1][1] + s * r[2][1]\n a_12 = c * r[1][2] + s * r[2][2]\n a_20 = - s * r[1][0] + c * r[2][0]\n a_21 = - s * r[1][1] + c * r[2][1]\n a_22 = - s * r[1][2] + c * r[2][2]\n return [\n r[0],\n [a_10, a_11, a_12],\n [a_20, a_21, a_22]\n ]\n rescue => e\n raise\n end", "def internal_coordinates(axes)\n raise TypeError unless axes.is_a?(Mageo::Axes)\n\n axes = axes.to_a\n Mageo::Vector3DInternal[ *(Malge::SimultaneousEquations.cramer(axes.transpose, self)) ]\n end", "def project_to_plane\n end", "def new_polar( angle_rad, magnitude )\n self.new( Math::cos(angle_rad)*magnitude,\n Math::sin(angle_rad)*magnitude )\n end", "def rotate_around!(degrees, origin=Point.empty)\n result = self.to_point.rotate_around(degrees, origin)\n self.x = result.x\n self.y = result.y\n return result\n end", "def to_xyz\n [x, y, z]\n end", "def coordinates\n [latitude, longitude]\n end", "def position\n [ @x, @y, COMPASS[@orientation].to_s ]\n end", "def set_polar!( angle_rad, mag )\n raise \"can't modify frozen object\" if frozen?\n @x = Math::cos(angle_rad) * mag\n @y = Math::sin(angle_rad) * mag\n @hash = nil\n self\n end", "def gecos=(p0) end", "def test_Complex_InstanceMethods_polar\n\t\tassert_equal([1.4142135623730951, 0.7853981633974483], Complex(1,1).polar)\n\t\t# TODO, why? assert_equal([3.605551275463989, -2.158798930342464], Complex(-2,-3).polar)\n\tend", "def point_f2p_new(coord)\n begin\n x = coord.x * (@top_right.x - @top_left.x) + coord.y * (@bottom_left.x - @top_left.x) + @top_left.x\n y = coord.x * (@top_right.y - @top_left.y) + coord.y * (@bottom_left.y - @top_left.y) + @top_left.y\n BPoint.new(x, y)\n rescue\n BPoint.new(0,0)\n end\n end", "def to_s\n \"p(#{x}, #{y})\"\n end", "def get_arr_x(x, y) \n x # this coordinate doesn't change\nend" ]
[ "0.6862843", "0.68368924", "0.6514294", "0.6133643", "0.6102403", "0.5994406", "0.58908045", "0.58871937", "0.58569163", "0.58474165", "0.58176476", "0.5815184", "0.57731026", "0.57540697", "0.56985474", "0.5649324", "0.55834126", "0.55675286", "0.552164", "0.550067", "0.5478704", "0.5463872", "0.53599465", "0.53528655", "0.5309041", "0.529905", "0.5293766", "0.5265804", "0.5260694", "0.523849", "0.5233993", "0.5201187", "0.5163659", "0.5112095", "0.5106355", "0.5101614", "0.5081882", "0.50746036", "0.507001", "0.5067671", "0.5057134", "0.50466853", "0.5045981", "0.50399375", "0.5036867", "0.5036362", "0.5036274", "0.5032689", "0.5032629", "0.50321406", "0.50278217", "0.50203097", "0.5017795", "0.50105643", "0.49839166", "0.4974412", "0.49607185", "0.49578744", "0.49522913", "0.4936291", "0.4914686", "0.4912444", "0.49040142", "0.48944795", "0.48831788", "0.48735005", "0.48692146", "0.48691002", "0.4867675", "0.4865019", "0.48512256", "0.48509625", "0.48498532", "0.48295918", "0.48187128", "0.48115024", "0.48035496", "0.48006418", "0.4787589", "0.47867525", "0.47798768", "0.47762263", "0.47744492", "0.4772886", "0.4764996", "0.47647455", "0.4759977", "0.47592157", "0.47563282", "0.4755384", "0.47533232", "0.47515118", "0.47390223", "0.47362775", "0.47329208", "0.47294703", "0.47270834", "0.47256154", "0.47230557", "0.47174746" ]
0.5906633
6
trying to define instance level var
def instance_var @instance_var end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def instance_variables() end", "def initialize\n @instance_variable = 3 # Available in instance methods\n end", "def instance_variables; end", "def class_variables() end", "def instance_var\n @instance_var\n end", "def instance_var\n @instance_var\n end", "def instance_var\n @instance_var\n end", "def class_variables; end", "def instance_variable_get(p0) end", "def class_variables\n end", "def instance_var=(value)\n @instance_var = value\n end", "def instance_var=(value)\n @instance_var = value\n end", "def instance_var=(value)\n @instance_var = value\n end", "def instance_var=(value)\n @instance_var = value\n end", "def instance_var\r\n @@class_variable\r\n end", "def add_instance_variable( name , type)\n self.instance_type = instance_type.add_instance_variable( name , type )\n end", "def add_instance_variable( name , type)\n self.instance_type = instance_type.add_instance_variable( name , type )\n end", "def add_instance_variable( name , type)\n @instance_type = @instance_type.add_instance_variable( name , type )\n end", "def instance_variable_set(p0, p1) end", "def instance_variable_name; end", "def nonsense_with_instance_var\n nonsense\n end", "def variable; end", "def variable; end", "def instance_variable_names; end", "def initialize\n @ivar = \"ivar\"\n end", "def instance=(instance); end", "def instance_var=(value)\r\n @@class_variable = value\r\n end", "def instance instance_var\n s = eval(\"self\", binding)\n if s\n s.instance_variable_get(instance_var)\n end\n end", "def initialize(x) # constructor \n @inst = x # instance variables start with @ \n @@cla += 1 # each object shares @@cla \n end", "def initialize(inst_var)\n @inst_var = inst_var # instance variables that are initialized when new instance is created\n end", "def instance_variable(opts)\n opts = check_params(opts,[:instance_variable])\n super(opts)\n end", "def parent_variable; end", "def class_variable_set(sym,val) end", "def instance; end", "def instance; end", "def instance; end", "def instance_variable_ged name\n var = get_instance_variable name.to_s[1 .. -1].to_sym\n #puts \"getting #{name} #{var}\"\n var\n end", "def class() end", "def custom_initialize_instance_variables\n @open_selector_bracket_detected = false\n @open_function_detected = false\n @open_include_detected = false\n @parents_stash = []\n @root_selectors = []\n @all_selectors = []\n @all_mixins = []\n @all_includes = []\n @all_properties = []\n end", "def main_variable ; end", "def __main_object\n @relvar\n end", "def sum\r\n puts \"Hello\"\r\n puts @instance_var #wont be shown\r\n end", "def class_variable=(value)\n @@class_variable = value \n end", "def init_class_vars \n @@untgv_jmptbl ||= initcvar_jmptbl_untagged_vlan \n end", "def class_variable_get(sym) end", "def ivar\n @an_ivar\n end", "def class=(_arg0); end", "def init; end", "def init; end", "def init; end", "def init; end", "def name #use and initlizer to set name as an instance variable\n @name\nend", "def init_var(var, value)\n # instance_var_name starts with @, var_name doesn't.\n var = var.to_s\n var_name = (var.start_with?('@') ? var[1..-1] : var).to_sym\n instance_var_name = \"@#{var_name}\".to_sym\n\n instance_variable_set(instance_var_name, value)\n\n Document.send(:define_method, var_name) do\n instance_variable_get(instance_var_name)\n end\n end", "def instance\n local.value\n end", "def initialize(x)\t\t# constructor\r\n\t\t@inst = x \t\t\t# instance variable start with @\r\n\t\t@@cla += 1\t\t\t# each object shares @@cla\r\n\tend", "def local_variables() end", "def instance_type=(_arg0); end", "def initialize # instance method with class variable \n @@number_of_dogs += 1 # we can access class variables from within instance method\n end", "def ivg(o,vn)\n o.instance_variable_get(vn.to_s)\nend", "def initialize\n @level = level_for_env\n end", "def level_constructor_mod; self.class.level_constructor_mod(level); end", "def __e__\n @__e__ ||= EspressoFrameworkInstanceVariables.new self\n end", "def storage_instance=(_arg0); end", "def setup_instance_vars\n @match_data[:instance_vars].each_key do |var|\n instance_variable_set(\"@#{var}\", @match_data[:instance_vars][var])\n end if @match_data[:instance_vars]\n @response[:code] = @match_data[:set_response_code] if @match_data[:set_response_code]\n end", "def instance_eval\n end", "def get!(instance)\n instance.instance_variable_get(@instance_variable_name)\n end", "def add_instance_variable( name , type )\n raise \"No nil name\" unless name\n raise \"No nil type\" unless type\n hash = to_hash\n hash[name] = type\n return Type.for_hash( object_class , hash)\n end", "def variables_instance\n warn 'i dont like this!'\n []\n end", "def initialize\n @@count += 1\n @count = @@count #@count is a instance variable- can be accessed outside of this method \n fed = true #local variable- cannot be accessed outside of this method \n end", "def variables; end", "def variables; end", "def init; end", "def process_instance(item)\n @instance = Yarpler::Models::Instance.new\n @instance.variable = item[0].to_s\n end", "def instance_variable_defined?(p0) end", "def eoutvar\n self\n end", "def main_variable\r\n super\r\n # Get actor\r\n @actor = $game_actors[$game_temp.name_actor_id]\r\n end", "def ivar_name; end", "def a_init\nend", "def var\n @variable_pipeline ||= VariablePipeline.new(self)\n end", "def var *args\n TheDude::Variable.new(*args).register\n end", "def instance_helper\n\tend", "def initialize\n\t\t@age = 10#age aqui es una variable de instancia\n\tend", "def init\n end", "def init\n end", "def init\n end", "def at_init\n\n\t\tend", "def initialize(my_var)\n @my_var = my_var\nend", "def get!(instance)\n instance.instance_variable_get(instance_variable_name)\n end", "def initialize(*args)\n set_instance_variables args\n end", "def variable(*args)\n Variable.new(self, *args)\n end", "def variable(*args)\n Variable.new(self, *args)\n end", "def instantiate!; end", "def add_inst_vars(keys)\n keys.each do |k|\n instance_variable_set \"@#{k}\", @data[k]\n self.class.attr_accessor k unless respond_to?(k)\n end\n end", "def = 3", "def var\n @_var ||= MXNet::Symbol.var(@name, shape: shape, dtype: dtype,\n lr_mult: lr_mult, wd_mult: wd_mult,\n init: @init) # FIXME: init -> initializer\n end", "def process_ivar(exp)\n ivar = exp.shift\n ivar_name = @model.encode_instance_variable(ivar)\n @read_instance_variables.add(ivar_name)\n resultify(\"#{@model.encode_self}.#{ivar_name}\")\n end", "def add_instance_getters_and_setters(var)\n singleton = (class << self; self end)\n singleton.send :define_method, var.to_sym do\n instance_variable_get \"@#{var}\"\n end\n singleton.send :define_method, \"#{var}=\".to_sym do |val|\n instance_variable_set \"@#{var}\", val\n end\n end", "def initialize()\n\t\t@@obj_count += 1\n\tend", "def attr_reader(*)\n end", "def global_variables() end" ]
[ "0.74709916", "0.7251796", "0.7014968", "0.700275", "0.69237417", "0.69237417", "0.69237417", "0.6682963", "0.6671017", "0.6574419", "0.65688634", "0.65688634", "0.65688634", "0.65688634", "0.6534804", "0.6492501", "0.6492501", "0.64875686", "0.6458459", "0.64561015", "0.64121044", "0.6355673", "0.6355673", "0.6313442", "0.63030237", "0.62788856", "0.626849", "0.6263908", "0.6246212", "0.6213423", "0.61939126", "0.6178873", "0.6128623", "0.61104256", "0.61104256", "0.61104256", "0.6109618", "0.61036795", "0.61013997", "0.6094497", "0.60810083", "0.6078416", "0.60182446", "0.6010236", "0.6005005", "0.59578645", "0.5941397", "0.59358776", "0.59358776", "0.59358776", "0.59358776", "0.5926839", "0.59262305", "0.58768713", "0.587485", "0.587386", "0.58708155", "0.5845447", "0.584296", "0.5840204", "0.58228403", "0.58147943", "0.5807624", "0.58073723", "0.5787713", "0.5746359", "0.5724598", "0.57236576", "0.5715627", "0.5712566", "0.5712566", "0.57121503", "0.5708021", "0.570748", "0.5693578", "0.56913054", "0.56892145", "0.5688606", "0.56869566", "0.56734425", "0.5672204", "0.56588703", "0.56567925", "0.56567925", "0.56567925", "0.5651465", "0.56505114", "0.5650092", "0.5632356", "0.56232923", "0.56232923", "0.56093436", "0.56015384", "0.5592554", "0.5590528", "0.5583382", "0.5571957", "0.5570956", "0.55650765", "0.55615085" ]
0.6944287
4
A method named "x". Always returns 1
def test p x # No variable has been seen; refers to method above: prints 1 # The line below is never evaluated, because of the "if false" clause. But # the parser sees it and treats x as a variable for the rest of the method. x = 0 if false p x # x is a variable, but has never been assigned to: prints nil x = 2 # This assignment does get evaluated p x # So now this line prints 2 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def x; 1; end", "def x\n end", "def x\n end", "def x\n end", "def x; end", "def x; end", "def x; end", "def x; end", "def x; end", "def x() @x end", "def x\n 0\n end", "def x \n @x \n end", "def x #getter method\n\t\t@x\n\tend", "def s(x); 1; end", "def x\n @x\n end", "def foo (x)\nend", "def x; self[X]; end", "def x; self[X]; end", "def x; self[X]; end", "def f(x)\n return x + 1\nend", "def method\r\n\t1\r\nend", "def x()\n @view__.x\n end", "def plusOne(x)\n\tputs x+1\nend", "def getX() \n @x \n end", "def get_x; \t\t@x \t\t\tend", "def method3(x)\n x * 2\n end", "def x1; p1.x; end", "def getX\n @x\n end", "def x!() @x.value end", "def return_value(x)\n\tif x > 1\n\t\treturn x\n\telse\n\tend\nend", "def x(n)\n end", "def x() self[0]; end", "def f(x)\n x*(x+1)\nend", "def sqr(x)\n puts x*x\nend", "def cnt; xparam(6); end", "def x\n attr('x')\n end", "def x(y)\n raise NotImplementedError, \"Define #{__method__}() in the inherited class.\"\n end", "def name\n \"x\"\n end", "def x; return self[0]; end", "def m(x) x end", "def x=(x)\n end", "def sqr(x)\n x * x\nend", "def bar\n 1\nend", "def square(x)\n x*x\nend", "def square(x)\n x*x\nend", "def f\n 1\n end", "def E\n @x += 1\n end", "def mev; xparam(4); end", "def square(x)\n x*x\nend", "def a\n 1\nend", "def square(x)\nend", "def x\n self[0]\n end", "def my_method\n 100\nend", "def my_method\n 100\nend", "def square(x)\n\tx*x\nend", "def calc(x)\n puts x*3\nend", "def value(x)\n @mf1.value(x).send( @operate, @mf2.value(x))\n end", "def square(x)\n x*x\n end", "def square (x)\n return x * x\nend", "def add_two(x)\n\tx + 5\nend", "def square(x) # Define a method named square with one parameter x\n x*x # Return x squared\nend", "def square(x)\n x * x\n end", "def square(x)\n x * x\n end", "def foo()\n x = 0\n p(x)\nend", "def call(f)\n CAS::Help.assert(f, Hash)\n\n s = (@x.call(f) >= 0 ? 1 : -1)\n return s * @x.call(f)\n end", "def fun(x)\n puts x\nend", "def x\n @components[:x]\n end", "def f() 1 end", "def square(x)\n x ** 2\nend", "def double(x)\n puts x * 2\nend", "def xx\n raise InvalidInstruction\n end", "def x\n # ...\nrescue\n # ...\nend", "def y; end", "def y; end", "def y; end", "def double x \n x + x\nend", "def y() self[1]; end", "def addOne(x=5)\n\tputs x +_1\nend", "def x\n @virtual_x ||= @x\n end", "def foo\n 123\nend", "def equal_to_four (x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def x\n @p[0]\n end", "def x\n @p[0]\n end", "def f(x)\n 0.4 * x + 1\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend", "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\nend" ]
[ "0.8067429", "0.78561586", "0.78128403", "0.78128403", "0.7523853", "0.7523853", "0.7523853", "0.7523853", "0.7523853", "0.74262017", "0.7038661", "0.70056593", "0.69737977", "0.69182026", "0.6849324", "0.6677228", "0.6626888", "0.6626888", "0.6626888", "0.6568128", "0.6531439", "0.64945906", "0.64673316", "0.6382368", "0.63074243", "0.6284517", "0.62458146", "0.62080526", "0.62000763", "0.61677194", "0.6132045", "0.6114419", "0.61063206", "0.6101806", "0.608337", "0.6059269", "0.60290015", "0.6005726", "0.5940726", "0.593005", "0.59242404", "0.59214735", "0.59208786", "0.5891484", "0.5891484", "0.58871305", "0.5885448", "0.58803564", "0.5870325", "0.58544517", "0.5852314", "0.5849364", "0.58407515", "0.58407515", "0.5830584", "0.58087784", "0.5807133", "0.5796387", "0.57922167", "0.57691795", "0.5762626", "0.5759648", "0.5759648", "0.57553035", "0.5737794", "0.5731313", "0.5723838", "0.571713", "0.57167715", "0.5713027", "0.57118285", "0.5705014", "0.5694537", "0.5694537", "0.5694537", "0.56857324", "0.5684335", "0.5672071", "0.56711125", "0.56701344", "0.56626886", "0.5648148", "0.5648148", "0.5644097", "0.5625188", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954", "0.5624954" ]
0.0
-1
Recursivly call the transformer_worker with all the the compound data we have collected in the first pass
def transform_and_load_compounds! compound_records.each_slice(batch_size) do |compound_records_batch| transformer_worker_klass.perform_async( compound_records_batch, solr_config, cdm_endpoint, oai_endpoint, field_mappings, batch_size ) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run_and_transform; end", "def each_needed_transformation(&block)\n if !block_given?\n return enum_for(:each_needed_transformation)\n end\n\n needed_transformations.each(&block)\n supercall(nil, :each_needed_transformation, &block)\n end", "def run\n\n # Gets possible data source(s)\n service(:sniffer).exec\n\n # Filters the data source(s) to extract the relevant only.\n service(:filter).exec\n\n # ETL\n context[:to_be_extracted].each_with_index do |ds, i|\n log.debug \"starting ETL, idx=#{i + 1}\"\n context[:extract] = ds\n service(:extractor).exec\n service(:transformer).exec\n service(:loader).exec\n end\n\n log.info 'Bye bye'\n end", "def pump_results!\n loop do\n distribute_results!\n end\n end", "def do_work\n until @worker_input_queue.empty?\n @output_queue << yield(@worker_input_queue.pop)\n end\n end", "def each_transform_input(&block)\n transform_inputs.each(&block)\n supercall(nil, :each_transform_input, &block)\n end", "def perform\n track do\n runner.tick!\n @changes = Hash.new { |h, k| h[k] = Accumulator.new }\n\n @registry.each do |mapping|\n mapping.for_worker(self) do\n task(\"PROPAGATING RECORDS\", mapping) { propagate mapping }\n task(\"CLEANING RECORDS\", mapping) { clean mapping }\n task(\"COLLECTING CHANGES\", mapping) { collect mapping }\n task(\"UPDATING ASSOCIATIONS\", mapping) { associate mapping }\n end\n end\n\n # NOTE: We can only perform the synchronization after all record\n # changes have been aggregated, so this second loop is necessary.\n @registry.each do |mapping|\n mapping.for_worker(self) do\n task(\"APPLYING CHANGES\", mapping) { synchronize mapping }\n end\n end\n end\n end", "def perform\n @analysis = Analysis.find(@analysis_id)\n\n # get the analysis and report that it is running\n @analysis_job = AnalysisLibrary::Core.initialize_analysis_job(@analysis, @analysis_job_id, @options)\n\n # reload the object (which is required) because the sub-documents (jobs) may have changed\n @analysis.reload\n\n # Create an instance for R\n begin\n logger.info \"Initializing analysis for #{@analysis.name} with UUID of #{@analysis.uuid}\"\n logger.info \"Setting up R for #{self.class.name}\"\n\n selected_variables = Variable.variables(@analysis.id)\n logger.info \"Found #{selected_variables.count} non-default variables in the batch datapoint set.\"\n\n # generate the probabilities for all variables as column vectors\n samples = nil\n\n logger.info 'Starting batch datapoint extraction.'\n\n # Iterate through each variable based on the method and add to the samples array in the form of\n # [{a: 1, b: true, c: 's'}, {a: 2, b: false, c: 'n'}]\n values_length = []\n values_set = {}\n\n selected_variables.each do |var|\n if var.map_discrete_hash_to_array.nil? || var.discrete_values_and_weights.empty?\n raise \"no hash values and weight passed in variable #{var.name}\"\n end\n\n values, weights = var.map_discrete_hash_to_array\n raise \"'nil' value(s) found in variable #{var.id}. nil values not yet supported.\" if values.count(&:nil?).nonzero?\n\n values_length = values_length << values.length\n values_set[var.id.to_s.to_sym] = values\n end\n\n raise 'Length of discrete_values passed in variables was not equal across variables.' if values_length.uniq.length != 1\n\n # Create Datapoint Samples\n logger.info 'Creating datapoint samples'\n samples = []\n for i in 0..(values_length[0] - 1)\n instance = {}\n selected_variables.each do |var|\n instance[var.id.to_s.to_sym] = values_set[var.id.to_s.to_sym][i]\n end\n samples << instance\n end\n\n # Add the datapoints to the database\n logger.info 'Adding the datapoints to the database'\n isample = 0\n da_options = @analysis.problem['design_alternatives'] ? true : false\n samples.each do |sample| # do this in parallel\n name = \"Autogenerated #{isample}\"\n description = \"Autogenerated #{isample}\"\n seed_path, da_descriptions, weather_file = false\n if da_options\n instance_da_opts = @analysis.problem['design_alternatives'][isample]\n name = instance_da_opts['name'] if instance_da_opts['name']\n description = instance_da_opts['description'] if instance_da_opts['description']\n seed_path = File.basename instance_da_opts['seed']['path'] if instance_da_opts['seed']\n weather_file = File.basename instance_da_opts['weather_file']['path'] if instance_da_opts['weather_file']\n if instance_da_opts['options']\n da_descriptions = []\n @analysis.problem['workflow'].each do |step_def|\n wf_da_step = instance_da_opts['options'].select { |h| h['workflow_index'].to_i == step_def['workflow_index'].to_i }\n if wf_da_step.length != 1\n raise \"Invalid OSA; multiple workflow_index of #{step_def['workflow_index']} found in the design_alternative options\"\n else\n wf_da_step = wf_da_step[0]\n end\n\n da_descriptions << { name: wf_da_step['name'], description: wf_da_step['description'] }\n end\n end\n end\n dp = @analysis.data_points.new(name: name, description: description)\n dp.da_descriptions = da_descriptions if da_descriptions\n dp.seed = seed_path if seed_path\n dp.weather_file = weather_file if weather_file\n dp.set_variable_values = sample\n dp.save!\n isample += 1\n logger.info(\"Generated datapoint #{dp.name} for analysis #{@analysis.name}\")\n end\n ensure\n # Only set this data if the analysis was NOT called from another analysis\n unless @options[:skip_init]\n @analysis_job.end_time = Time.now\n @analysis_job.status = 'completed'\n @analysis_job.save!\n @analysis.reload\n end\n @analysis.save!\n\n logger.info \"Finished running analysis '#{self.class.name}'\"\n end\n end", "def call(_worker, job, _queue, _pool)\n job[\"args\"].map!(&:serialize)\n yield\n end", "def perform_transformation(msg)\n self.send(@transformation_block, msg)\n end", "def each_transform_input\n return enum_for(:each_transform_input) if !block_given?\n if !(tr = model.transformer)\n return\n end\n\n model.each_transform_input do |port, from, to|\n from = selected_frames[from]\n to = selected_frames[to]\n yield(port.bind(self), from, to)\n end\n end", "def load(data)\n clear_transformed_data!\n data = [data] unless data[0].kind_of? Array\n data.each do |data| \n templated_data = apply_template(data)\n sets = result_sets(templated_data)\n sets.map! do |set|\n transform(set)\n end\n @transformed_values.push sets\n end\n self\n end", "def transform! &block\n @transformer||=[]\n @transformer << block if block_given?\n self\n end", "def each_transform_output(&block)\n transform_outputs.each(&block)\n supercall(nil, :each_transform_output, &block)\n end", "def call(*args)\n\t\tif @block\n\t\t\t# run sub-transform as defined by this closure\n\t\t\treturn @block.call @vars, *args\n\t\telse\n\t\t\t# return unmodified data\n\t\t\treturn *args\n\t\tend\n\tend", "def transform!\n raise NotImplementedError, \"You have to implement #transform! in your transformer\"\n end", "def process(model, data_set)\n if @data_set.is_a?(Array)\n @data_set.each do |data|\n process_data(model, data)\n end\n else\n process_data(model, @data_set)\n end\n end", "def process\n # start with the original as if it was the last destination\n tasks.each do |t|\n process_task(t)\n end\n close_files\n\n result_details\n end", "def perform_processing_run(faids)\n perform_analysis(faids)\n perform_processing!\n end", "def process_data\n raise NotImplementedError\n end", "def each_transformation(&block)\n if !block_given?\n return enum_for(:each_transformation)\n end\n\n seen = Set.new\n needed_transformations.each do |trsf|\n key = [trsf.from, trsf.to]\n if !seen.include?(key)\n seen << key\n yield(trsf)\n end\n end\n transform_inputs.each_value do |trsf|\n key = [trsf.from, trsf.to]\n if !seen.include?(key)\n seen << key\n yield(trsf)\n end\n end\n transform_outputs.each_value do |trsf|\n key = [trsf.from, trsf.to]\n if !seen.include?(key)\n seen << key\n yield(trsf)\n end\n end\n\n supercall(nil, :each_transformation, &block)\n end", "def parallelize_me!; end", "def run_all\n perform\n end", "def run_all\n perform\n end", "def run_internal\n log.debug(\"Loading in slices of #{@row_slice_size} rows\")\n reader.each_row_slice(@row_slice_size, @batch) do |rows|\n load_slice(rows)\n end\n msg = \"Processed #{reader.rows_processed} input rows for #{@series}\"\n\n ETL::Job::Result.success(reader.rows_processed, msg)\n end", "def precompute_all!(date_timestamp)\n log.puts 'Querying for jobs...'\n jobs = school_overview_precompute_jobs(date_timestamp)\n log.puts \"Found #{jobs.size} jobs.\"\n\n log.puts 'Starting precomputing...'\n jobs.each_with_index do |job, index|\n precompute_and_write_student_hashes!(job[:date_timestamp], job[:authorized_student_ids])\n log.puts \"Wrote document #{index+1}...\"\n end\n log.puts 'Done.'\n end", "def process_each_sample(processor)\n # Make sure we make clones so that we aren't modifying data in\n # place\n newdata = @data.clone\n @data.keys.each { |city|\n newdata[city] = @data[city].clone\n @data[city].size.times { |sample|\n newdata[city][sample] = @data[city][sample].clone\n @data[city][sample].keys.each { |skew|\n if @data[city][sample][skew]\n newdata[city][sample][skew] = @data[city][sample][skew].clone\n ref = @data[city][sample][0] || @data[city][sample][0.to_s]\n cur = @data[city][sample][skew]\n newdata[city][sample][skew] =\n processor.call(city,sample,skew,ref,cur)\n end\n }\n }\n }\n @data = newdata\n end", "def perform\n @analysis = Analysis.find(@analysis_id)\n\n # get the analysis and report that it is running\n @analysis_job = AnalysisLibrary::Core.initialize_analysis_job(@analysis, @analysis_job_id, @options)\n\n # reload the object (which is required) because the subdocuments (jobs) may have changed\n @analysis.reload\n\n ids = []\n if @options[:data_points].empty?\n logger.info 'No datapoints were passed into the options, therefore checking which datapoints to run'\n\n # queue up the simulations\n @analysis.data_points.where(status: 'na').each do |dp|\n logger.info \"Adding #{dp.uuid} to simulations queue\"\n\n # TODO: move this method to the datapoint model\n ids << dp.submit_simulation\n end\n end\n\n logger.info \"Delayed Job ids are: #{ids}\"\n\n # Watch the delayed jobs to see when all the datapoints are completed.\n # I would really prefer making a chord or callback for this.\n until ids.empty?\n ids.each do |id|\n ids.delete(id) if Delayed::Job.find(id).nil?\n end\n\n # logger.info ids\n\n sleep 5\n end\n\n # TODO: Finalize the worker nodes\n\n rescue => e\n log_message = \"#{__FILE__} failed with #{e.message}, #{e.backtrace.join(\"\\n\")}\"\n logger.error log_message\n @analysis.status_message = log_message\n @analysis.save!\n ensure\n logger.info 'Finished running batchrun method'\n @analysis_job.end_time = Time.now\n @analysis_job.status = 'completed'\n @analysis_job.save!\n @analysis.reload\n @analysis.save!\n end", "def perform\n @worker.call\n @last_result\n end", "def doing_extract_data\n consumer = Fiber.new do |producer, queue|\n f = open(\"./tmp/database_doings/doing_phrases/phrases_ready_to_load.txt\", \"a\") do |f| \n loop do\n queue = producer.transfer(consumer, queue)\n puts f << queue\n queue.clear\n end\n raise StopIteration\n end\n end\n producer = Fiber.new do |consumer, queue|\n IO.foreach(\"./tmp/database_doings/doing_phrases/phrases_sorted.txt\") do |line| \n queue = \"\"\n puts queue\n sequence_text, sequence_creation, sequence_complete, sequence_lexigram, sequence_singular, sequence_lense, description, reference, anagram, name, phrase, research, external, internal, created_at = line.split(\"\\t\")\n extracted_data = sequence_text.to_textual\n queue << \"#{extracted_data}\\n\"\n break unless line\n consumer.transfer queue\n queue.clear\n end\n raise StopIteration\n end \n consumer.transfer(producer, [])\n after_break\n end", "def transform; end", "def transform\n end", "def process\n return if @metrics.size_all == 0\n\n collate\n write_to_disk\n end", "def process tweet, *_\n @aggregator << tweet.to_hash\n if @aggregator.size == options.buffered_docs\n response = @indexer.index_array(@aggregator)\n raise \"Your motherfucking bulk request failed.\" if response.has_failures?\n warn(\"Success\")\n @aggregator = []\n end\n end", "def next_preprocessing(save = false)\n first_preprocessing(save) if save\n next_task(nil, save)\n end", "def call(relation)\n transformers.reduce(relation.to_a) { |a, e| e.call(a) }\n end", "def each_transform_output\n return enum_for(:each_transform_output) if !block_given?\n if !(tr = model.transformer)\n return\n end\n\n model.each_transform_output do |port, from, to|\n from = selected_frames[from]\n to = selected_frames[to]\n yield(port.bind(self), from, to)\n end\n end", "def process\n demarshal\n end", "def setup\n # suppress ActiveRecord logging\n ActiveRecord::Base.logger.level = Logger::WARN\n\n @importer_run = ImporterRun.new\n @transformer = Transformer.new(context: context, transformations: transformations, options: transformation_options)\n @thread_pool = ETL::ThreadPool.new(options.pool)\n @data_scrubber = ETL::DataScrubber.new(options.destination_model)\n invoke_callback(:before_run)\n end", "def process(data)\n end", "def process_batch(records)\n benchmarks[:processing] << Benchmark.realtime do\n records.each do |record|\n next if skip_before_transform?(record)\n invoke_callback(:before_each, record)\n attrs = transformer.run(record)\n next unless attrs # skip if transformation failed\n invoke_callback(:each_before_save, attrs, record)\n next if invoke_callback(:reject_after_transform_if, attrs)\n invoke_callback(:after_each, record, attrs)\n attrs = data_scrubber.scrub!(attrs)\n \n if update?(record, attrs)\n update_attrs << attrs\n elsif create_new_records\n new_rows << attrs.values\n end\n end\n end\n end", "def process(data)\n end", "def prepare_reads(base, map, fqgz0, *fqgzs0)\n\n fqgzs = [fqgz0] + fqgzs0\n\n bcs = Hash.new\n open(map, 'r').each do |line|\n bc, well = line.rstrip.split(',')\n bcs[bc] = well\n end\n \n bcl = bcs.keys.map!{|key| key.length}.sort.uniq[0]\n\n tso_pattern = '.'*options.umi_length + '.'*bcl + 'GG'\n\n #\n \n STDERR.puts \"#{`date`.strip}: Demultiplexing each raw sequence files...\"\n \n fqgz2csv0 = Hash.new\n fqgz2csv1 = Hash.new\n fqgz2base = Hash.new\n fqgzs.each do |fqgz|\n fqgz2csv0[fqgz] = get_temporary_path('strt.preprocess', 'csv', false)\n fqgz2csv1[fqgz] = get_temporary_path('strt.preprocess', 'csv', false)\n fqgz2base[fqgz] = get_temporary_path('strt.preprocess', 'base', false)\n end\n\n Parallel.map(fqgz2csv0.keys, in_processes: options.parallel) do |fqgz|\n cmds = [\n \"unpigz -c #{fqgz}\",\n \"#{fq1l_convert_command(options)}\",\n \"#{fq1l_count_command(options)} #{fqgz2csv0[fqgz]}\",\n \"fq1l match_5end#{grep_prefix_option(options)} #{tso_pattern}\",\n \"#{fq1l_count_command(options)} #{fqgz2csv1[fqgz]}\",\n \"fq1l annotate_index --first-cycle=#{options.umi_length+1} --last-cycle=#{options.umi_length+bcl}\",\n \"fq1l annotate_umi --first-cycle=1 --last-cycle=#{options.umi_length}\",\n \"fq1l sort_index#{coreutils_prefix_option}#{parallel_option(options)} --buffer-size=#{(options.maximum_memory/(fqgz2csv0.keys.size+1)).to_i}%\",\n \"fq1l demultiplex #{fqgz2base[fqgz]} #{map}\"\n ]\n cmds.insert(2, \"#{head_command(options)} -n #{options.reads}\") unless options.reads.nil?\n stats = Open3.pipeline(*cmds)\n stats.each_index do |i|\n raise \"Fail at process #{i}; #{stats[i]}; #{cmds[i]}\" unless stats[i].success? || (stats[i].signaled? && stats[i].termsig == 13)\n end\n end\n\n system \"fq1l sum_counts #{fqgz2csv0.values.join(' ')} > #{base}.count.step1.csv\"\n unlink_files(fqgz2csv0.values)\n \n system \"fq1l sum_counts #{fqgz2csv1.values.join(' ')} > #{base}.count.step2.csv\"\n unlink_files(fqgz2csv1.values)\n\n #\n \n (bcs.values + ['NA']).each do |well|\n\n STDERR.puts \"#{`date`.strip}: Finishing well #{well}...\"\n \n tmpfqgzs = fqgz2base.values.map {|base| \"#{base}.#{well}.fq.gz\"}\n csvs = Array.new(6) {|i| \"#{base}.#{well}.count.step#{i+3}.csv\"}\n \n pipeline(\"unpigz -c #{tmpfqgzs.join(' ')}\",\n \"#{fq1l_convert_command(options)}\",\n \"#{fq1l_count_command(options)} #{csvs[0]}\",\n \"#{fq1l_sort_command} --buffer-size=#{(options.maximum_memory/2).to_i}%\",\n \"fq1l exclude_duplicate\",\n \"#{fq1l_count_command(options)} #{csvs[1]}\",\n \"fq1l trim_3end_quality\",\n \"#{fq1l_count_command(options)} #{csvs[2]}\",\n \"fq1l trim_3end_primer#{coreutils_prefix_option}#{grep_prefix_option(options)}#{parallel_option(options)}\",\n \"#{fq1l_count_command(options)} #{csvs[3]}\",\n \"#{fq1l_sort_command} --buffer-size=#{(options.maximum_memory/2).to_i}%\",\n \"fq1l exclude_degenerate\",\n \"#{fq1l_count_command(options)} #{csvs[4]}\",\n \"fq1l trim_5end --minimum-length=#{options.minimum_length} #{tso_pattern}+\",\n \"#{fq1l_count_command(options)} #{csvs[5]}\",\n \"fq1l restore#{coreutils_prefix_option}\",\n \"pigz -c > #{base}.#{well}.fq.gz\")\n \n unlink_files(tmpfqgzs)\n \n end\n \n end", "def do_work\n end", "def process(io_stream)\n settings.fill_in_defaults!\n\n count = 0\n start_time = batch_start_time = Time.now\n logger.debug \"beginning Indexer#process with settings: #{settings.inspect}\"\n\n reader = self.reader!(io_stream)\n writer = self.writer!\n\n\n processing_threads = settings[\"processing_thread_pool\"].to_i\n thread_pool = Traject::ThreadPool.new(processing_threads)\n\n logger.info \" Indexer with #{processing_threads} processing threads, reader: #{reader.class.name} and writer: #{writer.class.name}\"\n\n log_batch_size = settings[\"log.batch_size\"] && settings[\"log.batch_size\"].to_i\n\n reader.each do |record; position|\n count += 1\n\n # have to use a block local var, so the changing `count` one\n # doesn't get caught in the closure. Weird, yeah.\n position = count\n\n thread_pool.raise_collected_exception!\n\n if settings[\"debug_ascii_progress\"].to_s == \"true\"\n $stderr.write \".\" if count % settings[\"solr_writer.batch_size\"].to_i == 0\n end\n\n if log_batch_size && (count % log_batch_size == 0)\n batch_rps = log_batch_size / (Time.now - batch_start_time)\n overall_rps = count / (Time.now - start_time)\n logger.send(settings[\"log.batch_size.severity\"].downcase.to_sym, \"Traject::Indexer#process, read #{count} records at id:#{id_string(record)}; #{'%.0f' % batch_rps}/s this batch, #{'%.0f' % overall_rps}/s overall\")\n batch_start_time = Time.now\n end\n\n # we have to use this weird lambda to properly \"capture\" the count, instead\n # of having it be bound to the original variable in a non-threadsafe way.\n # This is confusing, I might not be understanding things properly, but that's where i am.\n #thread_pool.maybe_in_thread_pool &make_lambda(count, record, writer)\n thread_pool.maybe_in_thread_pool(record, settings, position) do |record, settings, position|\n context = Context.new(:source_record => record, :settings => settings, :position => position)\n context.logger = logger\n map_to_context!(context)\n if context.skip?\n log_skip(context)\n else\n writer.put context\n end\n\n end\n\n end\n $stderr.write \"\\n\" if settings[\"debug_ascii_progress\"].to_s == \"true\"\n\n logger.debug \"Shutting down #processing mapper threadpool...\"\n thread_pool.shutdown_and_wait\n logger.debug \"#processing mapper threadpool shutdown complete.\"\n\n thread_pool.raise_collected_exception!\n\n\n writer.close if writer.respond_to?(:close)\n\n @after_processing_steps.each do |step|\n begin\n step.execute\n rescue Exception => e\n logger.fatal(\"Unexpected exception #{e} when executing #{step}\")\n raise e\n end\n end\n\n elapsed = Time.now - start_time\n avg_rps = (count / elapsed)\n logger.info \"finished Indexer#process: #{count} records in #{'%.3f' % elapsed} seconds; #{'%.1f' % avg_rps} records/second overall.\"\n\n if writer.respond_to?(:skipped_record_count) && writer.skipped_record_count > 0\n logger.error \"Indexer#process returning 'false' due to #{writer.skipped_record_count} skipped records.\"\n return false\n end\n\n return true\n end", "def perform\n @analysis = Analysis.find(@analysis_id)\n\n # get the analysis and report that it is running\n @analysis_job = AnalysisLibrary::Core.initialize_analysis_job(@analysis, @analysis_job_id, @options)\n\n # reload the object (which is required) because the subdocuments (jobs) may have changed\n @analysis.reload\n\n logger.info \"Initializing analysis for #{@analysis.name} with UUID of #{@analysis.uuid}\"\n\n # make this a core method\n if !@analysis.problem['algorithm']['seed'].nil? && (@analysis.problem['algorithm']['seed'].is_a? Numeric)\n logger.info \"Setting R base random seed to #{@analysis.problem['algorithm']['seed']}\"\n @r.converse(\"set.seed(#{@analysis.problem['algorithm']['seed']})\")\n end\n\n selected_variables = Variable.pivots(@analysis.id) + Variable.variables(@analysis.id)\n logger.info \"Found #{selected_variables.count} variables to perturb\"\n\n # generate the probabilities for all variables as column vectors\n grouped = {}\n samples = {}\n var_types = []\n\n # get the probabilities\n logger.info \"Found #{selected_variables.count} variables\"\n\n i_var = 0\n selected_variables.each do |var|\n logger.info \"sampling variable #{var.name} for measure #{var.measure.name}\"\n variable_samples = nil\n # TODO: would be nice to have a field that said whether or not the variable is to be discrete or continuous.\n if var.uncertainty_type == 'discrete'\n variable_samples = var.static_value\n var_types << 'discrete'\n else\n variable_samples = var.static_value\n var_types << 'continuous'\n end\n\n # always add the data to the grouped hash even if it isn't used\n grouped[var.measure.id.to_s] = {} unless grouped.key?(var.measure.id)\n grouped[var.measure.id.to_s][var.id.to_s] = variable_samples\n\n # save the samples to the\n samples[var.id.to_s] = variable_samples\n\n var.r_index = i_var + 1 # r_index is 1-based\n var.save!\n\n i_var += 1\n end\n\n logger.info \"Samples are #{samples}\"\n number_of_runs = @analysis.problem['algorithm']['number_of_runs']\n logger.info \"Number of Runs is #{number_of_runs}\"\n\n (1..number_of_runs).each do |i|\n dp_name = \"Repeat Run Autogenerated #{i}\"\n dp = @analysis.data_points.new(name: dp_name)\n dp.set_variable_values = samples\n dp.save!\n\n logger.info(\"Generated datapoint #{dp.name} for analysis #{@analysis.name}\")\n end\n\n # Only set this data if the analysis was NOT called from another analysis\n unless @options[:skip_init]\n @analysis_job.end_time = Time.now\n @analysis_job.status = 'completed'\n @analysis_job.save!\n @analysis.reload\n end\n @analysis.save!\n\n logger.info \"Finished running analysis '#{self.class.name}'\"\n end", "def batch\n yield if block_given?\n end", "def on_transform(&blk)\n @transform_handler = blk\n self\n end", "def process(io_stream)\n settings.fill_in_defaults!\n\n count = 0\n start_time = batch_start_time = Time.now\n logger.debug \"beginning Indexer#process with settings: #{settings.inspect}\"\n\n reader = self.reader!(io_stream)\n writer = self.writer!\n\n\n processing_threads = settings[\"processing_thread_pool\"].to_i\n thread_pool = Traject::ThreadPool.new(processing_threads)\n\n logger.info \" Indexer with #{processing_threads} processing threads, reader: #{reader.class.name} and writer: #{writer.class.name}\"\n\n log_batch_size = settings[\"log.batch_size\"] && settings[\"log.batch_size\"].to_i\n\n reader.each do |record; position|\n count += 1\n\n # have to use a block local var, so the changing `count` one\n # doesn't get caught in the closure. Weird, yeah.\n position = count\n\n thread_pool.raise_collected_exception!\n\n if settings[\"debug_ascii_progress\"].to_s == \"true\"\n $stderr.write \".\" if count % settings[\"solr_writer.batch_size\"].to_i == 0\n end\n\n context = Context.new(\n :source_record => record,\n :settings => settings,\n :position => position,\n :logger => logger\n )\n\n if log_batch_size && (count % log_batch_size == 0)\n batch_rps = log_batch_size / (Time.now - batch_start_time)\n overall_rps = count / (Time.now - start_time)\n logger.send(settings[\"log.batch_size.severity\"].downcase.to_sym, \"Traject::Indexer#process, read #{count} records at id:#{context.source_record_id}; #{'%.0f' % batch_rps}/s this batch, #{'%.0f' % overall_rps}/s overall\")\n batch_start_time = Time.now\n end\n\n # We pass context in a block arg to properly 'capture' it, so\n # we don't accidentally share the local var under closure between\n # threads.\n thread_pool.maybe_in_thread_pool(context) do |context|\n map_to_context!(context)\n if context.skip?\n log_skip(context)\n else\n writer.put context\n end\n\n end\n\n end\n $stderr.write \"\\n\" if settings[\"debug_ascii_progress\"].to_s == \"true\"\n\n logger.debug \"Shutting down #processing mapper threadpool...\"\n thread_pool.shutdown_and_wait\n logger.debug \"#processing mapper threadpool shutdown complete.\"\n\n thread_pool.raise_collected_exception!\n\n\n writer.close if writer.respond_to?(:close)\n\n @after_processing_steps.each do |step|\n begin\n step.execute\n rescue Exception => e\n logger.fatal(\"Unexpected exception #{e} when executing #{step}\")\n raise e\n end\n end\n\n elapsed = Time.now - start_time\n avg_rps = (count / elapsed)\n logger.info \"finished Indexer#process: #{count} records in #{'%.3f' % elapsed} seconds; #{'%.1f' % avg_rps} records/second overall.\"\n\n if writer.respond_to?(:skipped_record_count) && writer.skipped_record_count > 0\n logger.error \"Indexer#process returning 'false' due to #{writer.skipped_record_count} skipped records.\"\n return false\n end\n\n return true\n end", "def merge_results_from_worker(results)\n @mutex.synchronize do\n results.each do |r|\n new_props = @job_inst.collector_combine_block(r, @n, @val)\n @n = new_props[:n]\n @val = new_props[:val]\n end\n end\n end", "def perform!\n run_callbacks(:before_perform, self)\n self.class.upcoming_mailings\n .in_batches(of: self.class.batch_size)\n .each do |batch|\n run_callbacks(:on_perform, self, batch)\n batch.each(&:process!)\n end\n run_callbacks(:after_perform, self)\n nil\n end", "def read_worker_loop\n Thread.new do\n begin\n data = {}\n while @running\n upstream_data = @data_source_block.call\n if data_changed?(upstream_data, data[:upstream_data])\n data = wrap_data(upstream_data)\n @current_upstream = data\n if @no_wrap\n @send_queue << [upstream_data]\n else\n @send_queue << data\n end\n end\n sleep(@read_worker_delay)\n end\n rescue => e\n logger.error \"Read worker error:\"\n logger.error e\n end\n end\n end", "def call!\n rows.map.with_index do |row, row_num|\n process_entities(row, row_num, &:call!)\n end\n end", "def perform\n\t\tbegin\n\t\t\tnext_run_at = Time.now + 30.minutes\n\t\t\tDataImporterWorker.perform_at(next_run_at)\n\t\t\tqds = QueryDataSource.find_all_by_enabled(true)\n\t\t\tqds.each do |q|\n\t\t\t\tQueryDataSourceWorker.perform_async(q.id)\n\t\t\tend\n\n\t\t\t#spree data source importer\n\t\t \tspree_data_sources = SpreeDataSource.find_all_by_enabled(true)\n\t\t \tspree_data_sources.each do |sds|\n\t\t\t\tSpreeDataSourceWorker.perform_async(sds.id)\n\t\t\tend\n\t\trescue Exception => e\n\t\t \tRails.logger.error e.to_s\n\t\t\tputs e.to_s\n\t\tend\n\tend", "def run_transform_step(input, step)\n\t\tincoming_stream = StringIO.new(\"\", 'w')\n\n\t\tinput_packer = MessagePack::Packer.new(incoming_stream)\n\t\tinput.each do |i|\n\t\t\tinput_packer.write(i).flush\n\t\tend\n\n\t\tincoming_stream.reopen(incoming_stream.string, 'r')\n\t\tstep.incoming = incoming_stream\n\n\t\toutgoing_stream = StringIO.new(\"\", 'w')\n\t\tstep.outgoing = outgoing_stream\n\n\t\trun_step step\n\n\t\toutgoing_stream.reopen(outgoing_stream.string, 'r')\n\t\toutput_unpacker = MessagePack::Unpacker.new(outgoing_stream)\n\t\toutput = []\n\t\toutput_unpacker.each do |row|\n\t\t\toutput << row\n\t\tend\n\n\t\toutput\n\tend", "def process\n self.generate\n end", "def call(*args)\n\t\tif @block\n\t\t\t# run sub-transform as defined by this closure\n\t\t\t# TODO: don't pass @vars if no custom variables have been declared. ie, if empty hash\n\t\t\t\n\t\t\tout = \n\t\t\t\tif @vars.empty?\n\t\t\t\t\t@block.call *args\n\t\t\t\telse\n\t\t\t\t\t@block.call @vars, *args\n\t\t\t\tend\n\t\t\treturn out\n\t\telse\n\t\t\t# return unmodified data\n\t\t\treturn *args\n\t\tend\n\tend", "def each_transform_output\n if !(tr = model.transformer)\n return\n end\n\n model.each_output_port do |port|\n if associated_transform = tr.find_transform_of_port(port)\n from = selected_frames[associated_transform.from]\n to = selected_frames[associated_transform.to]\n yield(port, from, to)\n end\n end\n end", "def run\n @run ||= build_data\n end", "def each\n @buffer.each do |ktopic, partitions|\n partitions.each do |partition, executors|\n executors.each do |_parallel_key, executor|\n # We skip the parallel key here as it does not serve any value when iterating\n yield(ktopic, partition, executor)\n end\n end\n end\n end", "def process_batch\n \t metadata = CSV.read(@batch_file)\n collection_title = metadata.shift.first.titleize\n\t @collection = find_collection(collection_title)\n\n # Skip to the file manifest\n metadata.shift(4)\n\t process_files(metadata)\n end", "def run\n Laze.debug 'Starting source processing'\n target.reset\n store.each do |item|\n target.create item\n end\n target.save\n Laze.debug 'Source processing ready'\n end", "def compose\n @compose ||= begin\n @aggregated_data = transformer.manufacture(\n lighthouse_appointments:,\n locations:,\n organizations:,\n facilities:,\n questionnaires:,\n questionnaire_responses:,\n save_in_progress:\n )\n\n aggregated_data.combine\n end\n end", "def call(worker_class, item, queue, _ = nil)\n result = yield\n\n scaler = @scalers[queue]\n if scaler && scaler.workers < 1\n scaler.workers = 1\n end\n\n result\n end", "def process\n by_time_batch\n by_waiting_batch\n rescue\n @logger.fatal \"Failed to process: #{$!}\"\n @logger.fatal $!.backtrace.join(\"\\n\")\n end", "def perform(msg)\n t_msg = perform_transformation msg\n dispatch t_msg\n end", "def run\n start_time = Time.now\n\n setup\n\n importer_run.update_attributes( started_at: start_time,\n source_model: source_model.name,\n destination_model: destination_model.name,\n importer_version: VERSION )\n\n # get a total count of records to process, bail out if none are found\n count = base_query(false).count\n\n logger.info \"\"\n if count == 0\n logger.info \"no #{source_model.name.pluralize} to import, exiting\"\n return\n end\n\n logger.info \"Starting import from #{source_model.table_name} into #{destination_model.name}...\"\n\n # step through the records in batches\n (0..count).step(batch_size) do |offset|\n thread_pool.schedule do\n with_connections do\n batch_elapsed_time = Benchmark.realtime do\n logger.info \"Importing from #{source_model.table_name} into #{destination_model.name} (#{offset / batch_size + 1}/#{count / batch_size + 1})\"\n\n # wipe the slate from the last batch\n prepare_for_new_batch\n\n benchmarks[:source_db] << Benchmark.realtime do\n # grab this batch of records from source\n fetch_records(offset)\n end\n\n # bail if there aren't any\n next if records.empty?\n\n logger.info \" #{records.count} source records fetched in #{benchmarks[:source_db].last}s\"\n if source_order_by\n logger.info \" #{source_order_by}: from #{records.first.read_attribute(source_order_by)} to #{records.last.read_attribute(source_order_by)}\"\n end\n\n # process this batch of records\n process_batch(records)\n\n logger.info \" #{records.count} records processed in #{benchmarks[:processing].last}s\"\n\n insert_and_update_batch\n end\n logger.info \" batch processed in #{batch_elapsed_time}s\"\n end\n end\n end\n thread_pool.shutdown\n \n print_validation_errors\n\n logger.info \"-------------------------------------------------\"\n logger.info \"Processing: #{benchmarks[:processing].sum}s total, #{benchmarks[:processing].sum / count}s per record\"\n logger.info \"source Database: #{benchmarks[:source_db].sum}s total, #{benchmarks[:source_db].sum / count}s per record\"\n logger.info \"dest Database: #{benchmarks[:destination_db].sum}s total, #{benchmarks[:destination_db].sum / count}s per record\"\n logger.info \"Total: #{Time.now - start_time}s elapsed\"\n importer_run.update_attributes( completed_at: Time.now )\n rescue Exception => e\n importer_run.update_attributes( error_trace: \"#{e.class} - #{e.message}\\n#{e.backtrace.join(\"\\n\")}\" )\n raise e\n ensure\n importer_run.update_attributes( records_created: records_created,\n records_updated: records_updated,\n duration: ((Time.now - start_time) * 1000).round,\n validation_errors: validation_errors )\n end", "def run_extraction\n\n run_on_all_extractors(@score_card.price) { |e| \n result = e.extract_stock_price()\n @score_card.price = result['price']\n @score_card.currency = result['currency']\n }\n \n run_on_all_extractors(@score_card.return_on_equity) { |e|\n e.extract_roe(@score_card.return_on_equity)\n }\n\n run_on_all_extractors(@score_card.ebit_margin) { |e|\n e.extract_ebit_margin(@score_card.ebit_margin, @score_card.share.financial)\n }\n \n run_on_all_extractors(@score_card.equity_ratio) { |e|\n e.extract_equity_ratio(@score_card.equity_ratio)\n }\n\n run_on_all_extractors(@score_card.current_price_earnings_ratio) { |e|\n e.extract_current_price_earnings_ratio(@score_card.current_price_earnings_ratio)\n }\n\n run_on_all_extractors(@score_card.average_price_earnings_ratio) { |e|\n e.extract_average_price_earnings_ratio(@score_card.average_price_earnings_ratio)\n }\n\n run_on_all_extractors(@score_card.analysts_opinion) { |e|\n e.extract_analysts_opinion(@score_card.analysts_opinion)\n }\n\n run_on_all_extractors(@score_card.reaction) { |e|\n e.extract_reaction_on_figures(@score_card.reaction)\n }\n\n run_on_all_extractors(@score_card.profit_revision) { |e|\n e.extract_profit_revision(@score_card.profit_revision)\n }\n\n run_on_all_extractors(@score_card.stock_price_dev_half_year) { |e|\n e.extract_stock_price_dev_half_year(@score_card.stock_price_dev_half_year)\n }\n \n run_on_all_extractors(@score_card.stock_price_dev_one_year) { |e|\n e.extract_stock_price_dev_one_year(@score_card.stock_price_dev_one_year)\n }\n\n run_on_all_extractors(@score_card.reversal) { |e|\n e.extract_three_month_reversal(@score_card.reversal)\n }\n\n run_on_all_extractors(@score_card.profit_growth) { |e|\n e.extract_profit_growth(@score_card.profit_growth)\n }\n\n run_on_all_extractors(@score_card.insider_info) { |e|\n e.extract_insider_deals(@score_card.insider_info)\n }\n\n end", "def pre_assemble_each_object\n un_pre_assembled_objects.each.with_index do |dobj, i|\n log \"#{num_to_pre_assemble - i} remaining in run | #{num_to_pre_assemble} running\"\n log \" - Processing object: #{dobj.container}\"\n log \" - N object files: #{dobj.object_files.size}\"\n @num_no_file_warnings += 1 if dobj.object_files.empty?\n load_checksums(dobj)\n progress = dobj.pre_assemble\n log \" - pre_assemble result: #{progress}\"\n progress.merge!(pid: dobj.druid.id, container: dobj.container, timestamp: Time.now.utc.strftime('%Y-%m-%d %H:%M:%S'))\n @num_failures += 1 if progress[:status] == 'error'\n log \"Completed #{dobj.druid}\"\n File.open(progress_log_file, 'a') { |f| f.puts progress.to_yaml }\n end\n end", "def post_process(aggregate)\n aggregate\n end", "def perform!\n super\n transfer!\n cycle!\n end", "def perform\n @processor = SubmissionProcessor.new(params: params)\n processor.process_submission\n build_output\n # Need to decide when to retry. See ingest_status as example\n rescue StandardError => e\n # processor.cleanup unless processor.blank?\n output(\n event: 'failed',\n message: \"#{e.message}\\n\\n#{e.backtrace.join('\\n')}\"\n )\n fail!\n end", "def process_result\n end", "def perform\n \n end", "def process(cursor, batch) end", "def perform_processing!\n raise \"This run is already processed!\" if run_for_processing\n update(run_for_processing: true)\n outdir = File.join(OUTPUT_DIR, \"#{id}\").shellescape\n indir = File.join(INPUT_DIR, \"#{id}\").shellescape\n Dir.mkdir(outdir, 0755) unless File.directory?(outdir)\n Dir.mkdir(indir, 0755) unless File.directory?(indir)\n\n # Stream input files to zip\n zout_in = java.util.zip.ZipOutputStream.new(File.open(File.join(indir, 'input.zip'), 'wb', 0644).to_outputstream)\n zout_out = java.util.zip.ZipOutputStream.new(File.open(File.join(outdir, 'out.zip'), 'wb', 0644).to_outputstream)\n\n finding_aid_versions\n .joins(:finding_aid, :concrete_issues => :issue)\n .select('finding_aid_versions.*,\n finding_aids.eadid,\n ARRAY_AGG(DISTINCT issues.identifier) AS identifiers')\n .group('finding_aids.eadid,finding_aid_versions.id')\n .each do |fa|\n add_to_zip(zout_in, fa.eadid, fa.file)\n\n # Preflight XML\n fa_xml = Fixes.preflights.values.reduce(fa.xml) do |xml, fix|\n apply_fix(xml, fix)\n end\n\n # Apply all relevant fixes to Finding Aid\n repaired = Fixes\n .to_h\n .select {|identifier, _| fa.identifiers.include? identifier}\n .reduce(fa_xml) do|xml, (identifier, fix)|\n pe = processing_events.create(issue_id: schematron.issues.find_by(identifier: identifier).id,\n finding_aid_version_id: fa.id)\n apply_fix(xml, fix, pe)\n\n end # end of .reduce\n\n # Any problems which have fixes that exist now should theoretically\n # be things that were shadowed by the first pass, so take additional passes\n # untill either no known issues or MAX_PASSES\n MAX_PASSES.times do\n remaining_problems = schematron.issues.where(id: @checker.check_str(repaired.serialize(encoding: 'UTF-8')).map {|el| el[:issue_id]}.uniq).pluck(:identifier) & Fixes.to_h.keys\n\n # Run a second round of fixing if there are remaining problems\n break if remaining_problems.blank?\n repaired = Fixes\n .to_h\n .select {|identifier, _| remaining_problems.include? identifier}\n .reduce(repaired) do |xml, (identifier, fix)|\n pe = processing_events.create(issue_id: schematron.issues.find_by(identifier: identifier).id,\n finding_aid_version_id: fa.id)\n apply_fix(xml, fix, pe)\n end\n end\n\n\n # Add notice of processing to revisiondesc\n today = DateTime.now.in_time_zone\n rd = repaired.at_xpath('/ead/eadheader/revisiondesc') || repaired.at_xpath('/ead/eadheader').add_child(Nokogiri::XML::DocumentFragment.new(repaired, '<revisiondesc />')).first\n rd.prepend_child(Nokogiri::XML::DocumentFragment.new(repaired, \"\\n\" + <<-FRAGMENT.strip_heredoc + \"\\n\"))\n <change>\n <date calendar=\"gregorian\" era=\"ce\" normal=\"#{today.strftime('%Y%m%d')}\">#{today.strftime('%m/%d/%Y')}</date>\n <item>This resource was modified by the ArchivesSpace Preprocessor developed by the Harvard Library (https://github.com/harvard-library/archivesspace-preprocessor)</item>\n </change>\n FRAGMENT\n\n File.open(File.join(outdir, \"#{fa.eadid}.xml\"), 'w', 0644) do |f|\n repaired.write_xml_to(f, encoding: 'UTF-8')\n end\n\n add_to_zip(zout_out, fa.eadid, File.open(File.join(outdir, \"#{fa.eadid}.xml\"), 'r'))\n end\n\n update(completed_at: DateTime.now)\n ensure\n close_zipfiles(zout_in, zout_out)\n end", "def processor; end", "def work_received(results)\n\n # write results to disk\n results.each do |name,fasta,qual,comments|\n @@results.write_seq(name,fasta,qual,comments)\n end\n \n end", "def perform\n options.clean_options!\n at(0, 100, t('common.progress_initializing'))\n\n user = User.find(options[:user_id])\n dataset = user.datasets.active.find(options[:dataset_id])\n task = dataset.analysis_tasks.find(options[:task_id])\n\n task.name = t('.short_desc')\n task.save\n\n # Do the analysis\n analyzer = compute_word_frequencies(\n dataset,\n ->(p) { at(p, 100, t('.progress_calculating')) },\n options)\n corpus_size = RLetters::Solr::CorpusStats.new.size\n\n # Create some CSV\n at(100, 100, t('common.progress_finished'))\n csv_string = CSV.generate do |csv|\n csv << [t('.csv_header', name: dataset.name)]\n csv << ['']\n\n # Output the block data\n if analyzer.blocks.size > 1\n csv << [t('.each_block')]\n\n name_row = ['']\n header_row = ['']\n word_rows = []\n analyzer.word_list.each do |w|\n word_rows << [w]\n end\n types_row = [t('.types_header')]\n tokens_row = [t('.tokens_header')]\n ttr_row = [t('.ttr_header')]\n\n analyzer.blocks.each_with_index do |b, i|\n s = analyzer.block_stats[i]\n\n name_row << s[:name] << '' << '' << ''\n header_row << t('.freq_header') \\\n << t('.prop_header') \\\n << t('.tfidf_dataset_header') \\\n << t('.tfidf_corpus_header')\n\n word_rows.each do |r|\n word = r[0]\n r << (b[word] || 0).to_s\n r << ((b[word] || 0).to_f / s[:tokens].to_f).to_s\n\n r << Math.tfidf((b[word] || 0).to_f / s[:tokens].to_f,\n analyzer.df_in_dataset[word],\n dataset.entries.size)\n if analyzer.df_in_corpus.present?\n r << Math.tfidf((b[word] || 0).to_f / s[:tokens].to_f,\n analyzer.df_in_corpus[word],\n corpus_size)\n else\n r << ''\n end\n end\n\n # Output the block stats at the end\n types_row << s[:types].to_s << '' << '' << ''\n tokens_row << s[:tokens].to_s << '' << '' << ''\n ttr_row << (s[:types].to_f / s[:tokens].to_f).to_s << '' << '' << ''\n end\n\n csv << name_row\n csv << header_row\n word_rows.each do |r|\n csv << r\n end\n csv << types_row\n csv << tokens_row\n csv << ttr_row\n end\n\n # Output the dataset data\n csv << ['']\n csv << [t('.whole_dataset')]\n csv << ['', t('.freq_header'), t('.prop_header'),\n t('.df_header'), t('.tfidf_corpus_header')]\n analyzer.word_list.each do |w|\n tf_in_dataset = analyzer.tf_in_dataset[w]\n r = [w,\n tf_in_dataset.to_s,\n (tf_in_dataset.to_f / analyzer.num_dataset_tokens).to_s]\n if analyzer.df_in_corpus.present?\n r << analyzer.df_in_corpus[w].to_s\n r << Math.tfidf(tf_in_dataset, analyzer.df_in_corpus[w],\n corpus_size)\n else\n r << ''\n r << ''\n end\n csv << r\n end\n csv << [t('.types_header'), analyzer.num_dataset_types.to_s]\n csv << [t('.tokens_header'), analyzer.num_dataset_tokens.to_s]\n csv << [t('.ttr_header'), (analyzer.num_dataset_types.to_f /\n analyzer.num_dataset_tokens).to_s]\n csv << ['']\n end\n\n # Write it out\n ios = StringIO.new(csv_string)\n file = Paperclip.io_adapters.for(ios)\n file.original_filename = 'word_frequency.csv'\n file.content_type = 'text/csv'\n\n task.result = file\n\n # We're done here\n task.finish!\n\n completed\n end", "def worker_begin(worker)\n end", "def run_bulk; end", "def transformations; end", "def deep_transform! &block\n\n\t\tdo_deep_transform_on_self_(&block)\n\tend", "def yield\n @eff.yield.perform\n end", "def process_one_work(input_obj)\n model = @utility.decode_work_type(input_obj)\n return [input_obj] if model.nil?\n return [ROF::Collection.process_one_collection(input_obj, @utility)] if model == 'Collection'\n\n main_obj = set_main_obj(input_obj, model)\n\n result = [main_obj]\n result = make_thumbnail(result, main_obj, input_obj) unless input_obj['files'].nil?\n result\n end", "def do_something!\n @trains.each do |train|\n yield(train)\n end\n end", "def _run\n super.tap { reenqueue }\n end", "def perform\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_STARTED\")\n Agents::Branch.find_in_batches do |group|\n group.each do |each_branch|\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_STARTED_#{each_branch.id}\")\n each_branch.branch_specific_stats\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_FINISHED_#{each_branch.id}\")\n end\n end\n Rails.logger.info(\"BranchStatsWorker_PROCESSING_FINISHED\")\n end", "def post_process; end", "def include_gathered_data\n compile_user_data if @@aggregate.length == 6\n end", "def process_result\n if @result.present?\n @result.map do |admin_tag, url_hash|\n url_hash.map do |url, entity_list|\n entity_list.each do |entity|\n entity.symbolize_keys!\n save_and_relate_entity(entity[:name], entity[:url], [admin_tag], \"person\", ADMIN_SOURCE)\n end\n end\n end\n end\n end", "def receive_internal_data data\n @tokenizer.extract(data) do |b_data|\n data_obj = load_data(b_data)\n receive_data(data_obj) if data_obj\n end\n end", "def perform\n build_recipes # this returns array of recipes\n self # return the scrapper\n end", "def perform\n return if cancelled?\n\n objects = [*1..200]\n batch = Sidekiq::Batch.new\n batch.on(:complete, 'BatchWorker')\n total objects.count\n batch.jobs do\n objects.each_with_index do |object, index|\n at(index + 1, \"Processing object #{object}\")\n PrintWorker.perform_async(object, index)\n end\n end\n end", "def prepare_data\n initial_data_eval \n initial_sorting if self.data_grid.sorting?\n filter\n global_summary_array\n pagination\n summary_array\n self.data_grid.row_styler\n prepare_data_for_filters\n end", "def process_attachment(attachment)\n #first, parse entries\n queue_entries_and_store_total(attachment)\n #next, start job to normalize data\n delay.process_report_entries\n end", "def process!\n end", "def compute_mapping\r\n # Prepare origin quad\r\n u_quads = @provider.connected_quads( @u_edge )\r\n origin_quad = u_quads.find { |quad| quad.edges.include?( @v_edge ) }\r\n origin = {\r\n :quad => origin_quad,\r\n :origin => @origin,\r\n :u_edge => @u_edge,\r\n :v_edge => @v_edge,\r\n :u2_edge => origin_quad.opposite_edge( @u_edge ),\r\n :v2_edge => origin_quad.opposite_edge( @v_edge ),\r\n :coordinate => [ 0, 0 ]\r\n }\r\n \r\n quads = {} # face => QuadFace\r\n stack = [ origin ]\r\n stack_negative = []\r\n mapped = []\r\n provider = EntitiesProvider.new\r\n \r\n # (!) Progressbar ( Status update )\r\n until stack.empty?\r\n #TT.debug 'Stack Shift'\r\n data = stack.shift\r\n quad = data[ :quad ]\r\n coordinate = data[ :coordinate ] \r\n invalid = false\r\n # Contrain quad mapping if contraint is present\r\n unless @contraints.empty?\r\n invalid = true unless quad.faces.all? { |face| @contraints[ face ] }\r\n end\r\n # Prevent parsing quads more than once.\r\n if invalid || quad.faces.any? { |face| quads[ face ] }\r\n # If the face is invalid and the look skips to the next iteration the\r\n # stack needs to be refilled if it's empty.\r\n if stack.empty?\r\n #TT.debug '> Break Refill'\r\n stack = stack_negative.dup\r\n stack_negative.clear\r\n end\r\n next\r\n end\r\n # Map faces to quads\r\n for face in quad.faces\r\n quads[ face ] = quad\r\n end\r\n # Add to mapping stack\r\n mapped << data\r\n # Preview\r\n x, y = coordinate\r\n i = ( ( x % 3 ) + ( y % 3 ) ) % 3\r\n mesh = quad.mesh\r\n triangles = ( 1..mesh.count_polygons ).map { |index|\r\n mesh.polygon_points_at( index )\r\n }.flatten\r\n @preview_quads[ i ].concat( triangles )\r\n # Connected Edges\r\n u = data[ :u_edge ]\r\n v = data[ :v_edge ]\r\n u2 = data[ :u2_edge ]\r\n v2 = data[ :v2_edge ]\r\n # Process Quads\r\n # Add results for increasing co-ordinates first in the stack and\r\n # decreasing to the end of the stack.\r\n #\r\n # This ensures that in looping surfaces the coordinates only increases\r\n # from the origin.\r\n for edge in [ u2, v2 ]\r\n item = next_quad( provider, data, edge, quads )\r\n stack << item if item\r\n end\r\n for edge in [ u, v ]\r\n item = next_quad( provider, data, edge, quads )\r\n stack_negative << item if item\r\n end\r\n # Refill the stack\r\n if stack.empty?\r\n #TT.debug '> Refill Last'\r\n stack = stack_negative.dup\r\n stack_negative.clear\r\n end\r\n end\r\n mapped\r\n end", "def build_house() \n gather_team()\n @workers.each do |worker|\n worker.get_to_work()\n end\n end", "def train\n run_aggregation\n run_syntetics\n run_values_to_ranges\n run_reverse\n\n [name, classifier]\n end" ]
[ "0.6490351", "0.609604", "0.55886", "0.5522557", "0.5509941", "0.54616594", "0.542857", "0.5385354", "0.5308729", "0.5260288", "0.52414185", "0.5203903", "0.52021337", "0.5192116", "0.517876", "0.5143641", "0.5127899", "0.5125328", "0.5124403", "0.51190645", "0.51115704", "0.5105615", "0.5088395", "0.5088395", "0.50882447", "0.50787896", "0.506997", "0.5069026", "0.5069002", "0.50624555", "0.5056844", "0.50519115", "0.50514275", "0.50392824", "0.5035138", "0.50317293", "0.50178653", "0.5004251", "0.50041467", "0.5003321", "0.49985895", "0.4996975", "0.4983386", "0.49805278", "0.49763685", "0.49711862", "0.49681228", "0.4967671", "0.495067", "0.49427956", "0.49390355", "0.49386916", "0.4936712", "0.4936668", "0.49344587", "0.493366", "0.4921308", "0.49185622", "0.49043256", "0.48952934", "0.48950732", "0.4893878", "0.48874444", "0.48786488", "0.48701403", "0.48653308", "0.48645586", "0.48628202", "0.48607764", "0.48568228", "0.48558283", "0.48545378", "0.48528802", "0.4852124", "0.48494923", "0.48473206", "0.48447192", "0.48358244", "0.4833246", "0.48309615", "0.48305228", "0.48293337", "0.4829086", "0.48212183", "0.48165435", "0.48104876", "0.4808426", "0.48034674", "0.480163", "0.47970778", "0.47918728", "0.47894743", "0.47811934", "0.47793022", "0.4774859", "0.47703588", "0.47619423", "0.47602272", "0.47602147", "0.47541517" ]
0.73334426
0
GET /houses GET /houses.json
def index @complex_buildings = ComplexBuilding.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n\n @houses = House.page(params[:page]).per(House::PER_PAGE_COUNT)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.search(params)\n end", "def index\n\n @search = House.search()\n @houses = House.order(\"country\").order(\"name\").page params[:page]\n\n if params[:q]\n @search = House.search(params[:q])\n @houses = @search.result.order(\"country\").order(\"name\")\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def index\n @house = House.all\n end", "def show\n @houses = House.all\n end", "def house\n fetch('harry_potter.houses')\n end", "def index\n @houses = House.where(:realty_type => params[:realty_type] == 'sell' ? 1 : 2).paginate( page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def show\n @household = Household.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @household }\n end\n end", "def index\n\t\t@households = current_user.households\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @households }\n\t\tend\n\tend", "def show\n\t\t@household = Household.find(params[:id])\n\t\t@people = @household.people\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @household }\n\t\tend\n\tend", "def index\n @houseinfos = Houseinfo.all\n end", "def index\n @hasuk_houses = HasukHouse.all\n end", "def index\n @houseguests = Houseguest.all\n end", "def show\n @house_account = HouseAccount.find(params[:id])\n\n render json: @house_account\n end", "def show\n @house = House.includes(:watchings).find(params[:id])\n render json: { house: @house, watchings_count: @house.watchings.size }\n end", "def index\n @households = Household.all\n end", "def index\n @house_lists = HouseList.all\n end", "def index\n @neighborhoods = Neighborhood.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end", "def index\n @neighborhoods = Neighborhood.alphabetical.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end", "def show\n @user = User.includes(:watched_houses).find(params[:id])\n render json: { user: @user, watched_houses: @user.watched_houses }\n end", "def index\n render json: @places\n end", "def index\n @heroes = Hero.all\n\n render json: @heroes\n end", "def show\n @house = House.find(params[:id])\n end", "def show\n @house = House.find(params[:id])\n end", "def openhouses_get(opts = {})\n data, _status_code, _headers = openhouses_get_with_http_info(opts)\n return data\n end", "def index\n @ware_houses = WareHouse.all\n end", "def houses\n @request[:property_type] = 'houses'\n self\n end", "def index\n @buildings = Building.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json :@buildings }\n end\n end", "def show\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n end", "def index\n @places = @site.places.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @places }\n end\n end", "def index\n @lophs = Loph.all\n respond_to do |format|\n format.html\n format.json { render json: @lophs}\n end\n end", "def index\n @places = Place.all\n\n respond_to do |format|\n format.html\n format.json { render json: @places }\n end\n end", "def index\n if params[\"search\"]\n if params[\"show_all\"] == \"true\"\n @houses = current_user.houses.search(params[\"search\"])\n else\n @houses = current_user.houses.active.search(params[\"search\"])\n end\n else\n if params[\"show_all\"] == \"true\"\n @houses = current_user.houses\n else\n @houses = current_user.houses.active\n end\n end\n end", "def index\n @publishing_houses = PublishingHouse.all\n end", "def index\n render json: Apartment.all\n end", "def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end", "def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end", "def index\n @housebooks = Housebook.all\n end", "def index\n redirect_to '/houses/new'\n #@houses = House.paginate(:page => params[:page], :per_page => 2)\n end", "def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end", "def index\n @stories = Story.all\n render json: @stories, root: false\n end", "def index\n @loves = Love.all\n render json: @loves\n end", "def index\n opts = {\n }.delete_if { |key, value| value.blank? }\n opts[:title] = /.*#{params[:key]}.*/ unless params[:key].blank?\n\n @houses = House.where(opts).select do |house|\n current_user.allow?(house.id, :view)\n end\n @houses = paginate(Kaminari.paginate_array(@houses))\n end", "def index\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n @customers = @greenhouse.customers.order(id: :asc)\n end", "def index\n @lights = Light.all\n\n render json: @lights\n end", "def index\n render json: Story.all\n end", "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "def index\n page_number = params[:page] ? params[:page][:number] : 1\n per_page = params[:per_page] ? params[:per_page] : 10\n\n @standings = Standing.paginate(page: page_number, per_page: per_page)\n\n render json: @standings\n end", "def index\n Rails.logger.info('👻 Disraptor: Showing available routes.')\n\n routes = Disraptor::Route.find_all()\n\n render json: { 'disraptor/routes': routes }\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @house }\n end\n end", "def show\n @neighborhood = Neighborhood.find(params[:id])\n\n render json: @neighborhood\n end", "def openhouses_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.openhouses_get ...\"\n end\n if opts[:'type'] && !['Residential', 'Rental', 'Multifamily', 'Condominium', 'Commercial', 'Land'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of Residential, Rental, Multifamily, Condominium, Commercial, Land'\n end\n if opts[:'sort'] && !['listprice', '-listprice', 'listdate', '-listdate', 'beds', '-beds', 'baths', '-baths'].include?(opts[:'sort'])\n fail ArgumentError, 'invalid value for \"sort\", must be one of listprice, -listprice, listdate, -listdate, beds, -beds, baths, -baths'\n end\n # resource path\n local_var_path = \"/openhouses\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'type'] = opts[:'type'] if opts[:'type']\n query_params[:'listingId'] = opts[:'listing_id'] if opts[:'listing_id']\n query_params[:'cities'] = @api_client.build_collection_param(opts[:'cities'], :multi) if opts[:'cities']\n query_params[:'brokers'] = @api_client.build_collection_param(opts[:'brokers'], :multi) if opts[:'brokers']\n query_params[:'agent'] = opts[:'agent'] if opts[:'agent']\n query_params[:'minprice'] = opts[:'minprice'] if opts[:'minprice']\n query_params[:'startdate'] = opts[:'startdate'] if opts[:'startdate']\n query_params[:'offset'] = opts[:'offset'] if opts[:'offset']\n query_params[:'limit'] = opts[:'limit'] if opts[:'limit']\n query_params[:'sort'] = opts[:'sort'] if opts[:'sort']\n query_params[:'include'] = @api_client.build_collection_param(opts[:'include'], :multi) if opts[:'include']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/vnd.simplyrets-v0.1+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 => 'Array<OpenHouse>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#openhouses_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n @hostel_rooms = HostelRoom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hostel_rooms }\n end\n end", "def index\n rooms = Room.includes(:problems, :registrations, :users, :owner)\n if params[:name]\n render json: rooms.where(name: params[:name])\n else\n render json: rooms\n end\n end", "def index\n @shots = Shot.all\n\n render json: @shots\n end", "def index\n @hotel_rooms = HotelRoom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hotel_rooms }\n end\n end", "def index\n @laws = Law.ordered_roots\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def index\n @rooms = Room.all\n respond_to do | format |\n format.html\n format.json\n end\n \n end", "def index\n @photos = Photo.all\n\n render json: @photos\n end", "def index\n @laws = Law.sorted\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @laws }\n end\n end", "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end", "def index\n @venues = Venue.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @venues }\n end\n end", "def index\n @house_works = HouseWork.all\n end", "def index\n #@houses = House.all\n @houses = House.where(nil) # creates an anonymous scope\n @houses = @houses.location(params[:location]) if params[:location].present?\n @houses = @houses.price(params[:price]) if params[:price].present?\n @houses = @houses.area(params[:area]) if params[:area].present?\n end", "def index\n @housing_features = HousingFeature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @housing_features }\n end\n end", "def index\n @sightings = Sighting.all\n render json: @sightings\n end", "def index\n @albums = Album.all\n render json: @albums\n end", "def index\n @states = State.order(\"name\").page(params[:page]).per(50)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @states }\n end\n end", "def index\n @movers = Mover.all\n\n render json: @movers\n end", "def show\n @house = House.includes(:students, :teachers).find(params[:id])\n end", "def show\n @house = House.includes(:students, :teachers).find(params[:id])\n end", "def index\n @leases = Lease.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @leases }\n end\n end", "def index\n @alleys = Alley.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @alleys }\n end\n end", "def show\n @neighborhood = Neighborhood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @neighborhood }\n end\n end", "def index\n weathers = Weather.all\n render json: weathers, status: 200\n end", "def index\n @upcoming_harvests = Harvest.upcoming\n @past_harvests = Harvest.past\n\n if params[:person_id]\n @person = Person.find(params[:person_id])\n @upcoming_harvests = @person.upcoming_harvests\n @past_harvests = @person.past_harvests\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvests }\n end\n end", "def index\n render json: Loan.all\n end", "def index\n @events = Event.where(adventure_id: params[:adventure_id])\n\n render json: @events\n end", "def index\n @bookings = Booking.all\n\n render json: @bookings\n end", "def new\n @show_house = ShowHouse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @show_house }\n end\n end", "def index\n @admin_villages = Admin::Village.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @admin_villages }\n end\n end", "def index\n @holders = Holder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @holders }\n end\n end", "def show\n @houses = House.all\n @image_attachments = @house.image_attachments.all\n @normalinfos = @house.normalinfo\n @addresses = @house.address\n @extrainfos = @house.extrainfo\n\n end", "def index\n @hoods = Hood.all\n end", "def index\n @heights = Height.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @heights }\n end\n end", "def index\n @guests = @wedding.guests.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @guests }\n end\n end", "def index\n if @house\n @locations = @house.locations.paginate :all, :page => params[:page], :per_page => 20, :order => 'date_debut desc'\n else\n @locations = Location.paginate :all, :page => params[:page], :per_page => 20, :order => 'date_debut desc'\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @locations }\n end\n end", "def index\n @games = Game.all\n render json: @games\n end", "def index\n locations = Location.all\n render json: locations\n end", "def show\n @floor = Floor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @floor }\n end\n end", "def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end", "def index\n @house_styles = HouseStyle.all\n end", "def list_all_shards(args = {}) \n get(\"/shards.json/\", args)\nend", "def index\n @sections = Section.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sections }\n end\n end" ]
[ "0.7755468", "0.72251153", "0.72251153", "0.72251153", "0.70419747", "0.70419747", "0.70419747", "0.70419747", "0.7013426", "0.68941134", "0.6879322", "0.6842397", "0.6824697", "0.67889386", "0.6775232", "0.6765745", "0.6748915", "0.67026335", "0.6695037", "0.6578647", "0.6536889", "0.6505747", "0.64853257", "0.64805007", "0.64299804", "0.6412466", "0.6408835", "0.63966465", "0.6371427", "0.6342212", "0.6342212", "0.6332877", "0.6304923", "0.6295623", "0.62861645", "0.6259703", "0.62551695", "0.62451184", "0.62444484", "0.6242039", "0.6232934", "0.6196985", "0.6195837", "0.6158997", "0.6156774", "0.61499614", "0.6113442", "0.6093885", "0.6088683", "0.6083982", "0.60837346", "0.60779333", "0.60767835", "0.6068694", "0.6066369", "0.60659176", "0.6059634", "0.6047351", "0.6021427", "0.60179156", "0.60095394", "0.60086566", "0.60042095", "0.6004158", "0.59878546", "0.59678775", "0.5966583", "0.59502757", "0.59502757", "0.59448355", "0.5942969", "0.5935099", "0.5926946", "0.59261674", "0.59256166", "0.59214574", "0.5912771", "0.5912771", "0.59110546", "0.59108555", "0.5908995", "0.5908311", "0.59054536", "0.58969504", "0.58965474", "0.5896287", "0.58909947", "0.588695", "0.5881993", "0.5872453", "0.58676404", "0.58657604", "0.5864773", "0.58635587", "0.58596927", "0.5854373", "0.58536965", "0.58510756", "0.58483", "0.5846912", "0.5842447" ]
0.0
-1
GET /houses/1 GET /houses/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def index\n\n @houses = House.page(params[:page]).per(House::PER_PAGE_COUNT)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def show\n @household = Household.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @household }\n end\n end", "def show\n @house = House.find(params[:id])\n end", "def show\n @house = House.find(params[:id])\n end", "def show\n @house_account = HouseAccount.find(params[:id])\n\n render json: @house_account\n end", "def show\n\t\t@household = Household.find(params[:id])\n\t\t@people = @household.people\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @household }\n\t\tend\n\tend", "def house\n fetch('harry_potter.houses')\n end", "def show\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @house = House.all\n end", "def show\n @houses = House.all\n end", "def index\n @houses = House.where(:realty_type => params[:realty_type] == 'sell' ? 1 : 2).paginate( page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def index\n @houses = House.search(params)\n end", "def show\n @house = House.includes(:watchings).find(params[:id])\n render json: { house: @house, watchings_count: @house.watchings.size }\n end", "def index\n @houseinfos = Houseinfo.all\n end", "def show\n @house = House.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @house }\n end\n end", "def show\n @neighborhood = Neighborhood.find(params[:id])\n\n render json: @neighborhood\n end", "def show\n @user = User.includes(:watched_houses).find(params[:id])\n render json: { user: @user, watched_houses: @user.watched_houses }\n end", "def new\n @show_house = ShowHouse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @show_house }\n end\n end", "def index\n\n @search = House.search()\n @houses = House.order(\"country\").order(\"name\").page params[:page]\n\n if params[:q]\n @search = House.search(params[:q])\n @houses = @search.result.order(\"country\").order(\"name\")\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def show\n @neighborhood = Neighborhood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @neighborhood }\n end\n end", "def show\n @floor = Floor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @floor }\n end\n end", "def index\n @hasuk_houses = HasukHouse.all\n end", "def index\n\t\t@households = current_user.households\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @households }\n\t\tend\n\tend", "def index\n @households = Household.all\n end", "def show\n @road = Road.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @road }\n end\n end", "def index\n @houseguests = Houseguest.all\n end", "def show\n @show_house = ShowHouse.find(params[:id])\n\n respond_to do |format|\n format.html {render :layout => 'legacy'}# show.html.erb\n format.json { render json: @show_house }\n end\n end", "def index\n @neighborhoods = Neighborhood.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end", "def show\r\n @venue = Venue.fetch(params[:id])\r\n render json: @venue\r\n end", "def show\n @house = House.find(params[:id])\n @house.view_count = @house.view_count + 1\n @house.save\n\n @meta_og_title = @house.name\n @meta_og_url = \"http://gigster.jp/gigs/\" + @house.id.to_s\n @meta_og_image = @house.image_url\n @meta_og_description = \"Gigster/ギグ共有サービス\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @house }\n end\n end", "def index\n @house_lists = HouseList.all\n end", "def show\n @village = Village.find(params[:id])\n @collections = @village.collections\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @village }\n end\n end", "def show\n story = Story.find(params[:id])\n render json: story\n end", "def show\n @medium_road = MediumRoad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @medium_road }\n end\n end", "def index\n @neighborhoods = Neighborhood.alphabetical.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @neighborhoods }\n end\n end", "def create\n @house = House.new(house_params)\n\n if @house.save\n render :show, status: :created, location: @house\n else\n render json: @house.errors, status: :unprocessable_entity\n end\n end", "def index\n @heroes = Hero.all\n\n render json: @heroes\n end", "def show\n @mostsmallroad = Mostsmallroad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mostsmallroad }\n end\n end", "def index\n render json: @places\n end", "def show\n @broad = Broad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @broad }\n end\n end", "def show\n @railway = Railway.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @railway }\n end\n end", "def index\n @buildings = Building.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json :@buildings }\n end\n end", "def index\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n @customers = @greenhouse.customers.order(id: :asc)\n end", "def index\n @ware_houses = WareHouse.all\n end", "def show\n @venue = Venue.find(params[:id])\n\n render json: @venue\n end", "def show\n @kitchen = Kitchen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kitchen }\n end\n end", "def show\n @building = Building.find(params[:id])\n\n if stale? @building\n render json: @building\n end\n end", "def set_house\n @house = House.find(params[:id])\n \n end", "def show\n @party = Party.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @party }\n end\n end", "def index\n redirect_to '/houses/new'\n #@houses = House.paginate(:page => params[:page], :per_page => 2)\n end", "def show\n @house = House.includes(:students, :teachers).find(params[:id])\n end", "def show\n @house = House.includes(:students, :teachers).find(params[:id])\n end", "def show\n @outdoor = Outdoor.find(params[:id])\n @json = Outdoor.find(params[:id]).to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outdoor }\n end\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def show\n @cad_neighborhood = CadNeighborhood.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cad_neighborhood }\n end\n end", "def show\n @photobook = Photobook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photobook }\n end\n end", "def houses\n @request[:property_type] = 'houses'\n self\n end", "def index\n @brochures = Brochure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brochures }\n end\n end", "def show\n @finding_aural = FindingAural.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @finding_aural }\n end\n end", "def show\n @subway = Subway.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @subway }\n end\n end", "def show\n @apartment = @building.apartments.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apartment }\n end\n end", "def show\n @owner = Owner.find(params[:id])\n render json: @owner\n end", "def new\n @house = current_user.houses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @house }\n end\n end", "def new\n @house = current_user.houses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @house }\n end\n end", "def show\n @county = County.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @county }\n end\n end", "def show\n @beacon = Beacon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @beacon }\n end\n end", "def index\n @lophs = Loph.all\n respond_to do |format|\n format.html\n format.json { render json: @lophs}\n end\n end", "def show\n @nail_salon = NailSalon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nail_salon }\n end\n end", "def show\n @howner = Howner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @howner }\n end\n end", "def show\n @photo = Photo.find(params[:id])\n\n render json: @photo\n end", "def show\n @estate = Estate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estate }\n end\n end", "def show\n place = Place.find(params[:id])\n\n render json: place\n end", "def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def set_house\n @house = House.find(params[:id])\n end", "def index\n @places = Place.all\n\n respond_to do |format|\n format.html\n format.json { render json: @places }\n end\n end", "def index\n @harvestings = Harvesting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @harvestings }\n end\n end" ]
[ "0.7757515", "0.7757515", "0.7757515", "0.7454755", "0.7165616", "0.703296", "0.703296", "0.69945854", "0.6888096", "0.6836465", "0.68340325", "0.6821874", "0.6821874", "0.6821874", "0.6821874", "0.67988986", "0.67411494", "0.66795", "0.6622453", "0.6611221", "0.6591484", "0.65782493", "0.6507443", "0.6438305", "0.64174056", "0.6412508", "0.6383347", "0.62981594", "0.62925154", "0.6273717", "0.6251013", "0.62278587", "0.6224651", "0.6220191", "0.617421", "0.6152013", "0.61468744", "0.6119764", "0.61101675", "0.60944146", "0.60832214", "0.6074777", "0.6067831", "0.6067609", "0.603919", "0.60312015", "0.6030981", "0.6028452", "0.6022365", "0.600228", "0.59973204", "0.59959483", "0.599219", "0.5986908", "0.59853756", "0.59770554", "0.5970915", "0.59704727", "0.59704727", "0.59667015", "0.59646976", "0.59646976", "0.59646976", "0.59646976", "0.59646976", "0.59646976", "0.59646976", "0.5953163", "0.59306514", "0.5928399", "0.5920524", "0.592028", "0.5917793", "0.5916927", "0.59139717", "0.59119004", "0.59119004", "0.59093934", "0.5907139", "0.5902082", "0.5897395", "0.58927476", "0.58886063", "0.58820397", "0.5877776", "0.58762425", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.5868518", "0.586835", "0.5867257" ]
0.0
-1
POST /houses POST /houses.json
def create @complex_building = ComplexBuilding.new(complex_building_params.merge(user_id: current_user.id)) respond_to do |format| if @complex_building.save format.html { redirect_to @complex_building, notice: 'Complex Building was successfully created.' } format.json { render :show, status: :created, location: @complex_building } else format.html { render :new } format.json { render json: @complex_building.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @house = House.new(house_params)\n\n if @house.save\n render :show, status: :created, location: @house\n else\n render json: @house.errors, status: :unprocessable_entity\n end\n end", "def create\n @house = House.new(house_params)\n\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house = House.new(house_params)\n\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render action: 'show', status: :created, location: @house }\n else\n format.html { render action: 'new' }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_houses house\n self.create_house(:owned => house[:owned],:rented => house[:rented],:co_provider => house[:co_provider])\n end", "def create\n @hasuk_house = HasukHouse.new(hasuk_house_params)\n\n respond_to do |format|\n if @hasuk_house.save\n format.html { redirect_to @hasuk_house, notice: 'Hasuk house was successfully created.' }\n format.json { render :show, status: :created, location: @hasuk_house }\n else\n format.html { render :new }\n format.json { render json: @hasuk_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house = House.new(house_params)\n\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'Factor was successfully created.' }\n format.json { render action: 'show', status: :created, location: @house }\n else\n format.html { render action: 'new' }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @house = current_user.houses.build(params[:house])\n\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: '出租信息发布成功!' }\n format.json { render json: @house, status: :created, location: @house }\n else\n format.html { render action: \"new\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n @house = current_user.houses.build(params[:house])\n\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: '出租信息发布成功!' }\n format.json { render json: @house, status: :created, location: @house }\n else\n format.html { render action: \"new\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @show_house = ShowHouse.new(params[:show_house])\n\n respond_to do |format|\n if @show_house.save\n format.html { redirect_to @show_house, notice: 'Show house was successfully created.' }\n format.json { render json: @show_house, status: :created, location: @show_house }\n else\n format.html { render action: \"new\" }\n format.json { render json: @show_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house = House.new(house_params)\n @house.user_id = session[:id]\n\n respond_to do |format|\n if @house.save\n format.html {redirect_to @house, notice: 'House was successfully created.'}\n format.json {render :show, status: :created, location: @house}\n else\n format.html {render :new}\n format.json {render json: @house.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @house = House.new(params[:house])\n\n respond_to do |format|\n if @house.save\n flash[:notice] = 'House was successfully created.'\n format.html { redirect_to(@house) }\n format.xml { render :xml => @house, :status => :created, :location => @house }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @house.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @houseinfo = Houseinfo.new(houseinfo_params)\n\n respond_to do |format|\n if @houseinfo.save\n format.html { redirect_to @houseinfo, notice: 'Houseinfo was successfully created.' }\n format.json { render :show, status: :created, location: @houseinfo }\n else\n format.html { render :new }\n format.json { render json: @houseinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def houses\n @request[:property_type] = 'houses'\n self\n end", "def create\n @publishing_house = PublishingHouse.new(publishing_house_params)\n\n respond_to do |format|\n if @publishing_house.save\n format.html { redirect_to @publishing_house, notice: 'Publishing house was successfully created.' }\n format.json { render action: 'show', status: :created, location: @publishing_house }\n else\n format.html { render action: 'new' }\n format.json { render json: @publishing_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @household = Household.new(household_params)\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render :show, status: :created, location: @household }\n else\n format.html { render :new }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house_account = HouseAccount.new(house_account_params)\n puts \"got params #{house_account_params}\"\n if @house_account.save\n render json: @house_account, status: :created, location: @house_account\n else\n render json: @house_account.errors, status: :unprocessable_entity\n end\n end", "def create\n @household = Household.new(household_params)\n\n respond_to do |format|\n if @household.save\n format.html { redirect_to @household, notice: 'Household was successfully created.' }\n format.json { render action: 'show', status: :created, location: @household }\n else\n format.html { render action: 'new' }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house = House.new(house_params)\n realtor = Realtor.find_by(users_id: session[:user_id])\n\n if session[:role] != \"admin\"\n @house.realtor_id = realtor.id\n @house.companies_id = realtor.companies_id\n end\n respond_to do |format|\n if @house.save\n format.html {redirect_to houses_path, notice: 'House was successfully created.'}\n format.json {render :show, status: :created, location: @house}\n else\n format.html {redirect_to houses_path, notice: 'Error saving house'}\n format.json {render json: @house.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @shelf = Shelf.new(shelf_params)\n @shelf.house_id = params[:house_id]\n respond_to do |format|\n if @shelf.save\n format.html { redirect_to house_shelves_path(params[:house_id]), notice: 'Shelf was successfully created.' }\n format.json { render :show, status: :created, location: @shelf }\n else\n format.html { render :new }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house = House.new(house_params)\n @companies = Company.all\n @house.realtor_id = current_user.id\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n puts @house.errors.full_messages\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @housebook = Housebook.new(housebook_params)\n\n respond_to do |format|\n if @housebook.save\n format.html { redirect_to @housebook, notice: 'Housebook was successfully created.' }\n format.json { render :show, status: :created, location: @housebook }\n else\n format.html { render :new }\n format.json { render json: @housebook.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house_list = HouseList.new(house_list_params)\n\n respond_to do |format|\n if @house_list.save\n format.html { redirect_to @house_list, notice: 'House list was successfully created.' }\n format.json { render action: 'show', status: :created, location: @house_list }\n else\n format.html { render action: 'new' }\n format.json { render json: @house_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @houseguest = Houseguest.new(houseguest_params)\n\n respond_to do |format|\n if @houseguest.save\n format.html { redirect_to @houseguest, notice: 'Houseguest was successfully created.' }\n format.json { render :show, status: :created, location: @houseguest }\n else\n format.html { render :new }\n format.json { render json: @houseguest.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(\n :title,\n :bedrooms,\n :bathrooms,\n :places,\n :suites,\n :price,\n :address,\n :neighborhood,\n :city,\n :state,\n :description,\n :status,\n :situation,\n :kind,\n :name,\n :email,\n :phone,\n :meters,\n :visits,\n {\n images: []\n }\n )\n end", "def create\n \thouse = House.create!(:name => params[:house_name]) unless params[:house_name].blank?\n \t\n \trender :update do |page|\n \t\tpage.replace_html 'houses_list', :partial => 'houses_list_item', :collection => House.find(:all, :order => \"name ASC\")\n \t\tpage << \"alert('Created house - #{house.name}')\"\n \tend\n end", "def create\n @clearing_house = ClearingHouse.new(clearing_house_params)\n\n respond_to do |format|\n if @clearing_house.save\n format.html { flash[:success] = 'Clearing house was successfully created.'; redirect_to @clearing_house }\n format.json { render :show, status: :created, location: @clearing_house }\n else\n format.html { render :new }\n format.json { render json: @clearing_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.fetch(:house).permit(:name, :region_id, :description, :telephone, :location, :latitude, :longitude, :street, :rules, :ammenities, :price, :bedrooms, :minimumstay, {images: []})\n end", "def create\n initLists\n @real_estate_companies = RealEstateCompany.all\n @house = House.new(house_params)\n @house.user_id = current_user.id\n if(@house.real_estate_company_id.nil?)\n @house.real_estate_company_id = current_user.real_estate_company_id\n end\n\n respond_to do |format|\n if @house.save\n format.html do\n redirect_to @house, notice: 'House was successfully created.'\n end\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ware_house = WareHouse.new(ware_house_params)\n\n respond_to do |format|\n if @ware_house.save\n format.html { redirect_to @ware_house, notice: 'Ware house was successfully created.' }\n format.json { render :show, status: :created, location: @ware_house }\n else\n format.html { render :new }\n format.json { render json: @ware_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(:name)\n end", "def house_params\n params.require(:house).permit(:house_name, :longitude, :latitude, :address, :phone_number)\n end", "def create\n @house = current_user.houses.new(house_params)\n authorize @house\n\n respond_to do |format|\n if @house.save\n format.html {\n redirect_to basic_house_path(@house), layout: 'panel'\n #flash[:success] = t('flash.messages.success')\n }\n format.json { render :json => @house }\n else\n format.html { render :new, layout: 'panel' }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(:title, :description, :price, :image, :house_type, :gender, :foreigner, :english_help, :photo_help, :city, :district, :address, :zipcode, :hide_address, :personal_parking_lot, :available_date, :reservable_date, :area, :building_floor, :at_floor, :special_floor, :direction, :bedroom, :shared_space, :bathroom, :balcony, :school_id, :min_lease, :security_fee, safety: [], amenity: [], furniture: [], extra_fee: [], public_facility: [], rule: [])\n end", "def create\n\t\t@household = Household.new(params[:household])\n\t\t@household.user = current_user \n\n\t\trespond_to do |format|\n\t\t\tif @household.save\n\t\t\t\tformat.html { redirect_to @household, notice: 'Household was successfully created.' }\n\t\t\t\tformat.json { render json: @household, status: :created, location: @household }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @household.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @house_work = HouseWork.new(house_work_params)\n\n respond_to do |format|\n if @house_work.save\n format.html { redirect_to @house_work, notice: 'House work was successfully created.' }\n format.json { render :show, status: :created, location: @house_work }\n else\n format.html { render :new }\n format.json { render json: @house_work.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(:location, :area, :year, :style, :price, :floors, :basement, :owner, :buyers, :company_id, :realtor_id, :name, :image)\n end", "def house_params\n params.require(:house).permit(:name, :address, :price, :link, :image_url, :city_state_zip)\n end", "def house_params\n params.require(:house).permit(:home_type, :size, :summary, :fee_simple, :room_type, :bed_room, :isActive, :bath_room, :listing_name, :address, :region, :price)\n end", "def index\n\n @houses = House.page(params[:page]).per(House::PER_PAGE_COUNT)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @houses }\n end\n end", "def new\n @house = current_user.houses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @house }\n end\n end", "def new\n @house = current_user.houses.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @house }\n end\n end", "def new_house_params\n params.require(:house).permit(:name, :author, :source, :motto)\n end", "def create\n house = House.new(house_params)\n current_user.house = house\n current_user.save\n redirect_to root_path\n end", "def house_params\n params.require(:house).permit(:realtor_id, :companies_id, :location, :area, :year_built, :style, :list_prize, :floor_count, :basement, :owner_name, images: [])\n end", "def create\n @house = House.new(params[:house])\n\n respond_to do |format|\n if @house.save\n realty_type = @house.realty_type == 1 ? 'sell' : 'rent'\n format.html { redirect_to admin_house_path(@house, :realty_type => realty_type), notice: 'Недвижимость успешно сохранена.' }\n format.json { render json: @house, status: :created, location: @house }\n else\n format.html { render action: \"new\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house = House.new(house_params)\n if (!admin_signed_in?)\n @house.realtor_id=current_realtor.id\n @house.real_estate_company_id=current_realtor.real_estate_company_id\n else\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def post\n Typhoeus.post(@url,\n body: @results_hash.to_json,\n headers: { 'Content-Type' => 'application/json' })\n end", "def house_params\n params.require(:house).permit(:name, :real_estate_company_id, :user_id, :house_style, :location, :sq_ft, :year, :price, :floors, :basement, :owner, :contact, images: [])\n end", "def create\n pt = params[:owner]\n @owner = Owner.new(pt)\n @owner.house_id = params[:house] || pt[:house_id]\n if @owner.save\n @house = @owner.house\n @house.owner_name = @owner.name\n @house.receive_time = Date.today\n @house.save\n redirect_to({:controller=>:houses,:action=>:index, :plot_id=>@house.plot_id,:house_code=>@house.house_code}, :notice => '添加业主成功')\n else\n render :action => \"new\"\n end\n end", "def create\n @house = House.new(params[:house])\n\n @house.creator_id = current_user.id\n\n respond_to do |format|\n if @house.save\n\n @house_sharing = HouseSharing.new\n @house_sharing.house_id = @house.id\n @house_sharing.user_id = current_user.id\n @house_sharing.active = 1\n @house_sharing.save\n\n flash[:notice] = 'Casa creata correttamente'\n format.html { redirect_to(@house) }\n format.xml { render :xml => @house, :status => :created, :location => @house }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @house.errors, :status => :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(:location, :sqft, :yearbuilt, :style, :price, :floors, :basement, :currentowner, :real_estate_company_id, :realtor_id)\n end", "def index\n @houses = House.search(params)\n end", "def houseinfo_params\n params.require(:houseinfo).permit(:house_id, :house_addrs, :house_description, :house_price, :house_guest)\n end", "def add(params)\n headers = {\n 'Cookie' => @context[:koha_rest_api_cookie],\n 'Content-Type' => 'application/json'\n }\n\n http = Net::HTTP.new(\"xkoha\", 8081)\n uri = URI(intranet(:koha_rest_api) + \"holds\")\n res = http.post(uri, params.to_json, headers)\n expect(res.code).to eq(\"201\"), \"got unexpected #{res.code} when adding hold.\\nResponse body: #{res.body}\"\n res.body\n end", "def create\n @house = House.new(house_params)\n @house.update(user_id: current_user.id)\n @house.update(company_id: current_user.company_id)\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.permit(:location, :description, :bedrooms, :bathrooms)\n end", "def new\n @show_house = ShowHouse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @show_house }\n end\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def index\n @houses = House.all\n end", "def house_params\n params.require(:house).permit(:user_id, :location, :square_footage, :year_built, :style, :list_price, :no_of_floors, :basement, :current_house_owner, :contact_info, :potential_buyers, :image, :listPriceLow, :listPriceHigh, :squareFootageLow, :squareFootageHigh, :company_id)\n end", "def create\n @note = Note.new(params[:note])\n\n respond_to do |format|\n if @note.save\n format.html { redirect_to house_path(@note.house_id), notice: 'Note was successfully created.' }\n format.json { render json: @note, status: :created, location: @note }\n else\n format.html { render action: \"new\" }\n format.json { render json: @note.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n @customer = Customer.new(customer_params)\n @customer.greenhouse_id = @greenhouse.id\n respond_to do |format|\n if @customer.save\n format.html { redirect_to greenhouse_customers_path(@greenhouse.id), notice: 'Customer was successfully created.' }\n #format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n #format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @neighborhood = Neighborhood.new(params[:neighborhood])\n\n respond_to do |format|\n if @neighborhood.save\n format.html { redirect_to @neighborhood, notice: 'Neighborhood was successfully created.' }\n format.json { render json: @neighborhood, status: :created, location: @neighborhood }\n else\n format.html { render action: \"new\" }\n format.json { render json: @neighborhood.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @neighborhood = Neighborhood.new(params[:neighborhood])\n\n respond_to do |format|\n if @neighborhood.save\n format.html { redirect_to @neighborhood, notice: 'Neighborhood was successfully created.' }\n format.json { render json: @neighborhood, status: :created, location: @neighborhood }\n else\n format.html { render action: \"new\" }\n format.json { render json: @neighborhood.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n val = house_params\n if session[:role] == 'Realtor'\n val[:company_id] = current_user.company_id\n end\n @house = House.includes(:company, :realtor).new(val)\n respond_to do |format|\n if @house.save\n format.html { redirect_to @house, notice: 'House was successfully created.' }\n format.json { render :show, status: :created, location: @house }\n else\n format.html { render :new }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(:country, :state, :city, :addl1, :addl2, :unit, :zip , :label , :street ,:Notes , :house_id, :phone, :email)\n end", "def create\n @neighbourhood = Neighbourhood.new(neighbourhood_params)\n\n respond_to do |format|\n if @neighbourhood.save\n format.html { redirect_to @neighbourhood, notice: 'Neighbourhood was successfully created.' }\n format.json { render :show, status: :created, location: @neighbourhood }\n else\n format.html { render :new }\n format.json { render json: @neighbourhood.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_house\n get_rep_from_api[\"results\"][0][\"members\"].each do |rep|\n Representative.create(\n pp_id: rep[\"id\"],\n first_name: rep[\"first_name\"],\n last_name: rep[\"last_name\"],\n party: rep[\"party\"],\n in_office: rep[\"in_office\"],\n state: rep[\"state\"],\n votes_with_party_pct: rep[\"votes_with_party_pct\"],\n district: rep[\"district\"]\n )\n end\nend", "def create\n @house_style = HouseStyle.new(house_style_params)\n\n respond_to do |format|\n if @house_style.save\n format.html { redirect_to @house_style, notice: 'House style was successfully created.' }\n format.json { render :show, status: :created, location: @house_style }\n else\n format.html { render :new }\n format.json { render json: @house_style.errors, status: :unprocessable_entity }\n end\n end\n end", "def house_params\n params.require(:house).permit(:country, :city , :state , :addl1, :addl2 , :unit , :zip)\n end", "def create\n @household_member = HouseholdMember.new(household_member_params)\n\n respond_to do |format|\n if @household_member.save\n format.html { redirect_to @household_member, notice: 'Household member was successfully created.' }\n format.json { render :show, status: :created, location: @household_member }\n else\n format.html { render :new }\n format.json { render json: @household_member.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @house = House.all\n end", "def create\n\n @house = House.new(params[:house])\n @house.users_ids = current_user.id\n\n if @house.save\n redirect_to thanks_houses_url\n else\n render :new\n end\n\n end", "def create\n @house = House.new(house_params)\n # respond_to do |format|\n @house.user_id = current_user.id\n puts current_user.inspect\n if @house.save\n render json: {:success => true}\n # render action: 'show', status: :created, location: @house\n # format.html { redirect_to @house, notice: 'House was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @house }\n else\n render json: @house.errors, status: :unprocessable_entity \n # format.html { render action: 'new' }\n # format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n # end\n end", "def create\n @street = Street.new(street_params)\n\n respond_to do |format|\n if @street.save\n format.html { redirect_to @street, notice: 'Street was successfully created.' }\n format.json { render :show, status: :created, location: @street }\n else\n format.html { render :new }\n format.json { render json: @street.errors, status: :unprocessable_entity }\n end\n end\n end", "def spooky_house_params\n params.require(:spooky_house).permit(:name, :banner_url)\n end", "def house_params\n params.require(:house).permit(:house_name, :rent_fee, :address, :age, :note, nearest_stations_attributes: [:id, :line, :station, :minutes, :_destroy])\n end", "def publishing_house_params\n params.require(:publishing_house).permit(:publishing_house, :slug)\n end", "def create\n @house_book = HouseBook.new(params[:house_book])\n\n respond_to do |format|\n if @house_book.save\n format.html { redirect_to(@house_book, :notice => 'House book was successfully created.') }\n format.xml { render :xml => @house_book, :status => :created, :location => @house_book }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @house_book.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @building = Building.new(building_params)\n\n if @building.save\n render json: @building, status: :created, location: @building\n else\n render json: @building.errors, status: :unprocessable_entity\n end\n end", "def storehouse_params\n params.require(:storehouse).permit(:storehouse_name, :storehouse_country, :storehouse_city, :storehouse_address, :storehouse_phone)\n end", "def create\n @house = House.new(house_params)\n if @house.company_id == nil\n flash[:error] = \"Please assign a company to your profile.\"\n render :new\n return\n end\n respond_to do |format|\n if @house.save\n format.html {redirect_to @house, notice: 'House was successfully created.'}\n format.json {render :show, status: :created, location: @house}\n else\n format.html {render :new}\n format.json {render json: @house.errors, status: :unprocessable_entity}\n end\n end\n end", "def new\n @user = User.new\n @houses = House.all\n respond_to do |format|\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n\n end", "def house_params\n params.require(:house).permit(:company_id, :location, :square_footage, :year_built, :style, :price_list, :number_of_floors, :basement, :current_owner, :contact_info_realtor, :user_id, :image)\n end", "def create\n apartment = Apartment.create(apartment_params)\n render json: apartment\n end", "def create\n @hoge = Hoge.new(params[:hoge])\n\n respond_to do |format|\n if @hoge.save\n format.html { redirect_to @hoge, notice: 'Hoge was successfully created.' }\n format.json { render json: @hoge, status: :created, location: @hoge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hoge.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @houseinfos = Houseinfo.all\n end", "def create\n @location = Location.new(params[:location])\n @location.house = @house\n\n respond_to do |format|\n if @location.save\n flash[:notice] = 'Location was successfully created.'\n format.html { redirect_to(@location) }\n format.xml { render :xml => @location, :status => :created, :location => @location }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @location.errors, :status => :unprocessable_entity }\n end\n end\n end", "def moip_post\n @nasp_rail = NaspRail.new(params[:nasp_rail])\n\n format.html { redirect_to @nasp_rail, :notice => 'Nova entrada criada com sucesso.' }\n format.json { render :json => @nasp_rail, :status => :created, :location => @nasp_rail }\n end", "def create\n\t @household = current_user.create_household(household_params)\n\t @household.users << current_user\n\t if @household.save!\n\t redirect_to @household\n\t else\n\t render 'new'\n\t end\n\tend", "def update_houses house\n if self.house.nil?\n self.create_houses house\n else\n self.house.update!(:owned => house[:owned],:rented => house[:rented],:co_provider => house[:co_provider])\n end\n end", "def set_house\n @house = House.find(params[:id])\n \n end", "def add_person_to_house\n \tbegin\n\t @house = House.find(params[:house_id])\n \t name = params[:person][:name]\n \t names = name.strip.split(' ')\n \t @person = Person.find(:first, :conditions => {:first_name => names[0], :last_name => names[1]})\n \t @house.people << @person\n \t render :update do |page|\n \t \tpage.replace_html 'house_detail', :partial => 'house', :object => @house\n \t \tpage.visual_effect :highlight, \"house_person_id_#{@person.id}\"\n \t end\n \trescue ActiveRecord::RecordNotFound\n \t #flash[:error] = \"We're sorry, there was a problem with your request. Please try again.\"\n \tend\n end", "def create\n @sudoku = Sudoku.new(sudoku_params)\n @sudoku.gaps = Sudoku.generate_gaps\n respond_to do |format|\n if @sudoku.save\n format.html { redirect_to @sudoku }\n format.json { render :show, status: :created, location: @sudoku }\n else\n format.html { render :new }\n format.json { render json: @sudoku.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n chore_params = params[:chore]\n @user = User.find(session[:user_id])\n chore_params[:house_id] = @user.house_id\n @chore = Chore.new(chore_params)\n @chores = Chore.find_all_by_house_id(@user.house_id)\n @shift = Shift.new\n respond_to do |format|\n if @chore.save\n\n format.html { redirect_to '/createChore', :notice => 'Chore was successfully created.' }\n format.json { render :json => @chore, :status => :created, :location => @chore }\n\n else\n format.html { render :action => 'createChore' }\n format.json { render :json => @chore.errors, :status => :unprocessable_entity }\n end\n end\n end", "def index\n @hasuk_houses = HasukHouse.all\n end", "def house\n fetch('harry_potter.houses')\n end", "def house_params\n params.require(:house).permit(:company_id, :location, :sq_footage, :year_build, :style, :list_price, :floors, :basement, :current_owner)\n end", "def house_params\n params.require(:house).permit(:title, :description, image_attachments_attributes: [:id, :house_id, :avatar],\n normalinfo_attributes: [:id, :house_id,:housetype,:dealtype,:monthlyfee,:tradefee,:totalfloor,:myfloor],\n address_attributes: [:id, :house_id, :postcode, :mainaddress, :detailaddress],\n extrainfo_attributes: [:id, :house_id, :managebool,:managefee,:internet,:television,:cleanfee,:waterfee,\n :parking,:enterdate,:aircon,:laundary,:pet])\n\n end" ]
[ "0.71898353", "0.71595514", "0.70852405", "0.6993376", "0.67583257", "0.667636", "0.66742873", "0.66742873", "0.66664743", "0.6618007", "0.65094775", "0.64636993", "0.64609957", "0.6450269", "0.6448202", "0.63951737", "0.63854617", "0.6384249", "0.63433623", "0.6325763", "0.6325519", "0.6315117", "0.6309892", "0.62764657", "0.62628806", "0.6232003", "0.6223663", "0.6215307", "0.6189869", "0.6179927", "0.61797786", "0.616265", "0.6125699", "0.6081034", "0.6076187", "0.60624826", "0.6054968", "0.6045284", "0.60234356", "0.5996259", "0.5996259", "0.5973844", "0.5966194", "0.5948974", "0.59477186", "0.59438336", "0.59248716", "0.59053177", "0.58924973", "0.588425", "0.5868148", "0.5864184", "0.5852307", "0.5833706", "0.58243555", "0.57850456", "0.57743037", "0.5773967", "0.5773967", "0.5773967", "0.5773967", "0.5761473", "0.57502395", "0.57468426", "0.57332134", "0.57332134", "0.57232565", "0.5721466", "0.57204825", "0.57095826", "0.56943786", "0.56671286", "0.56598085", "0.56542146", "0.5653895", "0.5640462", "0.5625215", "0.560279", "0.5592096", "0.5579174", "0.55688936", "0.5559186", "0.55577445", "0.5549433", "0.55472237", "0.55440277", "0.5543882", "0.55333275", "0.55327076", "0.55227876", "0.5518405", "0.5510393", "0.5490541", "0.5485704", "0.5476936", "0.54755497", "0.54740727", "0.54712147", "0.54530025", "0.5449123", "0.5449046" ]
0.0
-1
PATCH/PUT /houses/1 PATCH/PUT /houses/1.json
def update respond_to do |format| if @complex_building.update(complex_building_params) format.html { redirect_to @complex_building, notice: 'complex_building was successfully updated.' } format.json { render :show, status: :ok, location: @complex_building } else format.html { render :edit } format.json { render json: @complex_building.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @house = House.find(params[:id])\n\n respond_to do |format|\n if @house.update_attributes(params[:house])\n format.html { redirect_to @house, notice: 'Gig was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html {redirect_to @house, notice: 'House was successfully updated.'}\n format.json {render :show, status: :ok, location: @house}\n else\n format.html {render :edit}\n format.json {render json: @house.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html {redirect_to @house, notice: 'House was successfully updated.'}\n format.json {render :show, status: :ok, location: @house}\n else\n format.html {render :edit}\n format.json {render json: @house.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html {redirect_to @house, notice: 'House was successfully updated.'}\n format.json {render :show, status: :ok, location: @house}\n else\n format.html {render :edit}\n format.json {render json: @house.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @house.update(house_params)\n render :show, status: :ok, location: @house\n else\n render json: @house.errors, status: :unprocessable_entity\n end\n end", "def update\n @house = House.find(params[:id])\n\n respond_to do |format|\n if @house.update_attributes(params[:house])\n format.html { redirect_to @house, notice: '信息已经更新!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @house = House.find(params[:id])\n\n respond_to do |format|\n if @house.update_attributes(params[:house])\n format.html { redirect_to @house, notice: '信息已经更新!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @shelf.update(shelf_params)\n format.html { redirect_to house_shelves_path(params[:house_id]), notice: 'Shelf was successfully created.' } \n format.json { render :show, status: :ok, location: @shelf }\n else\n format.html { render :edit }\n format.json { render json: @shelf.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @house = House.find(params[:id])\n\n respond_to do |format|\n if @house.update_attributes(params[:house])\n flash[:notice] = 'House was successfully updated.'\n format.html { redirect_to(@house) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @house.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n @show_house = ShowHouse.find(params[:id])\n\n respond_to do |format|\n if @show_house.update_attributes(params[:show_house])\n format.html { redirect_to @show_house, notice: 'Show house was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @show_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @houseinfo.update(houseinfo_params)\n format.html { redirect_to @houseinfo, notice: 'Houseinfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @houseinfo }\n else\n format.html { render :edit }\n format.json { render json: @houseinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @hasuk_house.update(hasuk_house_params)\n format.html { redirect_to @hasuk_house, notice: 'Hasuk house was successfully updated.' }\n format.json { render :show, status: :ok, location: @hasuk_house }\n else\n format.html { render :edit }\n format.json { render json: @hasuk_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @household.update(household_params)\n format.html { redirect_to @household, notice: 'Household was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @house = House.find(params[:id])\n\n respond_to do |format|\n if @house.update_attributes(params[:house])\n flash[:notice] = 'Casa aggiornata correttamente.'\n format.html { redirect_to(@house) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @house.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end", "def update_address\n # respond_to do |format|\n @house = House.find_by(house_id: params[:house][:house_id],user_id: current_user.id)\n puts \"*\"*100\n puts @house.inspect\n puts \"*\"*100\n if @house.update(house_params)\n render json: {success: true}\n # format.html { redirect_to @house, notice: 'House was successfully updated.' }\n # format.json { head :no_content }\n else\n render json: @house.errors, status: :unprocessable_entity \n # format.html { render action: 'edit' }\n # format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n # end\n end", "def update\n initLists\n @real_estate_companies = RealEstateCompany.all\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @housebook.update(housebook_params)\n format.html { redirect_to @housebook, notice: 'Housebook was successfully updated.' }\n format.json { render :show, status: :ok, location: @housebook }\n else\n format.html { render :edit }\n format.json { render json: @housebook.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n @companies = Company.all\n respond_to do |format|\n if @house.update(house_params)\n format.html { redirect_to @house, notice: 'House was successfully updated.' }\n format.json { render :show, status: :ok, location: @house }\n else\n format.html { render :edit }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house_list.update(house_list_params)\n format.html { redirect_to @house_list, notice: 'House list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @house_list.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_houses house\n if self.house.nil?\n self.create_houses house\n else\n self.house.update!(:owned => house[:owned],:rented => house[:rented],:co_provider => house[:co_provider])\n end\n end", "def update\n respond_to do |format|\n if @houseguest.update(houseguest_params)\n format.html { redirect_to @houseguest, notice: 'Houseguest was successfully updated.' }\n format.json { render :show, status: :ok, location: @houseguest }\n else\n format.html { render :edit }\n format.json { render json: @houseguest.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @publishing_house.update(publishing_house_params)\n format.html { redirect_to @publishing_house, notice: 'Publishing house was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @publishing_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if params[:place_id]\n @safe_house = Place.find(params[:place_id])\n place_id_present = true\n end\n\n respond_to do |format|\n if place_id_present && @safe_house.update_attributes( :name => params[:name],\n :zombie_probability => params[:zombie_probability],\n :latitude => params[:latitude],\n :longitude => params[:longitude],\n :has_weapons => params[:has_weapons],\n :has_food => params[:has_food],\n :has_people => params[:has_people])\n format.json { render :json => { :status => \"OK\", :response => {:updated => true} }}\n else\n format.json { render :json => { :status => \"Error\", :response => {} }}\n end\n end\n end", "def update_house(house)\n @contact_name = house[:contact_name]\n @phone = house[:phone]\n @email = house[:email]\n @password = house[:password]\n end", "def update\n @house = House.find(params[:id])\n @realty_type = @house.realty_type_number(params[:realty_type])\n\n respond_to do |format|\n if @house.update_attributes(params[:house])\n\n format.html { redirect_to admin_house_path(:realty_type => params[:realty_type]), notice: 'Недвижимость успешно обновлена.' }\n format.json { head :no_content }\n\n else\n format.html { render action: \"edit\" }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "def update\n respond_to do |format|\n if @single_housing.update(single_housing_params)\n format.html { redirect_to @single_housing, notice: 'Single housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @single_housing }\n else\n format.html { render :edit }\n format.json { render json: @single_housing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @hoge = Hoge.find(params[:id])\n\n respond_to do |format|\n if @hoge.update_attributes(params[:hoge])\n format.html { redirect_to @hoge, notice: 'Hoge was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hoge.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update\n respond_to do |format|\n if @house.update(factor_params)\n format.html { redirect_to @house, notice: 'Factor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @house.errors, status: :unprocessable_entity }\n end\n end\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 @house_book = HouseBook.find(params[:id])\n\n respond_to do |format|\n if @house_book.update_attributes(params[:house_book])\n format.html { redirect_to(@house_book, :notice => 'House book was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @house_book.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @street.update(street_params)\n format.html { redirect_to @street, notice: 'Street was successfully updated.' }\n format.json { render :show, status: :ok, location: @street }\n else\n format.html { render :edit }\n format.json { render json: @street.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n animal = Animal.find(params[:id])\n\n if validate_params(animal_params)\n animal.update(animal_params)\n render json: animal, status: 200, location: [:api, animal]\n else\n render json: { errors: animal.errors }, status: 422\n end\n end", "def update\n respond_to do |format|\n if @hood.update(hood_params)\n format.html { redirect_to @hood, notice: 'Hood was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @hood.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @house_account = HouseAccount.find(params[:id])\n\n if @house_account.update(params[:house_account])\n head :no_content\n else\n render json: @house_account.errors, status: :unprocessable_entity\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n respond_to do |format|\n if @house_work.update(house_work_params)\n format.html { redirect_to @house_work, notice: 'House work was successfully updated.' }\n format.json { render :show, status: :ok, location: @house_work }\n else\n format.html { render :edit }\n format.json { render json: @house_work.errors, status: :unprocessable_entity }\n end\n end\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 @building = Building.find(params[:id])\n\n if @building.update_attributes(building_params)\n head :no_content\n else\n render json: @building.errors, status: :unprocessable_entity\n end\n end", "def update\n puts y params['photo'].keys\n params['photo'].keys.each do |photo_id|\n photo = Photo.find(photo_id)\n photo.update_attributes(params['photo'][photo_id])\n end\n respond_to do |format|\n if true \n format.html { redirect_to photos_path, notice: 'Photos were successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"index\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @buy_house.update(buy_house_params)\n format.html { redirect_to @buy_house, notice: 'Buy house was successfully updated.' }\n format.json { render :show, status: :ok, location: @buy_house }\n else\n format.html { render :edit }\n format.json { render json: @buy_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @thing = Thing.find(params[:id])\n params[:thing][:place_id] = place_id_from_form\n params[:thing][:owner_ids] = [ ] if params[:thing][:owner_ids].nil?\n params[:thing][:keeper_ids] = [ ] if params[:thing][:keeper_ids].nil?\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to(@thing, :notice => 'Thing was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @thing.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @plate = Plate.find(params[:id])\n\n if @plate.update(params[:plate])\n head :no_content\n else\n render json: @plate.errors, status: :unprocessable_entity\n end\n end", "def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end", "def update\n dream = Dream.find params[:id]\n dream.update dream_params\n render json: {dream: dream}\n end", "def update\n\t\t@household = Household.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @household.update_attributes(params[:household])\n\t\t\t\tformat.html { redirect_to @household, notice: 'Household was successfully updated.' }\n\t\t\t\tformat.json { head :no_content }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n apartment = Apartment.find(params[:id])\n apartment.update_attributes(apartment_params)\n render json: apartment\n end", "def update\n respond_to do |format|\n if @hospice.update(hospice_params)\n format.html { redirect_to @hospice, notice: 'Hospice was successfully updated.' }\n format.json { render :show, status: :ok, location: @hospice }\n else\n format.html { render :edit }\n format.json { render json: @hospice.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @clearing_house.update(clearing_house_params)\n format.html { flash[:success] = 'Clearing house was successfully updated.'; redirect_to @clearing_house }\n format.json { render :show, status: :ok, location: @clearing_house }\n else\n format.html { render :edit }\n format.json { render json: @clearing_house.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n respond_to do |format|\n if @housing.update(housing_params)\n format.html {\n redirect_to housings_url, notice: 'Housing was successfully updated.' }\n format.json {\n render json: {}, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @housing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to things_path, notice: 'Your thing was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @household.update(household_params)\n\n params[:household][:household_members_attributes].each do |member|\n predecessor_name = member[1][:name]\n successor_name = member[1][:name_related]\n relationship_kind = member[1][:relationship]\n\n @household.add_household_member(@household.household_members.find_by_name(predecessor_name))\n @household.add_relationship(predecessor_name, successor_name, relationship_kind)\n #byebug\n end\n format.html { redirect_to @household, notice: 'Household was successfully updated.' }\n format.json { render :show, status: :ok, location: @household }\n else\n format.html { render :edit }\n format.json { render json: @household.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @building.update(building_params)\n format.html { redirect_to @building, notice: t('.update_ok', item: @building.name) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @building.errors, status: :unprocessable_entity }\n end\n end\n end", "def test_update\n\n admin_session = cathy_admin_session\n \n ibm = fab_houses(:ibm)\n fab_house = FabHouse.find(ibm.id)\n fab_house.name = 'new_fab_house'\n\n post(:update, { :fab_house => fab_house.attributes }, admin_session)\n assert_redirected_to(:action => 'edit', :id => fab_house.id)\n assert_equal('Update recorded', flash['notice'])\n assert_equal('new_fab_house', fab_house.name)\n \n post(:update, \n { :fab_house => { :name => fab_house.name, \n :id => fab_house.id.to_s, \n :active => fab_house.active.to_s } }, \n cathy_admin_session)\n assert_redirected_to(:action => 'edit', :id => fab_house.id)\n #assert_equal('Update recorded', flash['notice'])\n \n end", "def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "def update\n @one = One.find(params[:id])\n\n respond_to do |format|\n if @one.update_attributes(params[:one])\n format.html { redirect_to @one, notice: 'One was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @one.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @kota_stone.update(kota_stone_params)\n format.html { redirect_to kota_stones_url, notice: 'Kota stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kota_stone.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n render json: Location.update(params[\"id\"], params[\"location\"])\n end", "def update\n @thing = Thing.find(params[:id])\n\n respond_to do |format|\n if @thing.update_attributes(params[:thing])\n format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @stone = Stone.find(params[:id])\n\n respond_to do |format|\n if @stone.update_attributes(params[:stone])\n format.html { redirect_to @stone, notice: 'Stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @stone.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @floor = Floor.find(params[:id])\n\n respond_to do |format|\n if @floor.update_attributes(params[:floor])\n format.html { redirect_to @floor, notice: 'Floor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @photo1 = Photo1.find(params[:id])\n\n respond_to do |format|\n if @photo1.update_attributes(params[:photo1])\n format.html { redirect_to @photo1, notice: 'Photo1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @photo1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house_hunter.update(house_hunter_params)\n format.html { redirect_to root_path, notice: 'House hunter was successfully updated.' }\n format.json { render :show, status: :ok, location: @house_hunter }\n else\n format.html { render :edit }\n format.json { render json: @house_hunter.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @monkey = Monkey.find(params[:id])\n\n respond_to do |format|\n if @monkey.update_attributes(params[:monkey])\n format.html { redirect_to @monkey, notice: 'Monkey was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monkey.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n @housing_feature = HousingFeature.find(params[:id])\n\n respond_to do |format|\n if @housing_feature.update_attributes(params[:housing_feature])\n format.html { redirect_to @housing_feature, notice: 'Housing feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @housing_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n put :update\n end", "def update(*args)\n put(*args)\n end", "def update(*args)\n put(*args)\n end", "def update\n respond_to do |format|\n if @household_item.update(household_item_params)\n format.html { redirect_to @household_item, notice: 'Household item was successfully updated.' }\n format.json { render :show, status: :ok, location: @household_item }\n else\n format.html { render :edit }\n format.json { render json: @household_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @houmon.update(houmon_params)\n format.html { redirect_to @houmon, notice: 'Houmon was successfully updated.' }\n format.json { render :show, status: :ok, location: @houmon }\n else\n format.html { render :edit }\n format.json { render json: @houmon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @housing.update(housing_params)\n format.html { redirect_to @housing, notice: 'Housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing }\n else\n format.html { render :edit }\n format.json { render json: @housing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @floor = Floor.find(params[:id])\n params[:floor][:location_id] = params[:floor][:loc_id]\n params[:floor].delete :loc_id\n respond_to do |format|\n if @floor.update_attributes(params[:floor])\n format.html { redirect_to floors_path, notice: 'Floor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @floor.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @clothing.update(clothing_params)\n format.html { redirect_to @clothing, notice: 'Clothing was successfully updated.' }\n format.json { render :show, status: :ok, location: @clothing }\n else\n format.html { render :edit }\n format.json { render json: @clothing.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @fridge = Fridge.find(params[:id])\n\n respond_to do |format|\n if @fridge.update_attributes(params[:fridge])\n format.html { redirect_to @fridge, notice: 'Fridge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fridge.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n # respond_to do |format|\n # if @thing.update(thing_params)\n # format.html { redirect_to @thing, notice: 'Thing was successfully updated.' }\n # format.json { render :show, status: :ok, location: @thing }\n # else\n # format.html { render :edit }\n # format.json { render json: @thing.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def update\n @greenhouse = Greenhouse.find(params[:greenhouse_id])\n respond_to do |format|\n if @customer.update(customer_params)\n format.html { redirect_to greenhouse_customer_path(@greenhouse.id, @customer.id), notice: 'Customer was successfully updated.' }\n #format.json { render :show, status: :ok, location: @customer }\n else\n format.html { render :edit }\n #format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @house_style.update(house_style_params)\n format.html { redirect_to @house_style, notice: 'House style was successfully updated.' }\n format.json { render :show, status: :ok, location: @house_style }\n else\n format.html { render :edit }\n format.json { render json: @house_style.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @bunny.update(bunny_params)\n format.html { redirect_to @bunny, notice: 'Bunny was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bunny.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.69253844", "0.6804635", "0.6692679", "0.6692679", "0.6692679", "0.6692679", "0.66691625", "0.66691625", "0.66691625", "0.6668993", "0.65898436", "0.65022004", "0.65022004", "0.6394387", "0.6343761", "0.6331762", "0.62952375", "0.6277168", "0.6246402", "0.6243866", "0.6215614", "0.6200182", "0.61933416", "0.61712044", "0.61629474", "0.61617565", "0.61469054", "0.61304295", "0.6102155", "0.6032534", "0.6007653", "0.59966576", "0.59621996", "0.5947106", "0.5935738", "0.59330404", "0.59111905", "0.589272", "0.5891233", "0.58874816", "0.58819664", "0.58707625", "0.58638763", "0.5861331", "0.58592904", "0.584987", "0.58481866", "0.58447915", "0.5841728", "0.58340603", "0.58336556", "0.5824058", "0.5813464", "0.5808081", "0.57978827", "0.5795017", "0.57943577", "0.5790267", "0.578648", "0.5781201", "0.57794476", "0.57762885", "0.57759714", "0.576838", "0.57517415", "0.5747324", "0.5741986", "0.57395643", "0.57393384", "0.57392263", "0.5736731", "0.5736731", "0.57347554", "0.5733155", "0.5722609", "0.57165825", "0.5714936", "0.5700593", "0.5690554", "0.5689552", "0.5679693", "0.56787324", "0.56724703", "0.5666332", "0.5663499", "0.56579405", "0.5657334", "0.56558484", "0.56496835", "0.56496835", "0.5646986", "0.5644452", "0.5638253", "0.5635512", "0.563448", "0.5631168", "0.563021", "0.56229234", "0.5618363", "0.5618126", "0.56050277" ]
0.0
-1
DELETE /houses/1 DELETE /houses/1.json
def destroy @complex_building.destroy respond_to do |format| format.html { redirect_to complex_buildings_url, notice: 'complex_building was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @house = House.find(params[:id])\n @house.destroy\n\n respond_to do |format|\n format.html { redirect_to houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house = House.find(params[:id])\n @house.destroy\n\n respond_to do |format|\n format.html { redirect_to houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to house_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house = House.find(params[:id])\n @house.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house = House.find(params[:id])\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house = House.find(params[:id])\n @house.destroy\n\n respond_to do |format|\n format.html { redirect_to(houses_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @house = House.find(params[:id])\n @house.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_houses_url(:realty_type => params[:realty_type]) }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html {redirect_to houses_url, notice: 'House was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def destroy\n @show_house = ShowHouse.find(params[:id])\n @show_house.destroy\n\n respond_to do |format|\n format.html { redirect_to show_houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hasuk_house.destroy\n respond_to do |format|\n format.html { redirect_to hasuk_houses_url, notice: 'Hasuk house was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @household.destroy\n respond_to do |format|\n format.html { redirect_to households_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house_list.destroy\n respond_to do |format|\n format.html { redirect_to house_lists_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n respond_to do |format|\n format.html { redirect_to houses_url, notice: 'House was successfully destroyed.' }\n end\n end", "def destroy\n @note = Note.find(params[:id])\n @note.destroy\n\n respond_to do |format|\n format.html { redirect_to house_path(@note.house_id) }\n format.json { head :no_content }\n end\n end", "def destroy\n @houseinfo.destroy\n respond_to do |format|\n format.html { redirect_to houseinfos_url, notice: 'Houseinfo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @shelf.destroy\n respond_to do |format|\n format.html { redirect_to house_shelves_path(params[:house_id]), notice: 'Shelf was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \thouse = House.find(params[:id])\n \thouse.destroy\n \tredirect_to :action => :index\n end", "def destroy\n @clearing_house = ClearingHouse.find(params[:id])\n @clearing_house.destroy\n respond_to do |format|\n format.html { flash[:success] = 'Clearing house was successfully destroyed.'; redirect_to clearing_houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @household.destroy\n respond_to do |format|\n format.html { redirect_to households_url, notice: 'Household was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @publishing_house.destroy\n respond_to do |format|\n format.html { redirect_to publishing_houses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house.destroy\n end", "def destroy\n @houseguest.destroy\n respond_to do |format|\n format.html { redirect_to houseguests_url, notice: 'Houseguest was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @buy_house.destroy\n respond_to do |format|\n format.html { redirect_to buy_houses_url, notice: 'Buy house was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @hoge = Hoge.find(params[:id])\n @hoge.destroy\n\n respond_to do |format|\n format.html { redirect_to hoges_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ware_house.destroy\n respond_to do |format|\n format.html { redirect_to ware_houses_url, notice: 'Ware house was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @housebook.destroy\n respond_to do |format|\n format.html { redirect_to housebooks_url, notice: 'Housebook was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house_hunter.destroy\n respond_to do |format|\n format.html { redirect_to house_hunters_url }\n format.json { head :no_content }\n end\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def destroy\n @house_hunter.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: 'House hunter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @household_item.destroy\n respond_to do |format|\n format.html { redirect_to household_items_url, notice: 'Household item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @hood.destroy\n respond_to do |format|\n format.html { redirect_to hoods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house_account = HouseAccount.find(params[:id])\n @house_account.destroy\n\n head :no_content\n end", "def destroy\n id = params[:id]\n @physical_rack = PhysicalRack.any_of({_id: id}, {name: id.gsub('-', '.')}).first\n @physical_rack.destroy\n\n respond_to do |format|\n format.html { redirect_to physical_racks_url }\n format.json { head :ok }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @stone = Stone.find(params[:id])\n @stone.destroy\n\n respond_to do |format|\n format.html { redirect_to stones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @medium_road = MediumRoad.find(params[:id])\n @medium_road.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_roads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @road = Road.find(params[:id])\n @road.destroy\n\n respond_to do |format|\n format.html { redirect_to roads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @house_hunter.destroy\n respond_to do |format|\n format.html { redirect_to house_hunters_url, notice: 'House hunter was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @story.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @floor = Floor.find(params[:id])\n @floor.destroy\n\n respond_to do |format|\n format.html { redirect_to floors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rayon = Rayon.find(params[:id])\n @rayon.destroy\n\n respond_to do |format|\n format.html { redirect_to rayons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @three.destroy\n respond_to do |format|\n format.html { redirect_to threes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @single_housing.destroy\n respond_to do |format|\n format.html { redirect_to single_housings_url, notice: 'Single housing was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @house_work.destroy\n respond_to do |format|\n format.html { redirect_to house_works_url, notice: 'House work was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @neighbourhood.destroy\n respond_to do |format|\n format.html { redirect_to neighbourhoods_url, notice: 'Neighbourhood was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @railway = Railway.find(params[:id])\n @railway.destroy\n\n respond_to do |format|\n format.html { redirect_to railways_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @database = Database.find(params[:id])\n path = @database.path\n delete = %x[rm -R #{path}]\n @database.destroy\n\n respond_to do |format|\n format.html { redirect_to databases_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 destroy\n @lob.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @anuncio.destroy\n respond_to do |format|\n format.html { redirect_to @street, notice: 'Anuncio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @goody = Goody.find(params[:id])\n @goody.destroy\n\n respond_to do |format|\n format.html { redirect_to goodies_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @baton = Baton.find(params[:id])\n @baton.destroy\n\n respond_to do |format|\n format.html { redirect_to batons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @broad = Broad.find(params[:id])\n @broad.destroy\n\n respond_to do |format|\n format.html { redirect_to broads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @historial = Historial.find(params[:id])\n @historial.destroy\n\n respond_to do |format|\n format.html { redirect_to historials_url }\n format.json { head :ok }\n end\n end", "def destroy\n @subway = Subway.find(params[:id])\n @subway.destroy\n\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :ok }\n end\n end", "def destroy\n @mostsmallroad = Mostsmallroad.find(params[:id])\n @mostsmallroad.destroy\n\n respond_to do |format|\n format.html { redirect_to mostsmallroads_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_neighbourhood.destroy\n respond_to do |format|\n format.html { redirect_to admin_neighbourhoods_url, notice: 'Neighbourhood was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @owner = Owner.find(params[:id])\n if owner\n @house = @owner.house\n @house.owner_name = nil\n @house.save\n @owner.destroy\n end\n redirect_to houses_path\n end", "def destroy\n @house_book = HouseBook.find(params[:id])\n @house_book.destroy\n\n respond_to do |format|\n format.html { redirect_to(house_books_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @house_style.destroy\n respond_to do |format|\n format.html { redirect_to house_styles_url, notice: 'House style was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @neighborhood = Neighborhood.find(params[:id])\n @neighborhood.destroy\n\n respond_to do |format|\n format.html { redirect_to neighborhoods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @neighborhood = Neighborhood.find(params[:id])\n @neighborhood.destroy\n\n respond_to do |format|\n format.html { redirect_to neighborhoods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @nail_salon = NailSalon.find(params[:id])\n @nail_salon.destroy\n\n respond_to do |format|\n format.html { redirect_to nail_salons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @houmon.destroy\n respond_to do |format|\n format.html { redirect_to houmons_url, notice: 'Houmon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cephalopod.destroy\n respond_to do |format|\n format.html { redirect_to cephalopods_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bustour.destroy\n respond_to do |format|\n format.html { redirect_to bustours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @orphan.destroy\n respond_to do |format|\n format.html { redirect_to orphans_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @photo1 = Photo1.find(params[:id])\n @photo1.destroy\n\n respond_to do |format|\n format.html { redirect_to photo1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @have = Have.find(params[:id])\n @have.destroy\n\n respond_to do |format|\n format.html { redirect_to haves_url }\n format.json { head :ok }\n end\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def destroy\n @walikela.destroy\n respond_to do |format|\n format.html { redirect_to walikelas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @moonwalk.destroy\n respond_to do |format|\n format.html { redirect_to moonwalks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n animal = Animal.find(params[:id])\n animal.destroy\n head 204\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 if session[:role] != \"admin\"\n realtor = Realtor.find_by(users_id: session[:user_id])\n if realtor == nil || @house.realtor_id != realtor.id\n redirect_to houses_path, notice: \"You cannot delete listing you have not posted\"\n end\n end\n @house.destroy\n respond_to do |format|\n format.html {redirect_to houses_url, notice: 'House was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def destroy\n @geocach = Geocach.find(params[:id])\n @geocach.destroy\n\n respond_to do |format|\n format.html { redirect_to geocaches_url }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n @garbage = Garbage.find(params[:id])\n @garbage.destroy\n\n respond_to do |format|\n format.html { redirect_to garbages_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end", "def destroy\n @ninja = Ninja.find(params[:id])\n @ninja.destroy\n\n respond_to do |format|\n format.html { redirect_to ninjas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @floor.destroy\n respond_to do |format|\n format.html { redirect_to @floor.building, notice: t('flash.floor.delete') }\n format.json { head :no_content }\n end\n end" ]
[ "0.775449", "0.775449", "0.7703315", "0.7703315", "0.7672422", "0.7645576", "0.757675", "0.74771893", "0.74771893", "0.74771893", "0.74771893", "0.74771893", "0.74771893", "0.7450561", "0.7419867", "0.74038297", "0.73984444", "0.72788393", "0.7218025", "0.7164156", "0.7153549", "0.71156865", "0.7108061", "0.7089123", "0.70741427", "0.7047972", "0.70126045", "0.7000478", "0.69776803", "0.6965038", "0.6920386", "0.6867514", "0.6848504", "0.6847656", "0.6770581", "0.6767066", "0.6734521", "0.67076373", "0.6698816", "0.6680896", "0.665886", "0.6642967", "0.66424656", "0.66420656", "0.66233087", "0.6604074", "0.6597528", "0.65916395", "0.65754515", "0.65585566", "0.6557278", "0.65569776", "0.65488213", "0.6544723", "0.65337116", "0.6526068", "0.652134", "0.65210235", "0.6516393", "0.651578", "0.65145504", "0.6505916", "0.6504864", "0.649123", "0.64904463", "0.6488986", "0.6484034", "0.64794874", "0.6477837", "0.6472146", "0.64715034", "0.6466088", "0.6464335", "0.6464057", "0.6464023", "0.64631313", "0.64631313", "0.6459921", "0.6459465", "0.6454521", "0.64526457", "0.6450698", "0.64478916", "0.64423966", "0.6440229", "0.6440141", "0.6439494", "0.6435484", "0.6434496", "0.6434496", "0.6430762", "0.6426844", "0.6425227", "0.6418231", "0.641288", "0.640666", "0.640666", "0.6403723", "0.64032924", "0.6400687", "0.63986176" ]
0.0
-1
Use callbacks to share common setup or constraints between actions.
def set_complex_building @complex_building = ComplexBuilding.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
Only allow a list of trusted parameters through.
def complex_building_params params.require(:complex_building).permit(:owner, :address, :units, :sqmt, :price) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def allowed_params\n ALLOWED_PARAMS\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "def param_whitelist\n [:role, :title]\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 strong_params\n params.require(:user).permit(param_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 allow_params_authentication!; end", "def whitelisted_args\n args.select &:allowed\n end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def safe_list_sanitizer; end", "def filtered_parameters; end", "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def expected_permitted_parameter_names; end", "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); end", "def safe_list_sanitizer=(_arg0); 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 param_whitelist\n [:rating, :review]\n end", "def check_params; true; end", "def strong_params\n params.require(:experience).permit(param_whitelist)\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 allowed?(*_)\n true\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 allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\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 permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "def valid_params?; 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 url_allowlist=(_arg0); 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 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 list_params\n params.permit(:list_name)\n end", "def valid_params_request?; end", "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "def safelists; end", "def authorize_own_lists\n authorize_lists current_user.lists\n end", "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "def lists_params\n params.require(:list).permit(:name)\n\n end", "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "def check_params\n true\n end", "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "def filter_parameters; end", "def filter_parameters; end", "def whitelist; end", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.permit(:name)\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def permitted_params\n []\n end", "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "def params(list)\n @declared_params = list\n end", "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "def allow(ids); end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "def list_params\n params.require(:list).permit(:name)\n end", "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "def safelist; end", "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "def valid_for_params_auth?; end", "def default_param_whitelist\n [\"mode\"]\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 shopping_list_params\n params.require(:shopping_list).permit!\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 safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def permitters\n @_parametrizr_permitters || {}\n end", "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "def url_allowlist; end", "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "def quote_params\n params.permit!\n end" ]
[ "0.69497335", "0.6812623", "0.6803639", "0.6795365", "0.67448795", "0.67399913", "0.6526815", "0.6518771", "0.64931697", "0.6430388", "0.6430388", "0.6430388", "0.63983387", "0.6356042", "0.63535863", "0.63464934", "0.63444513", "0.6337208", "0.6326454", "0.6326454", "0.6326454", "0.63140553", "0.6299814", "0.62642586", "0.626006", "0.62578833", "0.6236823", "0.6227561", "0.6221758", "0.62200165", "0.620879", "0.61983657", "0.6195055", "0.6172993", "0.6156856", "0.61558664", "0.61521494", "0.6135789", "0.6121145", "0.61118174", "0.60736513", "0.6071645", "0.60632104", "0.60549796", "0.6043906", "0.6034662", "0.60207325", "0.6018568", "0.6016575", "0.60103434", "0.60084206", "0.600763", "0.6007443", "0.6003619", "0.6003619", "0.5995791", "0.5993301", "0.5993231", "0.5984926", "0.597122", "0.5968121", "0.5965808", "0.59640145", "0.59632224", "0.59602356", "0.59332967", "0.5927556", "0.5922805", "0.5909745", "0.5905083", "0.5904304", "0.5893434", "0.58888215", "0.58823985", "0.58823985", "0.58823985", "0.5873434", "0.58619875", "0.58533794", "0.5845531", "0.58426666", "0.58360124", "0.583218", "0.5828041", "0.5827927", "0.5816121", "0.5814705", "0.5812719", "0.581121", "0.5803423", "0.5803423", "0.57995003", "0.5794207", "0.5784923", "0.5781365", "0.5776385", "0.5774859", "0.57671493", "0.5766998", "0.57618684", "0.5758038" ]
0.0
-1
topic_reply_count is a count of posts in other users' topics
def update_topic_reply_count self.topic_reply_count = Topic .joins("INNER JOIN posts ON topics.id = posts.topic_id AND topics.user_id <> posts.user_id") .where("posts.deleted_at IS NULL AND posts.user_id = ?", self.user_id) .distinct .count end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def topics_count\n object.topics.count\n end", "def user_topic_share_count(user_id, topic_neo_id)\n #Rails.cache.fetch(\"neo4j-#{user_id}-#{topic_id}-share_count\", :expires_in => 1.day) do\n count = 0\n query = \"\n START n=node(#{topic_neo_id})\n MATCH n-[:pull*0..20]->x<-[r:talking]-y\n WHERE y.uuid = '#{user_id}'\n RETURN r.shares\n \"\n data = Neo4j.neo.execute_query(query)\n ids = []\n if data && data['data']\n data['data'].each do |d|\n ids += d[0]\n end\n count = ids.uniq.length\n end\n count\n #end\n end", "def increment_posts_stats\n # the first post don't count towards counters\n if self.topic.posts.length > 1\n self.topic.forum.update_attribute(:post_count, self.topic.forum.post_count + 1)\n self.topic.update_attribute(:replies, self.topic.replies + 1)\n self.user.update_attribute(:post_count, self.user.post_count + 1)\n end\n end", "def update_topics_count\n self.board.update_attributes!(:topics_count => Topic.count(:all, :conditions => {:board_id => self.board.id}))\n end", "def update_replies_count\n Answer.update_counters(answer_id, replies_count: 1)\n end", "def get_user_count(id, topic_name)\n timenow = DateTime.now\n if topic_name != \"Main\"\n return Active.where(:channel_id => id, :topic_name => topic_name).where(\"updated > ?\", timenow-5.seconds).size\n else\n return Active.where(:channel_id => id).where(\"updated > ?\", timenow-5.seconds).size\n end\n end", "def get_threaded_discussion_topic_response_count(user_id, course_id, thread_id, topic_id, depth = nil)\r\n if depth.nil?\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSECOUNTS_DEPTH % [user_id, course_id, thread_id, topic_id, depth]\r\n else\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSECOUNTS % [user_id, course_id, thread_id, topic_id]\r\n end\r\n get(relative_url)\r\n end", "def check_new_user_many_replies\n return unless replying? && @user.posted_too_much_in_topic?(@details[:topic_id])\n\n {\n id: 'too_many_replies',\n templateName: 'education',\n body: PrettyText.cook(I18n.t('education.too_many_replies', newuser_max_replies_per_topic: SiteSetting.newuser_max_replies_per_topic))\n }\n end", "def decrement_posts_stats\n # first post don't count towards counters\n if self.topic.posts.length > 1\n self.topic.forum.update_attribute(:post_count, self.topic.forum.post_count - 1)\n self.topic.update_attribute(:replies, self.topic.replies - 1)\n self.user.update_attribute(:post_count, self.user.post_count - 1)\n end\n end", "def upvotes_count\n topic_votes.where(value: 1).sum(:value)\n end", "def index\n @topics = Topic.all\n @new_topics = Topic.all.order(created_at: :desc).first(5)\n \n count = Hash.new\n \n Topic.ids.each do |id|\n count[id] = Topic.find(id).comments.count\n end\n \n comment = Hash[ count.sort_by{ |_, v| -v } ]\n \n @many_comments_topics = Topic.find(comment.keys)\n end", "def upcoming_count\n @upcoming_count ||= @upcoming_sessions.try(:length) || Session.upcoming.where(topic: self).count\n end", "def knowledgable_users\n topic_answers = self.answers\n topic_user_scores = Hash.new(){0}\n authors_with_answers = Hash.new(){0}\n\n topic_answers.each do |answer|\n answer_author = answer.author\n authors_with_answers.push(answer_author)\n topic_user_scores[answer_author] += 1\n end\n\n authors_with_answers.each do |author|\n prev_record = TopicUserKnow.find_by({author_id: author.id, topic_id: topic.id})\n if prev_record\n prev_record.update_attributes({score: topic_user_scores[author] })\n else\n TopicUserKnow.create({author_id: author.id, topic_id: topic.id, score: topic_user_scores[author]})\n end\n end\n\n end", "def counts\n reply.documents[0][COUNTS]\n end", "def topics_count_supported_in_words(tier)\n if tier && (topics_count = tier.topics_count)\n topic_class = Topic\n \"%{topics_count} supported\".t % {:topics_count => link_to(\n I18n.t(\"{{count}} topic\", :count => topics_count).firstcase, collection_path([tier, Topic])\n )}\n end\n end", "def update_topics_kases_count\n self.topics.each do |topic|\n ua = {}\n ua.merge!(:kases_count => topic.kases.count(\"kases.id\", self.class.find_options_for_visible({:distinct => true}))) if topic.class.columns.to_a.map {|a| a.name.to_sym}.include?(:kases_count)\n ua.merge!(:people_count => topic.people.count) if topic.class.columns.to_a.map {|a| a.name.to_sym}.include?(:people_count)\n unless ua.empty?\n topic.class.transaction do \n topic.lock!\n topic.update_attributes(ua)\n end\n end\n end\n end", "def replies\n Post.where(\"topic_id = ?\", self.id).order(\"created_at asc\")\n #Post.find_all_by_topic_id(self.id).order(\"created_at desc\")\n end", "def show\n\t\treferenced = @topic.tweets.count(:distinct)\n\t\tusers = @topic.tweets.user.count(:distinct)\n\t\trender json: show_json(@topic, referenced, users)\n\tend", "def following_posts_count\n count_sql=<<-SQL\n SELECT COUNT(*) AS num FROM posts p\n INNER JOIN follows f ON f.followable_id = p.user_id \n INNER JOIN visit_journals v ON v.user_id = p.user_id\n\t WHERE f.follower_id = #{self.id} AND p.created_at > v.last_visited_at\n\tGROUP BY p.user_id\n SQL\n User.find_by_sql(count_sql)\n end", "def update_forum_counter_cache\n forum_conditions = ['topics_count = ?', Topic.count(:id, :conditions => {:forum_id => forum_id})]\n # if the topic moved forums\n if !frozen? && @old_forum_id && @old_forum_id != forum_id\n set_post_forum_id\n Forum.update_all ['topics_count = ?, posts_count = ?', \n Topic.count(:id, :conditions => {:forum_id => @old_forum_id}),\n Post.count(:id, :conditions => {:forum_id => @old_forum_id})], ['id = ?', @old_forum_id]\n end\n # if the topic moved forums or was deleted\n if frozen? || (@old_forum_id && @old_forum_id != forum_id)\n forum_conditions.first << \", posts_count = ?\"\n forum_conditions << Post.count(:id, :conditions => {:forum_id => forum_id})\n end\n # User doesn't have update_posts_count method in SB2, as reported by Ryan\n\t\t\t#@voices.each &:update_posts_count if @voices\n Forum.update_all forum_conditions, ['id = ?', forum_id]\n @old_forum_id = @voices = nil\n end", "def count_messages\r\n @messages.size\r\n end", "def count_messages\n Mailboxer::Message.conversation(self).count\n end", "def getViews(topic)\n post_views = Micropost.where(topic: topic).pluck(:views)\n views = 0\n post_views.each do |post_view|\n views += post_view\n end\n return views\n end", "def post_count\n self.interests_posts.count\n end", "def answered_topics_by_user\n user_answers = Answer.where(uuid: params[:uuid])\n topic_ids = user_answers.map{ |a| a.statement.topic.id }\n render json: topic_ids.uniq, status:200\n end", "def update_forum_counter_cache\n @forum_conditions = ['topics_count = ?', Topic.count(:id, :conditions => \"forum_id = #{forum_id}\")]\n account_for_forum_change\n Forum.update_all @forum_conditions, ['id = ?', forum_id]\n @old_forum_id = nil\n set_section_topic_count\n end", "def count_messages\n return Message.conversation(self).count\n end", "def active_post_count usr\n posts.active_status(usr).size rescue 0\n end", "def interested_users_count\n self.users.size\n end", "def count\n MsgQ.count(@qid)\n end", "def post_count\n posts.length\n end", "def can_reply_to?(topic) false end", "def unread_count(user)\n public_replies(user).unread_by(user).size + (unread?(user) ? 1 : 0)\n end", "def number_of_posts\n self.posts.size\n end", "def get_threaded_discussion_response_count(user_id, course_id, thread_id,\r\n topic_id, response_id, depth = nil)\r\n\r\n if depth.nil?\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSECOUNTS % [user_id, course_id,\r\n thread_id, topic_id,\r\n response_id]\r\n else\r\n relative_url = PATH_USERS_COURSES_THREADEDDISCUSSIONS_TOPICS_RESPONSES_RESPONSECOUNTS_DEPTH % [user_id, course_id,\r\n thread_id, topic_id,\r\n response_id, depth]\r\n end\r\n get(relative_url)\r\n end", "def n_removed\n return 0 unless acknowledged?\n @replies.reduce(0) do |n, reply|\n n += reply.documents.first[N]\n end\n end", "def n_removed\n return 0 unless acknowledged?\n @replies.reduce(0) do |n, reply|\n n += reply.documents.first[N]\n end\n end", "def count_messages(filter = nil)\n with_queue_control do |control|\n control.count_messages(filter)\n end\n end", "def after_create\n Stat.increment_counter(:reply_count, self.user.stat.id)\n \n if self.yes?\n Question.increment_counter(:yes_count, question.id)\n else\n Question.increment_counter(:no_count, question.id)\n end\n end", "def unread_notification_count\n unread_notifications.count\n end", "def edit\n @post = Post.find(params[:id])\n @topics = @topic.category.topics.sorted\n @post_count = Post.count\n end", "def create\n @reply = Reply.new(reply_params)\n @reply.list_id = @list.id\n @reply.user_id = current_user.id\n\n if @reply.save\n @replies_count = @topic.replies_count + 2\n current_user.read_topic(@topic)\n @msg = t('topics.reply_success')\n else\n @msg = @reply.errors.full_messages.join('<br />')\n end\n end", "def update_talk_count(user, topic, change, user_node=nil, topic_node=nil, post_id=nil)\n talking = Neo4j.neo.get_relationship_index('talking', 'nodes', \"#{user.id.to_s}-#{topic.id.to_s}\")\n user_node = Neo4j.neo.get_node_index('users', 'uuid', user.id.to_s) unless user_node\n topic_node = Neo4j.neo.get_node_index('topics', 'uuid', topic.id.to_s) unless topic_node\n\n if talking\n payload = {}\n properties = Neo4j.neo.get_relationship_properties(talking)\n weight = properties && properties['weight'] ? properties['weight'] : 0\n if weight + change == 0\n Neo4j.neo.delete_relationship(talking)\n Neo4j.neo.remove_relationship_from_index('talking', talking)\n else\n payload['weight'] = weight+change\n end\n\n if post_id\n if change > 0\n payload['shares'] = properties['shares'] ? (properties['shares'] << post_id.to_s).uniq : [post_id.to_s]\n elsif properties['shares']\n properties['shares'].delete(post_id.to_s)\n payload['shares'] = properties['shares'] if properties['shares'].length > 0\n end\n end\n\n Neo4j.neo.set_relationship_properties(talking, payload) if payload.length > 0\n else\n payload = {'weight' => change}\n if post_id\n payload['shares'] = [post_id.to_s]\n end\n\n talking = Neo4j.neo.create_relationship('talking', user_node, topic_node)\n Neo4j.neo.set_relationship_properties(talking, payload)\n Neo4j.neo.add_relationship_to_index('talking', 'nodes', \"#{user.id.to_s}-#{topic.id.to_s}\", talking)\n end\n\n Neo4j.update_affinity(user.id.to_s, topic.id.to_s, user_node, topic_node, change, true)\n end", "def popular_topics\n topics = []\n results = repository.adapter.select('SELECT t.id, t.name, COUNT(*) count FROM topics t INNER JOIN messages m ON t.id = m.topic_id GROUP BY t.id ORDER BY COUNT(*) DESC')\n \n # Loop over aggregate results\n results.each do |result|\n topic = Topic.get(result.id)\n \n # Skip topic if it has been notified within the window\n notification = *topic.notifications(:source => name, :order => :created_at.desc)\n next if notification && Time.now-Time.parse(notification.created_at.to_s) < window\n\n # Skip topic if it doesn't contain any of the filtered tags\n if tags && tags.length > 0\n found = false\n tags.each do |tag|\n m, tag_type, tag_value = *tag.match(/^(\\w+):(.+)$/)\n \n if topic.tags(:type => tag_type, :value => tag_value).length > 0\n found = true\n break\n end\n end\n next unless found\n end\n \n # If validations have all passed, add the topic to the list\n topics << topic\n end\n\n return topics\n end", "def count_for_target\n NotifyUser::BaseNotification.for_target(target)\n .where('parent_id IS NULL')\n .where('state IN (?)', [\"sent_as_aggregation_parent\", \"sent\", \"pending\"])\n .count\n end", "def question_count \n @by_question.count\n end", "def increment_both_no_reply_count!\n increment_both_no_reply_count\n save\n end", "def index\n @forum = Forum.find(params[:forum_id])\n @topic = @forum.topics.find(params[:topic_id])\n @topic.update_attribute(:views, @topic.views + 1)\n @posts = @topic.posts\n @posts = @posts.paginate :page => params[:page], :per_page => posts_per_page\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "def recent_topics(count: 10)\n Topic.reorder(updated_at: :desc).where(user_id: id).limit(count)\n end", "def notifications_count\n notifications_count ||= self.notifications_to_show_user.where(:seen_by_user => false).count\n end", "def subscribers_count\n subscribers_as_people.uniq.count\n end", "def questions_count\n self.questions.count\n end", "def my_count\n count = my_followers.count\n end", "def create\n @forum = Forum.find(params[:id])\n @reply = @forum.replies.create(params[:reply])\n if @reply.save\n @forum.update_attribute(\"no_of_replies\", @forum.no_of_replies.to_i + 1)\n redirect_to emp_logins_forums_url(@forum), notice: 'Your reply was saved successfully.'\n else\n redirect_to emp_logins_forums_url(@forum), notice: \"Couldn't save your reply!\"\n end\n end", "def unread_messages_count\n @unread_messages_count ||= messages.unread.count\n end", "def subscriber_count\n subscribers.size\n end", "def likes_count\n self.likes.size\n end", "def can_reply_to_forem_topic? topic\n true\n end", "def feed_unread_count(feed)\n SubscriptionsManager.feed_unread_count feed, self\n end", "def update_cached_fields\n Forum.update_all ['posts_count = ?', Post.count(:id, :conditions => {:forum_id => forum_id})], ['id = ?', forum_id]\n AnAxe::Config.user_class.update_posts_count(user_id) if AnAxe::Config.user_class.respond_to?(:update_posts_count)\n topic.update_cached_post_fields(self)\n end", "def returned_count\n reply.documents.length\n end", "def update_associated_count\n self.update_kase_responses_count\n self.update_person_responses_count\n end", "def subscriptions_count\n subscriptions.count\n end", "def responses_count\n @responses_count ||= self.responses.visible.count || 0\n end", "def update_replies\n # https://api.slack.com/methods/conversations.replies\n # scopes: channels:history, groups:history, im:history, mpim:history\n replies = slack_client.conversations_replies(channel: channel_id, ts: slack_ts, inclusive: true, limit: 1)\n message = replies['messages'].first\n self.starter ||= User.find_or_create_by(slack_id: message['user'], team: team)\n self.latest_reply_ts = message['latest_reply']\n self.reply_count = message['reply_count']\n self.reply_users = message['reply_users'].map do |reply_user|\n user = User.find_or_create_by(slack_id: reply_user, team: team)\n user.id\n end.join(', ')\n self.reply_users_count = message['reply_users_count']\n save\n rescue Slack::Web::Api::Errors::MissingScope => _e\n false\n end", "def top_reviewers(p_topic, p_limit = 10)\n User.find(\n :all,\n :select => 'DISTINCT users.*',\n :joins => :reviews,\n :group => 'reviews.id',\n :order => 'count(reviews.id) DESC',\n :conditions => ['reviews.topic_id = ?', p_topic.id],\n :limit => p_limit\n )\n end", "def increment_doer_no_reply_count!\n increment_doer_no_reply_count\n save\n end", "def following_users_count\n following_users.count\n end", "def count_results(result_array)\n results = empty_counter\n result_array.each do |topic|\n topic.keys.each {|key| results[key] += topic[key]}\n end\n results\n end", "def count_for_target(target)\n BaseNotification.unread_count_for_target(target)\n end", "def followers_count\n @target.followers_count.to_i\n end", "def message_count( params={} )\n message_count = get_connections(\"message_count\", params)\n return map_connections message_count, :to => Facebook::Graph::Generic\n end", "def notification_count\n return NotificationReader.where(user: current_user, read_at: nil).count\n end", "def destroy\n @forum = Forum.find(params[:forum_id])\n @reply = @forum.replies.find(params[:id])\n if @reply.destroy and @forum.update_attribute(\"no_of_comments\", @forum.no_of_replies.to_i - 1)\n redirect_to forum_url(@forum), notice: 'Reply was moderated successfully.'\n else\n redirect_to forum_url(@forum), notice: 'Reply was moderated successfully.'\n end\n end", "def likes_in_topic_sql\n # todo: sort out likes count\n <<~SQL\n SELECT\n t.id,\n t.slug AS topic_slug,\n t.title,\n c.slug AS category_slug,\n c.name AS category_name,\n c.id AS category_id,\n NULL AS post_number,\n COUNT(*) AS action_count\n FROM post_actions pa\n JOIN posts p\n ON p.id = pa.post_id\n JOIN topics t\n ON t.id = p.topic_id\n JOIN categories c\n ON c.id = t.category_id\n WHERE pa.created_at BETWEEN :start_date AND :end_date\n AND pa.post_action_type_id = 2\n AND c.id = :cat_id\n AND c.read_restricted = 'false'\n AND t.deleted_at IS NULL\n GROUP BY t.id, category_slug, category_name, c.id\n ORDER BY action_count DESC\n LIMIT 5\n SQL\n end", "def message_count(queue)\n connect do |bunny|\n return bunny.queue(queue, :durable => true, :auto_delete => false).message_count\n end\n end", "def unread_message_count(current_user)\n \tself.messages.where(\"user_id != ? AND read = ?\", current_user.id, false).count\n \tend", "def number_of_related_events(login=nil)\n count_by_frbr(login, :is_related_to, :how_many_events?) \n end", "def reply\n is_reputable_to do\n @post = Post.find(params[:id])\n @topic = @post.topic\n @topicable = @topic.topicable\n #\n render_reply_form\n end \n end", "def update_count\n self.term_taxonomies.update_column('count', self.term_taxonomies.posts.published.size) if self.term_taxonomies.present? && !self.term_taxonomies.try(:posts).nil?\n end", "def count\n active_message_count || 0\n end", "def get_number_of_publishers\n @connections.length\n end", "def count_posts(people)\n get_posts(people.as(:person)).count_section(:person)\nend", "def most_active_users\n ids = replies.not_anonymous.count(:user_id,\n :group => :user_id,\n :order => \"count_user_id DESC\",\n :limit => (4 - experts.length)).keys\n User.find(ids.compact)\n end", "def author_word_counts\n joined_authors.map { |author| [author.username, word_count_for(author)] }.sort_by{|a| -a[1] }\n end", "def all_posts\n posts = Topic.find(params[:topic_id]).posts\n render :json => posts.order(:created_at => :desc), :include => {:topics => {}, :user => {}}, :methods => [:comment_size]\n end", "def unread_message_count\n eval 'messages.count(:conditions => [\"recepient_id = ? AND read_at IS NULL\", self.beamer_id])'\n end", "def answer_count\n if is_standard?\n respond_to?(:copy_answer_count_col) ? copy_answer_count_col : copies.inject(0){|sum,c| sum += c.answer_count}\n else\n respond_to?(:answer_count_col) ? answer_count_col : answers.count\n end\n end", "def subscription_count\n @subs.size\n end", "def show\n page = params[:page]\n # Find the page of the requested reply\n if params[:r] && page.nil?\n offset = @topic.children.where(\"#{Message.table_name}.id < ?\", params[:r].to_i).count\n page = 1 + offset / REPLIES_PER_PAGE\n end\n\n @reply_count = @topic.children.count\n @reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page\n @replies = @topic.children.\n includes(:author, :attachments, {:board => :project}).\n reorder(\"#{Message.table_name}.created_on ASC, #{Message.table_name}.id ASC\").\n limit(@reply_pages.per_page).\n offset(@reply_pages.offset).\n to_a\n\n @reply = Message.new(:subject => \"RE: #{@message.subject}\")\n render :action => \"show\", :layout => false if request.xhr?\n \n board_breadcrumb(@message) \n watcher_link(@topic, User.current) \n link_to(\n l(:button_quote),\n {:action => 'quote', :id => @topic},\n :method => 'get',\n :class => 'icon icon-comment',\n :remote => true) if !@topic.locked? && authorize_for('messages', 'reply') \n link_to(\n l(:button_edit),\n {:action => 'edit', :id => @topic},\n :class => 'icon icon-edit'\n ) if @message.editable_by?(User.current) \n link_to(\n l(:button_delete),\n {:action => 'destroy', :id => @topic},\n :method => :post,\n :data => {:confirm => l(:text_are_you_sure)},\n :class => 'icon icon-del'\n ) if @message.destroyable_by?(User.current) \n avatar(@topic.author, :size => \"24\") \n @topic.subject \n authoring @topic.created_on, @topic.author \n textilizable(@topic, :content) \n link_to_attachments @topic, :author => false, :thumbnails => true \n unless @replies.empty? \n l(:label_reply_plural) \n @reply_count \n @replies.each do |message| \n \"message-#{message.id}\" \n link_to(\n '',\n {:action => 'quote', :id => message},\n :remote => true,\n :method => 'get',\n :title => l(:button_quote),\n :class => 'icon icon-comment'\n ) if !@topic.locked? && authorize_for('messages', 'reply') \n link_to(\n '',\n {:action => 'edit', :id => message},\n :title => l(:button_edit),\n :class => 'icon icon-edit'\n ) if message.editable_by?(User.current) \n link_to(\n '',\n {:action => 'destroy', :id => message},\n :method => :post,\n :data => {:confirm => l(:text_are_you_sure)},\n :title => l(:button_delete),\n :class => 'icon icon-del'\n ) if message.destroyable_by?(User.current) \n avatar(message.author, :size => \"24\") \n link_to message.subject, { :controller => 'messages', :action => 'show', :board_id => @board, :id => @topic, :r => message, :anchor => \"message-#{message.id}\" } \n authoring message.created_on, message.author \n textilizable message, :content, :attachments => message.attachments \n link_to_attachments message, :author => false, :thumbnails => true \n end \n pagination_links_full @reply_pages, @reply_count, :per_page_links => false \n end \n if !@topic.locked? && authorize_for('messages', 'reply') \n toggle_link l(:button_reply), \"reply\", :focus => 'message_content' \n form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :html => {:multipart => true, :id => 'message-form'} do |f| \n render :partial => 'form', :locals => {:f => f, :replying => true} \n submit_tag l(:button_submit) \n preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form') \n end \n end \n html_title @topic.subject \n\n error_messages_for 'message' \n replying ||= false \n l(:field_subject) \n f.text_field :subject, :size => 120, :id => \"message_subject\" \n unless replying \n if @message.safe_attribute? 'sticky' \n f.check_box :sticky \n label_tag 'message_sticky', l(:label_board_sticky) \n end \n if @message.safe_attribute? 'locked' \n f.check_box :locked \n label_tag 'message_locked', l(:label_board_locked) \n end \n end \n if !replying && !@message.new_record? && @message.safe_attribute?('board_id') \n l(:label_board) \n f.select :board_id, boards_options_for_select(@message.project.boards) \n end \n label_tag \"message_content\", l(:description_message_content), :class => \"hidden-for-sighted\" \n f.text_area :content, :cols => 80, :rows => 15, :class => 'wiki-edit', :id => 'message_content' \n wikitoolbar_for 'message_content' \n l(:label_attachment_plural) \n render :partial => 'attachments/form', :locals => {:container => @message} \n\n if defined?(container) && container && container.saved_attachments \n container.saved_attachments.each_with_index do |attachment, i| \n i \n text_field_tag(\"attachments[p#{i}][filename]\", attachment.filename, :class => 'filename') +\n text_field_tag(\"attachments[p#{i}][description]\", attachment.description, :maxlength => 255, :placeholder => l(:label_optional_description), :class => 'description') +\n link_to('&nbsp;'.html_safe, attachment_path(attachment, :attachment_id => \"p#{i}\", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') \n hidden_field_tag \"attachments[p#{i}][token]\", \"#{attachment.token}\" \n end \n end \n file_field_tag 'attachments[dummy][file]',\n :id => nil,\n :class => 'file_selector',\n :multiple => true,\n :onchange => 'addInputFiles(this);',\n :data => {\n :max_file_size => Setting.attachment_max_size.to_i.kilobytes,\n :max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),\n :max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,\n :upload_path => uploads_path(:format => 'js'),\n :description_placeholder => l(:label_optional_description)\n } \n l(:label_max_size) \n number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) \n content_for :header_tags do \n javascript_include_tag 'attachments' \n end \n\nend", "def total_count(queue)\n collection.find(conditions(queue)).count\n end", "def notification_count\n @notifications.size\n end", "def destroy\n @moderation ||= Moderation.find(params[:id])\n @moderation.destroy\n @moderated_topics_count = @moderation.moderated_object.forum.moderations.topics.for_user(current_user).count\n end", "def tweets_count\n @_tweets_count ||= tweets.count\n end", "def num_unread_messages\n return Message.where({:receiver_id => self.id, :read => false}).count\n end", "def post_count(user)\n published = user.posts.published.count\n unpublished = user.posts.unpublished.count\n posts_due_to_date = user.assessments.count\n\n posts = \"#{published}/#{unpublished} of #{posts_due_to_date}\"\n\n if user.posts.published.count == 0\n [posts, { class: 'danger' }]\n else\n posts\n end\n end", "def followers_count_in_words(kase)\n case kase.kind\n when :idea then (\"%{people} like this idea\" % {:people => \"%d person\" / kase.followers_count})\n when :question then (\"%{people} have this question\" % {:people => \"%d person\" / kase.followers_count})\n when :question then (\"%{people} have this problem\" % {:people => \"%d person\" / kase.followers_count})\n when :praise then (\"%{people} gave same praise\" % {:people => \"%d person\" / kase.followers_count})\n end\n end", "def increment_doer_no_reply_count\n return true if seen_second_doer_no_reply?\n if seen_first_doer_no_reply\n self.seen_second_doer_no_reply = true\n else\n self.seen_first_doer_no_reply = true\n end\n end", "def top_contributors(p_topic, p_limit = 10)\n User.find(\n :all,\n :select => 'DISTINCT users.*',\n :joins => :restaurants,\n :group => 'restaurants.id',\n :order => 'count(restaurants.id) DESC',\n :conditions => ['restaurants.topic_id = ?', p_topic.id],\n :limit => p_limit\n )\n end", "def get_counts\n #1 - @friend_count -> gets the number of current friends you have.\n @friend_count = current_user.active_friends.size\n \n #2 - @pending_count -> gets the number of pending friend requests you have.\n @pending_count = current_user.pending_friend_requests_to.map(&:friend).size\n end" ]
[ "0.7249491", "0.68897986", "0.68819386", "0.67542744", "0.66232777", "0.6512704", "0.641848", "0.63893986", "0.6151594", "0.6043848", "0.6042928", "0.6040166", "0.60299367", "0.6027247", "0.5970238", "0.59689224", "0.5939298", "0.5925119", "0.59123915", "0.58930373", "0.5887383", "0.5878079", "0.58698076", "0.585577", "0.5830103", "0.5824512", "0.5804944", "0.5794448", "0.5782794", "0.5776423", "0.5773529", "0.5762101", "0.5756394", "0.57505697", "0.57501566", "0.57440394", "0.57440394", "0.5724599", "0.57227707", "0.5719896", "0.571812", "0.5707007", "0.5704349", "0.57006985", "0.569164", "0.5684928", "0.56800073", "0.56735843", "0.56482357", "0.5637835", "0.5634094", "0.5618928", "0.5604322", "0.5585208", "0.558339", "0.55813813", "0.55777806", "0.55712986", "0.5564519", "0.55532676", "0.554079", "0.55392236", "0.55308634", "0.55247515", "0.55112255", "0.5503854", "0.55007553", "0.54993606", "0.54975784", "0.5497338", "0.5493494", "0.5491867", "0.5479876", "0.547724", "0.54674405", "0.5466723", "0.5457141", "0.545529", "0.5448787", "0.5448335", "0.5443534", "0.54402876", "0.54351664", "0.54347676", "0.54331595", "0.54312587", "0.542261", "0.5422246", "0.54176456", "0.54139286", "0.54085094", "0.5407107", "0.5403324", "0.54008937", "0.5395075", "0.53904337", "0.53861034", "0.53858584", "0.5385675", "0.5385199" ]
0.86833245
0
Queue jobs for OauthTokenRefreshWorker. Accounts whose OAuth tokens will expire in the next 25 minutes will have their tokens refreshed.
def perform Account.tokens_expiring_soon(Time.zone.now).each do |account| OauthTokenRefreshWorker.perform_async(account.id) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def refresh_tokens\n @token = @token.refresh!\n tokens\n end", "def perform\n\n # Get all twitter accounts if any\n accounts = TwitterAccount.exists? ? TwitterAccount.least_checked(LIMIT) : []\n\n accounts.each do |account|\n account_name = account.twitter_name\n\n if Event.exists?(username: account_name)\n recent_tweet_id = Event.maximum('tweet_id')\n options = {\n since_id: recent_tweet_id\n }\n else\n options = {\n count: 20\n }\n end\n\n fetch_job(account_name, options)\n update_account(account.id)\n end\n\n end", "def schedule_recurring_jobs\n EmbargoAutoExpiryJob.perform_later(account)\n LeaseAutoExpiryJob.perform_later(account)\n end", "def refresh!\n now = Time.now\n raise RefreshTokenExpired if refresh_token_expires_at&.<= now\n\n data = refresh_token_request!\n\n @access_token = data[\"access_token\"]\n @access_token_expires_at = (now + data[\"expires_in\"])\n\n on_refresh&.call(@access_token, @access_token_expires_at)\n end", "def refresh_tokens\n\t\tbegin\n\t\t\t\n\t\t\tresp = $c.initiate_auth({\n\t\t\t auth_flow: \"REFRESH_TOKEN\",\n\t\t\t auth_parameters: {\n\t\t\t \"REFRESH_TOKEN\" => self.refresh_token,\n\t\t\t \"SECRET_HASH\" => calculate_cognito_hmac\n\t\t\t },\n\t\t\t client_id: ENV[\"COGNITO_CLIENT_ID\"]\n\t\t\t})\n\t\t\t\n\t\t\tself.access_token = resp[:authentication_result][:access_token]\n\t\t\tself.refresh_token = resp[:authentication_result][:refresh_token]\n\t\t\tself.token_expires_at = Time.now + (resp[:authentication_result][:expires_in]).seconds\n\t\t\tself.save\n\t\t\t#session[:user] = self\n\t\trescue => e\n\t\t\te.to_s\n\t\tend\t\n\tend", "def destroy_all\n @access_token_job = BatchJob::AccessTokenDestroyJob.new(user: current_user)\n\n prepare_job(@access_token_job) do |access_token_job|\n all_access_token_updates = access_token_list.select(:id).map do |access_token|\n access_token.as_json.slice(\"id\")\n end\n access_token_job.data.attach(io: StringIO.new(all_access_token_updates.to_json), content_type: \"application/json\", filename: \"upload.json\")\n end\n\n if @access_token_job.save\n BatchProcessorJob.perform_later(@access_token_job.id, @current_user.id)\n respond_to do |format|\n format.html { redirect_to :access_tokens, notice: 'Batch Job Submitted.' }\n format.json { render :show, status: :ok, location: url_for(controller: \"\", action: \"update_all\") }\n end\n else\n respond_to do |format|\n format.html { render :access_tokens }\n format.json { render json: @access_token_job.errors, status: :unprocessable_entity }\n end\n end\n end", "def refresh_token\n @agent.shutdown\n @agent = Mechanize.new\n\n get_token\n set_headers\n end", "def requeue_timed_out_jobs\n # older than x\n jobs.where{started_working_at <= (Time.now - EQ.config.job_timeout)}\\\n .update(started_working_at: nil)\n end", "def update_token\n\trequire 'date'\n\ttil = Time.at(settings.exp) - Time.now\n\tleft = (til/60).to_i\n\tp left\n\tif left < 5\n\t\tres = RestClient.post( \"https://auth.exacttargetapis.com/v1/requestToken\",\n\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t:clientId => settings.clientId,\n\t\t\t\t\t\t\t\t:clientSecret => settings.clientSecret,\n\t\t\t\t\t\t\t\t:refreshToken => settings.refreshToken,\n\t\t\t\t\t\t\t\t:accessType => \"offline\"\n\t\t\t\t\t\t\t })\n\t\t@res = JSON.parse(res)\n\t\tsettings.oauthToken = @res[\"accessToken\"]\n\t\tsettings.exp = Time.now + @res[\"expiresIn\"]\n\t\tsettings.refreshToken = @res[\"refreshToken\"]\n\tend\t\nend", "def cronofy_request(&block)\n if user.cronofy_access_token_expired?(current_time)\n log.debug { \"#cronofy_request pre-emptively refreshing expired token\" }\n refresh_cronofy_access_token\n end\n\n begin\n block.call\n rescue Cronofy::AuthenticationFailureError\n log.add(debug_log_level) { \"#cronofy_request attempting to refresh token - user=#{user.id}\" }\n refresh_cronofy_access_token\n block.call\n end\n rescue Cronofy::AuthenticationFailureError => e\n log.warn \"#cronofy_request failed - user=#{user.id} - #{e.class} - #{e.message}\"\n raise CronofyCredentialsInvalid.new(user.id)\n rescue => e\n log.error \"#cronofy_request failed - user=#{user.id} - #{e.class} - #{e.message}\"\n raise\n end", "def update_all\n #Build a json file based on criteria and settings...\n @access_token_job = BatchJob::AccessTokenUpsertJob.new(user: current_user)\n\n prepare_job(@access_token_job) do |access_token_job|\n attach_params_as_file_to_upsert_job(access_token_job)\n end\n\n @access_tokens = page(access_token_list)\n\n if @access_token_job.save\n BatchProcessorJob.perform_later(@access_token_job.id, @current_user.id)\n respond_to do |format|\n format.html { redirect_to :access_tokens, notice: 'Batch Job Submitted.' }\n format.json { render :show, status: :ok, location: url_for(controller: \"\", action: \"update_all\") }\n end\n else\n respond_to do |format|\n format.html { render :access_tokens }\n format.json { render json: @access_token_job.errors, status: :unprocessable_entity }\n end\n end\n end", "def perform\n User.where('refresh_started_at < ?', 2.minute.ago.utc).find_each do |user|\n user.update!(\n refresh_started_at: nil,\n refresh_ongoing: false\n )\n end\n end", "def perform\n scan\n Delayed::Job.enqueue self, 0, Time.now.utc + 20.seconds # requeue for next time\n # todo: save the job id somewhere\n end", "def api_request(&block)\n begin\n block.call\n rescue Cronofy::AuthenticationFailureError\n log.info \"#api_request attempting to refresh token\"\n refresh_user_access_token\n block.call\n rescue => e\n log.error \"#api_request failed with #{e.message}\", e\n raise\n end\n end", "def retry_and_clean_tokens(clean_time_limit)\n TokenStore.get_all.each do |token|\n response = create(token.community_id, token.token)\n\n if(!response[:success] && token.created_at < clean_time_limit)\n request_cancel(token.community_id, token.token)\n end\n end\n end", "def queue_job; end", "def update_credentials(auth)\n\t\texp = auth['credentials']['expires_at']\n\t\texp = DateTime.strptime(\"#{exp}\",'%s') if exp\n\t\tself.update_attributes(\n\t\t\taccess_token: auth['credentials']['token'],\n\t\t\taccess_token_secret: auth['credentials']['secret'],\n\t\t\trefresh_token: auth['credentials']['refresh_token'],\n\t\t\ttoken_expires_at: exp\n\t\t)\n\t\t\n\t\t# retry pending submissions\n\t\tretried = []\n\t\tself.backlogs.each do |backlog|\n\t\t\tnext unless backlog.resource\n\t\t\t\n\t\t\t# only resubmit each resource once\n\t\t\tnext if retried.include? backlog.resource\n\t\t\tretried << backlog.resource\n\t\t\t\n\t\t\tshare(backlog.resource) if backlog.resource.is_a? Share\n\t\t\tupdate_listen(backlog.resource) if backlog.resource.is_a? Listen\n\t\t\tupdate_playlist(backlog.resource) if backlog.resource.is_a? Playlist\n\t\t\tdonate(backlog.resource) if backlog.resource.is_a? Donation\n\t\tend\n\t\t\n\t\t# clear pending submissions\n\t\tself.backlogs.destroy_all\n\tend", "def expire_tokens!\n update_tokens(nil)\n end", "def refreshToken\n # is there a token? (and is it's timestamp not older than 24h?)\n if @token.nil? or @tokenTimeStamp < Time.now - 86400\n @token = getToken(@email,@password)\n @tokenTimeStamp = Time.now\n end\n end", "def call\n request_no = @request_queue.length\n Rails.logger.debug(\"Scheduling #{request_no} UN ComTrade requests\")\n\n interval =\n if request_no > MAX_REQUESTS_PER_HOUR\n BATCH_REQUEST_INTERVAL\n else\n REQUEST_INTERVAL\n end\n\n start_time = Time.now\n @request_queue.each.with_index do |uri, idx|\n Rails.logger.debug(\"Scheduling #{uri} ComTrade request\")\n ComTradeRequestWorker.perform_in(interval * idx, uri)\n end\n ComTradeRefreshWorker.perform_in(\n REQUEST_INTERVAL * request_no + 1.hour,\n start_time\n )\n end", "def refresh_token\n end", "def refresh_access_token()\n\n\t\tif(Time.now - @start_time) >=3000\n\t\t\tputs \"Access Token Expired .......Creating a new one\"\n\t\t\t@access_token = @new_token.get_access_token\n\t\t\t@start_time = Time.now\n\t\tend\n\tend", "def expiring_token(token)\n @token = token\n @access_token = token.oauth_access_token\n\n mail(to: @token.user.email, from: Settings.mailer.from)\n end", "def enqueue_get_other_tasks_status_job\n\n BgJob.enqueue(\n ::RegisterBrandedToken::GetOtherTasksStatusJob,\n {\n parent_id: @parent_id\n },\n {\n wait: 30.seconds\n }\n )\n\n end", "def refresh_tokens!\n update(Twitch.new_tokens!(refresh_token))\n rescue RestClient::Unauthorized, RestClient::BadRequest\n # If the refresh got 401 Unauthorized, we were probably de-authorized from using the user's Twitch account. If it\n # got 400 Bad Request, we probably have a nil refresh token, perhaps because the authorization was created before we\n # started saving refresh tokens to the database.\n #\n # Ideally we'd destroy the TwitchUser here, but that may leave the user with no way to sign in. Instead, force a\n # sign out so we can get some fresh tokens. Until that happens we technically have no way to verify this Twitch user\n # and this Splits.io user are the same person, only that they once were in the past.\n #\n # Once we have linkless accounts, change this to destroy the TwitchUser.\n user.sessions.destroy_all\n end", "def refresh!\n with_lock do\n update_counters!\n send_email_if_needed!\n save!\n end\n self # for chaining\n end", "def refresh_token\n get_comm_token if Time.now.to_i - @comm_token_ttl > TOKEN_TTL\n end", "def refresh_token\n get_comm_token if Time.now.to_i - @comm_token_ttl > TOKEN_TTL\n end", "def refresh_access_token\n\t\t\t\trequire \"open-uri\"\n\t\t\t\trequire \"net/http\"\n\t\t\t\trequire \"openssl\"\n\t\t\t\trequire \"base64\"\n\n\t\t\t\turi = URI.parse(\"#{self.add_on.jive_url}/oauth2/token\")\n\t\t\t\thttp = Net::HTTP.new(uri.host, uri.port)\n\t\t\t\thttp.use_ssl = true\n\n\t\t\t\trequest = Net::HTTP::Post.new(uri.request_uri)\n\t\t\t\trequest.basic_auth self.add_on.client_id, self.add_on.client_secret\n\t\t\t\trequest.set_form_data({\n\t\t\t\t\t\"refresh_token\" => \"#{self.refresh_token}\",\n\t\t\t\t\t\"grant_type\" => \"refresh_token\",\n\t\t\t\t})\n\n\t\t\t\tresponse = http.request(request)\n\t\t\t\tjson_body = JSON.parse(response.body)\n\n\t\t\t\tif (response.code.to_i != 200)\n\t\t\t\t\traise RuntimeError, json_body[\"error\"].to_s.upcase\n\t\t\t\tend\n\n\t\t\t\tself.access_token = json_body[\"access_token\"]\n\t\t\t\tself.expires_in = json_body[\"expires_in\"]\n\t\t\t\tself.expires_at = json_body[\"expires_in\"].to_i.seconds.from_now\n\t\t\t\tself.save\n\t\t\tend", "def refresh_access_token\n new_token = FireCloudClient.generate_access_token(self.service_account_credentials)\n new_expiry = Time.zone.now + new_token['expires_in']\n self.access_token = new_token\n self.expires_at = new_expiry\n new_token\n end", "def refresh_access_token!\n self.save! if refresh_access_token\n end", "def refresh!\n update_members\n update_owners\n \n # and also update google.\n self.send_later(:update_google_members)\n self.send_later(:update_google_owners)\n \n end", "def process_files\n Proc.new do\n completed_files = files_queue.select { |k,v| Time.now > v + file_wait_time }\n completed_files.each do |file_path, time|\n CreateOcrRequestJob.perform_later(file_path: file_path)\n files_queue.delete(file_path)\n end\n end\n end", "def refresh!(params={})\n @token = token.refresh!(params)\n end", "def refresh_token\n self.generate_token\n end", "def refresh_access_token\n self.expires_at = Time.now + 3600 \n save\n end", "def refresh\n begin\n oauth_attrs = source.create(params: refresh_token_params)\n oauth_attrs.each do |attr, value|\n send(\"#{attr}=\", value)\n end\n rescue My::Oauth::Unauthorized => e\n errors << 'Error refreshing token'\n end\n self\n end", "def refresh_token\n return if token\n refresh_token!\n end", "def token_refresh!\n self.access_token = access_token.refresh!\n end", "def flush_by_token(token)\n uid = token_uid(token, :refresh, @refresh_claims)\n flush_by_uid(uid)\n end", "def refresh_auth_token\n generate_token(:auth_token)\n save!\n end", "def update_refresh_tokens(mrrt)\n raise ArgumentError, 'Token must contain an MRRT.' unless mrrt.mrrt?\n\n @token_cache.find.each do |entry|\n entry.refresh_token = mrrt.refresh_token if mrrt.can_refresh?(entry)\n end\n end", "def token\n refresh_token! if token_expired?\n super\n end", "def refresh_oauth2_token!\n ensure_oauth2_token(true)\n save!\n end", "def fetch_job(acc, options)\n tweets = $client.user_timeline(acc, options)\n user = $client.user(acc)\n\n # FOR EACH tweet IN tweets DO\n tweets.each do |tweet|\n # Store the tweet in PostgreSQL database\n save_tweet(tweet, user)\n end\n\n # Catch exception\n rescue Twitter::Error::TooManyRequests => error\n sleep error.rate_limit.reset_in + 1\n retry\n end", "def perform(name = nil, count = nil)\n active_organizations = Maestrano::Connector::Rails::Organization.where.not(oauth_provider: nil, encrypted_oauth_token: nil)\n gap_span = (60 / active_organizations.count).to_i\n time = 0\n active_organizations.each do |o|\n next unless [true, 1].include?(o.sync_enabled)\n Maestrano::Connector::Rails::SynchronizationJob.set(wait: time.minutes).perform_later(o.id, {})\n time += gap_span\n end\n end", "def test_feature_refresh_token_for_expired_oauth_token\n # Setup\n opts = {\n 'email' => @user.email,\n 'expires_in' => 3\n }\n\n @user = setup_user(opts)\n\n sleep(opts['expires_in'])\n\n # Step 1\n headers = { 'Authorization' => \"Bearer #{@user.oauth_token}\" }\n\n get '/me', {}, headers\n assert_response(@response, :client_error)\n\n # Step 2\n @user.acquire_refreshed_oauth_token\n\n # Step 3\n headers = { 'Authorization' => \"Bearer #{@user.oauth_token}\" }\n\n get '/me', {}, headers\n assert_response(@response, :success)\n end", "def check_refresh_job\n return unless temporize_client.jobs.empty?\n\n temporize_client.update!\n end", "def perform\n ### Destroy all ads where expiry is less than the current time\n Rails.logger.info(\"AdsExpiryWorker_STARTED\")\n expired_ads = PropertyAd.where(\"expiry_at < ?\", Time.now)\n expired_ads.each {|t| Rails.logger.info(\"AdsExpiryWorker_PROCESSING_#{ad.id}\") }\n expired_ads.destroy_all\n\n ### Send email to ads which are going to expire the next day\n ads_about_to_expire = PropertyAd.where(\"expiry_at < ?\", Time.now - 1.day)\n\n ads_about_to_expire.each do |ad|\n Rails.logger.info(\"AdsExpiryWorker_ABOUT_TO_EXPIRE_PROCESSING_STARTED_#{ad.id}\")\n udprn = ad.udprn\n details = PropertyDetails.details(ad.udprn)[:_source]\n vendor_email = details[:vendor_email]\n vendor_property_address = details[:address]\n if vendor_email\n template_data = { vendor_property_address: vendor_property_address }\n self.class.send_email(vendor_email, 'vendor_quote_lost_notify_agent', self.class.to_s, template_data)\n end\n Rails.logger.info(\"AdsExpiryWorker_ABOUT_TO_EXPIRE_PROCESSING_FINISHED_#{ad.id}\")\n end\n\n Rails.logger.info(\"AdsExpiryWorker_FINISHED\")\n\n end", "def update_token\n client.authorization.update_token!(oauth_data)\n if client.authorization.refresh_token && client.authorization.expired?\n client.authorization.fetch_access_token!\n end\n end", "def refresh_session\n self.with_lock(timeout: 60, retries: 120, retry_sleep: 0.5) do\n if self.token_expires_at <= 10.seconds.from_now\n begin\n session.refresh_tokens\n self.refresh_token = session.refresh_token\n self.access_token = session.access_token\n self.token_expires_at = session.expires_at\n self.save\n rescue ExactOnlineLib::Api::Sdk::AuthError\n @session = nil\n end\n else\n @session = nil\n end\n @client = nil\n end\n end", "def refresh(requested_by)\n # TODO: Create a job and then defer the rest.\n if jobs.incomplete.find_by(job_type: Job::TYPE_REFRESH).nil?\n job = jobs.create!(\n job_type: Job::TYPE_REFRESH,\n requested_by: requested_by,\n authorized_by: requested_by,\n )\n\n job.refresh\n job\n else\n errors.add(:project, 'already has an ongoing refresh job.')\n end\n end", "def refresh_single_use_oauth2_token!\n assign_single_use_oauth2_token\n save!\n end", "def initialize(token)\n @token = token\n if Time.now.to_i > @token.get_info['token_expiry']\n self.refresh\n end\n end", "def perform\n tick(I18n.t('jobs.expire_analysis_tasks.progress_expiring'))\n Datasets::AnalysisTask.destroy_all ['created_at < ?', 2.weeks.ago]\n\n completed\n end", "def expire\n touch :expires_at\n\n user.subscriptions.facebook.each do |subscription|\n subscription.deactivate\n end\n\n UserMailer.access_token_expired_email(user).deliver\n end", "def refresh_token_if_needed\n token_timestamp = decoded_jwt['exp']\n current_timestamp = DateTime.now.to_i\n return unless token_timestamp - current_timestamp <= 0\n\n refresh_token\n end", "def cronofy_request(user, &block)\n if user.cronofy_access_token_expired?(Time.now)\n log.info { \"#cronofy_request pre-emptively refreshing expired token\" }\n refresh_cronofy_access_token(user)\n end\n\n begin\n block.call\n rescue Cronofy::AuthenticationFailureError\n log.info { \"#cronofy_request attempting to refresh token - user=#{user.id}\" }\n refresh_cronofy_access_token(user)\n block.call\n end\nrescue Cronofy::AuthenticationFailureError => e\n log.warn \"#cronofy_request failed - user=#{user.id} - #{e.class} - #{e.message}\", e\n raise CronofyCredentialsInvalid.new(user.id)\nrescue => e\n log.error \"#cronofy_request failed - user=#{user.id} - #{e.class} - #{e.message}\", e\n raise\nend", "def runTokenRenewalPost\n msg = Thread.current.to_s\n renew = Stopwatch.new(msg)\n renew.start\n payload = \"grant_type=#{@grant_type}&scope=#{@scope}&client_id=#{@key}&client_secret=#{@secret}\"\n response = RestClient.post @token_server,\n payload,\n {\n :content_type => \"application/x-www-form-urlencoded\"\n }\n ensure\n # make sure to print the elapsed time for the renewal.\n renew.stop\n logger.info(\"WAPI: renew token post: stopwatch: \"+renew.pretty_summary)\n end", "def refresh_token!\n create_token = Kickit::API::CreateToken.new\n resp = create_token.execute(:username => username,\n :developerKey => Kickit::Config.developerKey)\n @token = resp\n end", "def purge_expired_workers\n @services.purge_expired_workers\n end", "def exchange_oauth_tokens\n end", "def purge_old_tokens\n auth_tokens.desc(:last_used_at).offset(20).destroy_all\n end", "def charge_backers_if_funded\n ChargeBackersJob.set(wait_until: self.expiration_date).perform_later self.id\n end", "def register_worker\n super\n\n puts \"Fifo Startup - Updating worker list\"\n manager.request_refresh\n end", "def update_users\n log_message 'Updating registration dates for new Users'\n UpdateUsersWorker.set(queue: QUEUE).perform_async\n end", "def async_refresh_billing_date\n Resque.enqueue(SubscriptionRefresher, self.id, \"refresh_billing_date\")\n end", "def refresh(*managers)\n @iterator.each do |iter|\n task = iter[0]\n if task.done?\n removal_time = @done_tasks[task]\n if not removal_time\n @done_tasks[task] = Time.now + TASK_REMOVAL_TIMEOUT\n @tasks.delete(task)\n self.set(iter, task, TASK_REMOVAL_TIMEOUT)\n elsif Time.now > removal_time\n iter.remove()\n @done_tasks.delete(task)\n else\n time_left = (removal_time - Time.now + 1).to_i\n self.set(iter, task, time_left)\n end\n else\n self.set(iter, task)\n end\n end\n\n tasks = managers.map(&:tasks).flatten\n tasks_to_add = tasks - @tasks\n self.add(tasks_to_add)\n end", "def run_jobs\n begin\n while self.pending_ops.where(state: :init).count > 0\n op = self.pending_ops.where(state: :init).first\n\n # store the op._id to load it later after a reload\n # this is required to prevent a reload from replacing it with another one based on position\n op_id = op._id\n\n # try to do an update on the pending_op state and continue ONLY if successful\n op_index = self.pending_ops.index(op)\n retval = CloudUser.where({ \"_id\" => self._id, \"pending_ops.#{op_index}._id\" => op._id, \"pending_ops.#{op_index}.state\" => \"init\" }).update({\"$set\" => { \"pending_ops.#{op_index}.state\" => \"queued\" }})\n unless retval[\"updatedExisting\"]\n self.reload\n next\n end\n\n case op.op_type\n when :add_ssh_key\n Application.accessible(self).each{ |app| app.add_ssh_keys(self._id, [UserSshKey.new.to_obj(op.arguments)], nil) }\n when :delete_ssh_key\n Application.accessible(self).each{ |app| app.remove_ssh_keys(self._id, [UserSshKey.new.to_obj(op.arguments)], nil) }\n end\n\n # reloading the op reloads the cloud_user and then incorrectly reloads (potentially)\n # the op based on its position within the pending_ops list\n # hence, reloading the cloud_user, and then fetching the op using the op_id stored earlier\n self.reload\n op = self.pending_ops.find_by(_id: op_id)\n\n op.close_op\n op.delete if op.completed?\n end\n true\n rescue Exception => ex\n Rails.logger.error ex\n Rails.logger.error ex.backtrace\n false\n end\n end", "def re_enqueue\n BulkImportWorker.perform_in(PERFORM_DELAY, @bulk_import.id)\n end", "def start_expiry_period!\n self.update_attribute(:access_token_expires_at, Time.now + Devise.timeout_in)\n end", "def maybe_reauthenticate\n if @keystone_token_expiration < Time.now + 2*@timeout\n @logger.info \"Permanent token will expire soon. Re-authenticating...\"\n authenticate\n end\n end", "def run\n done = []\n\n queues.each_with_object([]) {|(fqdn, queue), workers|\n @thread_limit.times.map.with_index {|i|\n workers << Thread.start {\n Thread.current[:id] = i+1\n done.push *worker_class(fqdn).new(fqdn, queue(fqdn), cache(fqdn), &@block).run(@thread_limit)\n }\n }\n }.each {|t| t.join }\n\n done\n end", "def call\n api_key = ApiKey.find_by(access_token: @expired_token)\n\n if api_key.present?\n api_key.refresh\n api_key.save\n\n {\n token: api_key.access_token\n }\n else\n raise ExceptionService.new('Invalid Token.')\n end\n end", "def refresh_if_near_expiration\n if near_expiration?\n @mutex.synchronize do\n refresh if near_expiration?\n end\n end\n end", "def queue_future_jobs\n tasks.each do |task|\n # Schedule the new run times using the future job wrapper.\n new_run_times = task.future_run_times - task.existing_run_times\n new_run_times.each do |time|\n SimpleScheduler::FutureJob.set(queue: @queue_name, wait_until: time)\n .perform_later(task.params, time.to_i)\n end\n end\n end", "def flush_expired\n if gc_last && gc_time && gc_last+gc_time <= Time.now\n flush_expired!\n end\n end", "def flush_jobs\n queued_jobs&.each(&:call)&.clear\n end", "def refresh! options = {}\n fetch_access_token! options\n end", "def refresh_if_near_expiration\n if near_expiration?\n @mutex.synchronize do\n if near_expiration?\n @before_refresh.call(self) if @before_refresh\n refresh\n end\n end\n end\n end", "def reload\n proxy_owner.queues(true)\n end", "def refreshed!(body)\n @access_token = body[:access_token]\n @expires_at = Time.now + body[:expires_in]\n end", "def perform args={each_minute: RUN_EVERY}\n # call an other job\n CowsayJob.perform_later # topic: 'ru'\n \n self.class.perform_later wait: args[:each_minute].minute # re-queue\n end", "def refresh_token\n raise NotImplementedError\n end", "def after_perform_job_stats_performed(*args)\n Resque.redis.incr(jobs_performed_key)\n end", "def refresh!\n response = request_token_from_google\n data = JSON.parse(response.body)\n if data[\"access_token\"].present?\n update_attributes(access_token: data['access_token'], expires_at: Time.now + (data['expires_in'].to_i).seconds)\n else\n puts data[\"error_description\"]\n end\n end", "def refresh_if_near_expiration; end", "def refresh!(expiry = DEFAULT_EXPIRY)\n # If we are not already updating and the cache is empty\n if !@updating && !ready?\n #puts \"Updating...\"\n @updating = true\n\n # Fetch each API\n BULK_APIS.each do |name, api_url|\n raw_response = request(api_url)\n redis.set(redis_key(name), raw_response) \n redis.expire(redis_key(name), expiry)\n end\n @updating = false \n true\n else\n return raise PoeWatch::Api::Error.new(\"An update is already in progress\") if @updating\n # puts \"Already up to date\"\n end\n end", "def refresh\n new_token = EsdlSuiteService.setup.refresh(to_access_token)\n return delete if new_token.empty?\n\n update(new_token)\n end", "def set_auth_token_expiry\n self.auth_token_expires_at = (Time.zone.now + 30.days)\n end", "def perform(current_time)\n Rails.logger.info \"Running DisableExpiredDownloadUrlsCronJob at #{current_time}\"\n\n urls_to_expire = DownloadUrl.where(enabled: true).where('expires_at <= ?', current_time)\n if urls_to_expire.any?\n Rails.logger.info \"Disabling #{urls_to_expire.size} expired URLs\"\n urls_to_expire.update_all(enabled: false) # rubocop:disable Rails/SkipsModelValidations\n else\n Rails.logger.info('No URLs have expired.')\n end\n end", "def enqueue_self\n\n BgJob.enqueue(\n ::RegisterBrandedToken::GetAirdropDeployStatusJob,\n {\n parent_id: @parent_id\n },\n {\n wait: 10.seconds\n }\n )\n\n end", "def refill_all_queues!\n # Dla POST musi byc jakies 'body' requestu, bo serwery czesto rzucaja wyjatkami (WEBrick w szczegolnosci).\n post '/queues/refill_all', :body => ' '\n true\n end", "def renew_token\n body_params = token_request_body\n body_params << [\"refresh_token\", current_user.refresh_token]\n body_params << [\"grant_type\", \"refresh_token\"]\n\n get_token(body_params)\n redirect_to sage_accounting_data_path\n end", "def refresh \n decoded_refresh_token = JWT.decode(params[:refreshToken], 's3cr3t', true, algorithm: 'HS256')\n # Check if token was decoded\n if decoded_refresh_token\n refresh_token_record = Blacklist.find_by(jwt: params[:refreshToken])\n if refresh_token_record && Time.now < refresh_token_record.expiration \n @user = User.find_by(id: decoded_refresh_token[0]['user_id'])\n if @user # user exists\n Blacklist.find_by(jwt: params[:refreshToken]).delete\n # update the device_key for the user\n new_access_token = create_access_token(@user.id)\n new_refresh_token = create_refresh_token(@user.id)\n render json: {status: \"Refreshed Tokens\", auth: {accessToken: new_access_token.jwt, accessTokenExpiration: new_access_token.expiration, refreshToken: new_refresh_token.jwt, refreshTokenExpiration: new_refresh_token.expiration }}\n else\n render json: {error: \"Invalid User\"}\n end\n else\n render json: {status: \"Token Expired\"}\n end \n else # token is null\n render json: {error: \"Invalid Token\"}\n end\n end", "def call_api_with_auth(**rest_options)\n refresh = false\n loop do\n token = api_token(refresh)\n rest_options[:headers]['Authorization'] = \"Bearer #{token}\"\n response, data = call_api(**rest_options)\n # Stop if we have a valid response or we've already tried to refresh\n # the token.\n return response, data unless auth_failed(response) && !refresh\n # The API token may have expired, try one more time with a new token\n refresh = true\n end\n end", "def refresh_token\n @token = @authenticator.refresh_token\n end", "def renew\n req_body = { grant_type: 'refresh_token', refresh_token: @token.refresh_token }\n\n response = JSON.parse(request_token(req_body).body)\n\n @token.update!(response['access_token'], response['expires_in'], response['refresh_token'])\n\n save\n rescue StandardError => e\n puts \"Unable to refresh token\\n#{e.message}\"\n end", "def perform\n _perform do\n update_token_sale_ended_data\n end\n end", "def do_job\r\n# disable recycle invites\r\n# min = Time.now.min\r\n# #recycle invites 1 min per hour\r\n# if min == 0\r\n# ret = ActiveRecord::Base.connection.execute(\"delete from invites where invitee_id is null and created_at < subdate(now(), interval 3 day)\")\r\n# puts \"recycle invites: #{ret}\"\r\n# end\r\n end" ]
[ "0.60563064", "0.58627564", "0.58311164", "0.5668823", "0.55954665", "0.5591859", "0.5570507", "0.55671525", "0.5549174", "0.55449975", "0.5542361", "0.55396026", "0.55389833", "0.5515025", "0.5481069", "0.54714197", "0.5460772", "0.5455158", "0.54092854", "0.53463215", "0.5342667", "0.5338642", "0.5338323", "0.53335786", "0.53130245", "0.5301753", "0.5292563", "0.5292563", "0.52864236", "0.5272344", "0.5267288", "0.5249615", "0.52447253", "0.5244692", "0.5244447", "0.5239736", "0.52193785", "0.5210368", "0.5206779", "0.5199215", "0.51939815", "0.5177803", "0.5166537", "0.51653916", "0.5158909", "0.51538575", "0.5142497", "0.51403296", "0.5129398", "0.5115832", "0.51132", "0.5110242", "0.5108833", "0.5100498", "0.5099501", "0.50979817", "0.509751", "0.508786", "0.50607747", "0.50597817", "0.5058702", "0.5052647", "0.5048351", "0.5042258", "0.50211966", "0.5009866", "0.5007771", "0.5005057", "0.5002803", "0.50025827", "0.49600777", "0.49521732", "0.49440482", "0.49418402", "0.49401304", "0.49386376", "0.49353993", "0.493079", "0.49140075", "0.4913188", "0.4905481", "0.4900804", "0.48989046", "0.48933268", "0.48906296", "0.4889226", "0.48858848", "0.4872795", "0.48706156", "0.48705176", "0.48701176", "0.4868471", "0.4868128", "0.48657805", "0.48652178", "0.4864167", "0.48578247", "0.4850833", "0.4834505", "0.4831777" ]
0.8199903
0
to do that, we need to provide the condition array.size > 1 to the elsif part of the statement i was unsure why an elsif branch will return nil if not provided with a conditional expression but its interesting to know that ruby will find the next expression and evalute its truthiness a good bug to know about def my_method(array)
def my_method(array) if array.empty? [] elsif array.size > 1 array.map do |value| value * value end else [7 * array.first] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def my_method(array)\n if array.empty?\n []\n elsif array.size > 1 # missing elsif condition in original code on line 4\n array.map do |value|\n value * value\n end\n else\n [7 * array.first]\n end\nend", "def my_method(array)\n if array.empty?\n []\n elsif array.map {|value| value * value } # this produces an array, which evaluates to true, so the empty elsif branch is executed (which returns nil)\n else\n [7 * array.first]\n end\nend", "def all_else_equal(arr)\n\nend", "def my_method(array)\n if array.empty?\n []\n elsif array.size >= 2\n array.map do |value|\n value * value\n end\n else\n [7 * array.first]\n end\nend", "def my_method(array)\n if array.size == 1\n [7 * array.first]\n elsif array.size > 1\n array.map do |value|\n value * value\n end\n else\n []\n end\nend", "def my_one?(array, &prc)\n results = array.select {|ele| prc.call(ele)}\n return 1 == results.length\nend", "def my_method(array)\n if array.empty?\n []\n elsif array.length == 1\n [7 * array.first]\n else\n array.map do |value|\n value * value\n end\n end\nend", "def long_planeteer_calls(array)\n return array.any?{|item| item.length > 4}\n # code an argument here\n # Your code here\nend", "def proctition(arr, &prc)\n true_arr = []\n false_arr = []\n\n arr.each do |ele|\n if prc.call(ele)\n true_arr << ele\n else\n false_arr << ele\n end\n end\n true_arr.concat(false_arr)\nend", "def _reduce_349(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def check_array(nums)\n if(nums.length >= 2)\n\t\treturn (nums[0] + nums[1])\n\tend\n\tif(nums.length == 1)\n\t\treturn nums[0];\n\tend\n\treturn 0;\n\nend", "def proctition(arr, &prc)\n true_arr = []\n false_arr = []\n\n arr.each do |ele|\n if prc.call(ele)\n true_arr << ele\n else\n false_arr << ele\n end\n end\n\n true_arr + false_arr\nend", "def _reduce_337(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def ifte\n\t\t\t_else = pop\n\t\t\t_then = pop\n\t\t\t_if = pop\n\t\t\traise ArgumentError, \"IFTE: first element is not an Array.\" unless _if.is_a? Array\n\t\t\traise ArgumentError, \"IFTE: second element is not an Array.\" unless _then.is_a? Array\n\t\t\traise ArgumentError, \"IFTE: third element is not an Array.\" unless _else.is_a? Array\n\t\t\tsave_stack\n\t\t\t~_if\n\t\t\tcondition = pop\n\t\t\trestore_stack\n\t\t\tif condition then\n\t\t\t\t~_then\n\t\t\telse\n\t\t\t\t~_else\n\t\t\tend\n\t\tend", "def _reduce_331(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_351(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def match_maker(determine, *elements)\n # Create a new array\n return_array = []\n # Loop through each item in the elements array, slicing into two\n elements.each_slice 2 do | first, last |\n # Create a variable that checks if the element is the opposite\n first = !!first\n last = !!last\n result = determine ? first != last : first == last\n # Push the result to the array\n return_array << result\n end\n # Return the array\n return_array\nend", "def _reduce_344(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_357(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_343(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_340(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_340(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_341(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_342(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_342(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_343(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n\n result\nend", "def _reduce_367(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_336(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def array_42(array)\n a = false\n\tarray.each {|i| if i == 42 then a = true end}\n return a \nend", "def _reduce_345(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def test3(array)\n\tputs \"Test3: Should return an array of arrays -> \"\n\tabg_maker(array).any? {|x| x.class != Array} ? false : true\nend", "def _reduce_342(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n\n result\nend", "def long_planeteer_calls(array)\n array.any?{|call| call.length > 4}\n #any?=>returns TRUE if ar least 1 (in this case,4) element is true\nend", "def _reduce_354(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def _reduce_367(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n\n result\nend", "def satisfied\n Array((operands.detect {|op| op.is_a?(Array) && op[0] == :satisfied} || [:satisfied])[1..-1])\n end", "def array_42(a)\n\ta.any?{|x| x == 42}\nend", "def _reduce_354(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n\n result\nend", "def xnor_select(arr, proc_1, proc_2)\n new_arr = []\n arr.each do |ele|\n new_arr << ele if ( proc_1.call(ele) && proc_2.call(ele) ) || ( !proc_1.call(ele) && !proc_2.call(ele) )\n end\n new_arr\nend", "def all_else_equal(arr)\n\n sum = 0\n arr.each do |n|\n sum += n \n end \n \n if arr.include?(sum/2)\n return sum/2\n else \n return nil \n end \n\nend", "def match_maker (condition, *input)\n\tresult = []\n\tif condition == true\n\t\tinput.each_slice(2) { |i, j|\n\t\t\tif i == !!j \n\t\t\t\tresult << false \n\t\t\telse\n\t\t\t\tresult << true \n\t\t\tend\n\t\t}\n\telsif condition == false\n\t\tinput.each_slice(2) { |i, j|\n\t\t\tif i == !j\n\t\t\t\tresult << true \n\t\t\telse\n\t\t\t\tresult << false \n\t\t\tend\n\t\t}\n\tend\n\tresult\nend", "def xnor_select(arr, prc1, prc2)\n new_arr = []\n arr.each do |ele|\n new_arr << ele if prc1.call(ele) && prc2.call(ele) \n new_arr << ele if !prc1.call(ele) && !prc2.call(ele)\n end\n new_arr\nend", "def all_else_equal(arr)\n return half(arr) if arr.include?(half(arr))\nend", "def _reduce_16(val, _values, result)\n result = IfElse.new(val[2], val[4], []) \n result\nend", "def all_else_equal(arr)\n arr_sum = arr.inject { |mem, var| mem + var }\n if arr.index(arr_sum / 2)\n return arr[arr.index(arr_sum / 2)]\n end\n nil\nend", "def all_else_equal(arr)\n\tsum = 0\n \t\n \tarr.each do |num|\n \tsum += num\n end\n \n \thalfSum = sum/2\n \n \tif arr.include?(halfSum)\n \treturn halfSum\n else\n \treturn nil\n end\nend", "def _reduce_328(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n \n result\nend", "def check_array(array, num)\n if array.length > 2\n if num < array[0] or num > array[array.length-1]\n return false\n elsif num == array[0] \\\n or num == array[array.length-1] \\\n or num == array[((array.length-1)/2).floor]\n return true\n elsif num < array[((array.length-1)/2).floor]\n return check_array(array[0..((array.length-1)/2).floor-1], num)\n elsif num >= array[((array.length-1)/2).floor]\n return check_array(array[((array.length-1)/2).floor..array.length-1], num)\n end\n else\n return true if num == array[0] or num == array[1]\n return false\n end\nend", "def _reduce_339(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n\n result\nend", "def A1\n arr=[*1..100]\n arr2 = []\n\tif array.each.even?\n\t\t|x| puts x \n\telsif array.each.odd?\n\t \tarr2.push(|x|)\n\tend\nend", "def all_else_equal(arr)\n sum = arr.reduce { |sum, ele| sum += ele}\n # sum = arr.reduce do |sum, element|\n # sum += element\n # end\n\n half = sum / 2\n\n if arr.include?(half)\n return half\n end\n\n return nil\nend", "def all_else_equal(arr)\n sum = 0\n arr.each { |i| sum += i}\n if arr.index(sum/2) \n return sum / 2\n end\n nil\nend", "def reduce_to_any_true(source_array)\n i = 0 \n while i < source_array.length do\n return true if source_array[i]\n i += 1 \n end\nend", "def conditionally(*) end", "def conditionally(*) end", "def complex_condition?(condition); end", "def all_else_equal(arr)\n result = sum(arr) / 2.0\n if arr.include?(result)\n return result\n end\n \n return nil\nend", "def prizz_proc(arr, prc1, prc2)\n arr.select { |el| [prc1.call(el), prc2.call(el)].one? }\nend", "def _reduce_330(val, _values, result)\n else_t, else_ = val[4]\n result = [ val[0],\n @builder.condition(val[0], val[1], val[2],\n val[3], else_t,\n else_, nil),\n ]\n\n result\nend", "def non_complex_expression?(condition); end", "def block_checker(array, &block)\n [array.to_a, !!block]\nend", "def all_else_equal(arr)\n\n sum = 0\n arr.each do |n|\n sum += n \n end \n \n if arr.include?(sum/2.0) # /2.0, not /2\n return sum/2.0\n # else \n # return nil \n end \n return nil\n\nend", "def any1?(arr, &block)\n return false if arr.empty?\n block.call(arr.first) ? true : any?(arr.drop(1), &block)\nend", "def long_planeteer_calls(arr)\n arr.any? {|call|call.length > 4}\nend", "def else_clause\n expect :if\n self[3]\n end", "def test1(array)\n\tputs \"Test1: Should take an array as argument -> \"\n\tarray.class == Array ? true : false\nend", "def test1(array)\n\tputs \"Test1: Should take an array as argument -> \"\n\tarray.class == Array ? true : false\nend", "def head_or_all(arr)\n f, *r = arr\n return f if r.empty?\n arr\nend", "def test2(array)\n\tputs \"Test2: Should return an array -> \"\n\tabg_maker(array).class == Array ? true : false\nend", "def match_maker(*el)\n\nnewEl = []\nel.each do |x|\n x == true ? x : x == false ? x : x.nil? == true ? x = false : x = true\n newEl << x\nend\n\ndefiningBool = newEl.shift\n\nresult = []\nnewEl.each_slice(2) { |a,b| result << [a,b]}\n\nif definingBool == false\n\nresult.each_with_index do |arr, index|\nresult[index] = (arr[0] == arr[1] )\nend\n\nelse\n result.each_with_index do |arr, index|\n result[index] = !(arr[0] == arr[1])\nend\n\nend\nresult\n\nend", "def can_jump(arr)\n return false if arr.empty?\n jump_helper(arr, index = arr.size - 1, jumps = 0)\nend", "def all_else_equal(arr)\n \ttot = 0\n \tarr.each do |num|\n tot +=num\n end\n \tmid = tot / 2\n \tarr.each do |num|\n if mid == num\n return num\n end\n end\n return nil\n end", "def process_if exp\n exp = exp.dup\n condition = exp[1] = process exp.condition\n\n if true? condition\n exp[2] = process exp.then_clause if exp.then_clause\n exp[3] = nil\n elsif false? condition\n exp[2] = nil\n exp[3] = process exp.else_clause if exp.else_clause\n else\n exp[2] = process exp.then_clause if exp.then_clause\n exp[3] = process exp.else_clause if exp.else_clause\n end\n\n exp\n end", "def all_else_equal(arr)\n sum = sum_array(arr)\n \n arr.each do |ele|\n if ele == sum / 2.0\n\t return ele\n\t end\n\t end\n\t \n\t return nil\nend", "def within?(array,index)\n\t\tarray.size > index && index >= 0\n\tend1\n\t\n\tdef output_image\n\t\t@image.each { |row| puts row.join }\n\tend \n\nend", "def new_array\n\tfull_array.map! {|x| #We call upon the definition from above to create the conditionals for this \n\t\t #function. By defining these arrays (full and new) in separate functions, it \n\t #allows testing to run in increments. \n\t #The block argument (pipes) isolate the element within the array that will be \n\t\t #called upon.\n\t#Using 'map' lays out the array 1-100 (element after element joined together, yet separated by commas).\n\t#Using the exclamation point with map makes sure the array doesn't return back to the \n\t#1-100 array after the changes were made/if there isn't an exclamation point then\n\t#the array would revert back to what it was prior to the changes(conditionals).\n\t\tif x % 3 == 0 && x % 5 == 0 #The double ampersand symbol means 'and' in this case.\n\t\t\t\"mined_minds\" #This is what will replace the current element within the array.\n\t\telsif x % 3 == 0 #The percent sign is a modulo operater in this case--meaning 'if x is divisble \n\t\t\t\"mined\" #by 3 with no remainders' (\"mined\" will replace any element divisible by 3)\n\t\telsif x % 5 == 0 #The percent sign is a modulo operater in this case--meaning 'if x is divisble\n\t\t\t\"minds\" #by 5 with no remainders' (\"minds\" will replace any element divisible by 5)\n\t\telsif x == 11 #The double equals sign means that \"if x 'is the same' as 11\" when the elements \n\t\t\t\"class\" #are cycling through. \n\t\telse\n\t\t\tx #This means that the element within the array must be returned if the element doesn't meet \n\t\t\t #any of the requirements in any of the conditionals listed above.\n\t\tend #Must include 'end' to close out the conditional (lines up with the beginning of 'if' statements)\n\t} #The curly brackets are used when referencing the conditional and replaces the word 'do' in this case.\n\n\t\nend", "def split\n\t\t\tcond = pop\n\t\t\tarray = pop\n\t\t\traise ArgumentError, \"SPLIT: first element is not an Array.\" unless cond.is_a? Array\n\t\t\traise ArgumentError, \"SPLIT: second element is not an Array.\" unless array.is_a? Array\n\t\t\tyes, no = [], []\n\t\t\tarray.each do |e|\n\t\t\t\tsave_stack\n\t\t\t\tpush e\n\t\t\t\t~cond.dup\n\t\t\t\tpop ? yes << e : no << e\n\t\t\t\trestore_stack\n\t\t\tend\n\t\t\tpush yes\n\t\t\tpush no\n\t\tend", "def some?(array, &prc)\n array.each do |ele|\n return true if prc.call(ele)\n end\n false\nend", "def test3(array)\n\tputs \"Test3: Should return an array of arrays -> \"\n\tgroupMaker(array).any? {|x| x.class != Array} ? false : true\nend", "def second_great_low(arr)\r\n\r\nend", "def get_incresults(arr)\n # byebug\n if(arr.length == 0)\n 'no results available yet'\n else \n allIncorrect = arr.select do |ans|\n ans.is_right == false \n end\n end\nend", "def all_else_equal(arr)\n sum = sum_array(arr)\n \n arr.each do |ele|\n if ele == sum / 2.0\n return ele\n end\n end\n \n return nil\nend", "def logical_calc(arr, op)\n op=='AND' ? arr.reduce(:&) : op=='OR' ? arr.reduce(:|) : arr.reduce(:^)\nend", "def is_valid?(array)\n array.none? {|e| e.zero?} && (array[0] + array[1]) > array[2]\nend", "def all_else_equal(arr)\n sum = 0\n arr.each{|num| sum += num}\n if arr.include?(sum/2)\n idx = arr.find_index(sum/2)\n end\n return arr[idx] if idx\nend", "def in_array(array1, array2)\r\n \r\nend", "def _reduce_14(val, _values, result)\n result = If.new(val[2], val[4]) \n result\nend", "def match(array)\n @myarray = array\n compare_length\n compare_arrays\n myarray\n end", "def reduce_to_any_true(source_array)\n i = 0 \n while i < source_array.length do\n if source_array[i] == true \n return true\n end\n i += 1 \n end\n return false\nend", "def cond=(_arg0); end", "def cond=(_arg0); end", "def cond=(_arg0); end", "def fifth_of_array(array)\nend", "def ice_cream_shop(arr,flav)\n return true if arr[-1] == flav\n return false if arr.length == 0\n arr.pop\n ice_cream_shop(arr,flav)\nend", "def search(array, value)\n index = 0\n if array == []\n return false\n else search_helper(array,value,index)\n end\nend", "def b_option(input_array)\n b_element = input_array.last == \"-b\"\nend", "def match_maker(logic, *arrays)\n\t\tnew_arrays =[]\n\t\tarrays.each_slice(2){|a,b| new_arrays << [a,b]}\n\t\tputs new_arrays\n\t\tputs logic\n\tend", "def has5?(a)\n return 5<=a.size\nend" ]
[ "0.7621669", "0.73153275", "0.6465137", "0.6452952", "0.63552946", "0.6211735", "0.6188107", "0.6133049", "0.60231674", "0.5973809", "0.5958802", "0.5956553", "0.59466416", "0.5922913", "0.5900802", "0.58919984", "0.5891773", "0.5880807", "0.58797514", "0.5877618", "0.5848849", "0.5848849", "0.58439064", "0.5834285", "0.5834285", "0.58236873", "0.5817544", "0.5802011", "0.5787911", "0.57864654", "0.5784686", "0.57836103", "0.5781061", "0.5774008", "0.57629716", "0.57436013", "0.57382876", "0.5725755", "0.571564", "0.5708708", "0.5691855", "0.5684676", "0.56813425", "0.5679166", "0.5676157", "0.5675566", "0.5658964", "0.56416935", "0.562298", "0.5616233", "0.559714", "0.5595106", "0.5593084", "0.55873924", "0.55873924", "0.5584474", "0.5571004", "0.55643666", "0.5558233", "0.5550151", "0.55321956", "0.55211955", "0.5511935", "0.54889995", "0.54886365", "0.5488496", "0.5488496", "0.5488097", "0.5479153", "0.5472465", "0.5470673", "0.5465449", "0.54562676", "0.5452823", "0.54426384", "0.5439765", "0.5437136", "0.5434758", "0.5434147", "0.54326034", "0.5426167", "0.54160625", "0.54121566", "0.54107046", "0.5407821", "0.53985584", "0.5395385", "0.53913593", "0.5390806", "0.5388323", "0.5388323", "0.5388323", "0.5383755", "0.53765315", "0.53760237", "0.5366719", "0.5366536", "0.53665215" ]
0.64917105
4
Build profile after creation
def build_profile Profile.create(user: self) # Associations must be defined correctly for this syntax, avoids using ID's directly. end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def prepare_profile\n profile || build_profile\n end", "def build_profile\n Profile.create(user: self)\n end", "def create_profile!\n bundle_id = Sigh.config[:app_identifier]\n name = Sigh.config[:provisioning_name]\n if !name\n name = Sigh.config[:app_identifier].gsub '.' ,''\n end\n\n UI.important \"Creating new provisioning profile for '#{Sigh.config[:app_identifier]}' with name '#{name}'\"\n profile = profile_type.create!(name: name,\n bundle_id: bundle_id)\n profile\n end", "def new_profile\n profile = Profile.new\n profile.user_group = UserGroup.first\n profile.library = Library.real.first\n profile.locale = I18n.default_locale.to_s\n profile.full_name = 'System'\n profile\nend", "def build_the_profile\n\tself.build_profile\n\tself.profile.user_id = self.id\n end", "def new\n build_profile\n end", "def make_empty_profile\n profile = build_profile\n profile.generate_empty_details\n profile.generate_empty_avatar\n end", "def new_profile\n profile = Profile.new\n profile.user_group = UserGroup.first\n profile.library = Library.real.first\n profile.locale = I18n.default_locale.to_s\n profile\nend", "def create_profile\n build_emp_perfil\n end", "def to_profile\n #load!\n profile = Profile.new(root, name)\n to_h.each do |k,v|\n next if PROFILE_OMIT.include?(k.to_s)\n profile.__send__(\"#{k}=\", v)\n end\n profile.resources.homepage = homepage\n profile.resources.repository = repository\n profile\n end", "def generate_profile\n ErbTemplate.render_to_if_changed('apparmor/profile', {\n name: profile_name,\n namespace: namespace,\n ct: ct,\n all_combinations_of: ->(arr) do\n ret = []\n arr.count.times { |i| ret.concat(arr.combination(i+1).to_a) }\n ret\n end,\n }, profile_path)\n end", "def generate\n generate_profile_sdk\n end", "def create_DB_profile\n \n @profile = ProfileId.new\n @profile.user_name = params[:user_name]\n @profile.profile_id = @parsed[\"profileId\"]\n @profile.save\n end", "def create_profile(profile, options = {})\n options = @@create_profile_option_defaults.merge(options)\n @type = Type::CIM_CREATE_PROFILE\n @fields.merge!(profile.to_hash)\n set_fields(:validation_mode => options[:validation_mode])\n make_request\n end", "def generate_profile(user)\n if user.profile.nil?\n profile_params = { user_id: user.id, name: \"Subscribed User\", bio: \"Coinmitted investor\", language: \"en\", currency: \"USD\", deleted: false, membership: 0 }\n Profile.create(profile_params) if user.profile.nil?\n end\n end", "def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end", "def create_profile\n Profile.create!(member_id:self.id) if self.profile.nil?\n end", "def new\n super\n resource.build_profile\n end", "def setup\n generate_profile\n load_profile\n create_namespace\n end", "def setup_profile\n @profile = Profile.new({:bit_id => self.id})\n @profile.save()\n end", "def profile_payload_builder\n mappings = {\n 'email' => './profile/email',\n 'first_name' => './profile/givenName',\n 'last_name' => './profile/familyName',\n 'phone_number' => './profile/phoneNumber',\n 'job_title' => './profile/jobTitle',\n 'street' => './profile/street',\n 'mobile' => './profile/mobile',\n 'city' => './profile/city',\n 'postal_code' => './profile/postalCode',\n 'country' => './profile/country',\n 'state' => './profile/state',\n 'gender' => './profile/gender',\n 'about' => './profile/aboutMe',\n }\n\n profile = profile_diff\n\n # .dup to avoid \"can't add a new key into hash during iteration\"\n profile.dup.each_key do |k|\n profile[mappings[k]] = profile.delete(k) if mappings[k]\n end\n\n profile\n end", "def build_profile_from_omniauth(auth)\n self.provider = auth.provider\n self.uid = auth.uid\n self.name = auth.info.name\n self.email = auth.info.email\n parse_description(auth)\n self\n end", "def create_profile(sbp_profile, opts = {})\n data, status_code, headers = create_profile_with_http_info(sbp_profile, opts)\n return data\n end", "def create_profile\n Profile.create(user_id: self.id)\n end", "def create\n @profile = current_user.profile || Profile.new\n @profile.user_id = current_user.id\n @profile.status = :start\n @profile.save(validate: false)\n session[:profile_id] = @profile.id\n redirect_to vendor_setup_store_index_path\n end", "def new\n @user = User.new\n @user.build_profile\n end", "def generate_profile_sdk\n generate_modules\n generate_module_definition\n generate_client\n end", "def build_profile_hash(co, id=nil)\r\n\tprofile = Hash.new\r\n\tif (id != nil) then profile['id'] = id\r\n\telse profile['status'] = 1 end\r\n\r\n\tprofile['name'] = co['name']\r\n profile['profile_type_id'] = VENDOR_ID\r\n\tprofile['attributes'] = {\r\n\t\t'vendor_name' => co['name'],\r\n 'bitsight_inherited_security_rating' => scale_unit(co['rating'],250,900,10,0,true).round(1).to_s,\r\n 'bitsight_rating' => co['rating'].to_s,\r\n 'bitsight_rating_date' => Date.parse(co['rating_date']).strftime('%m/%d/%Y'),\r\n 'bitsight_guid' => co['guid'],\r\n 'bitsight_full_vendor_risk_assessment_complete' => 'No'\r\n\t\t}\r\n\tprofile\r\nend", "def build_resource(hash=nil)\n super.tap do |resource|\n resource.build_profile unless resource.profile\n resource.profile.build_avatar unless resource.profile.avatar\n end\n end", "def set_profile\n end", "def new\n\t\t@user = current_user\n\t\t@profile = @user.build_profile\n\tend", "def ensure_profile\n\t if self.profile.nil?\n\t\t \tprofile = Profile.new()\n\t\t \tprofile.user_id = self.id\n\t\t \tprofile.save\n\t\t \tself.profile = profile#Profile.new(:user_id => @user.id)\n\t\t \tself.save \n\t end\n\t self.profile\n end", "def create_profile(payment)\n if payment.source.gateway_customer_profile_id.nil?\n profile_hash = create_customer_profile(payment)\n payment.source.update_attributes(:gateway_customer_profile_id => profile_hash[:customer_profile_id], :gateway_payment_profile_id => profile_hash[:customer_payment_profile_id])\n end\n end", "def create\n if args.blank?\n error \"Please supply the name for the profile you'd like to create\"\n end\n\n Strongspace::Command.run_internal(\"auth:check\", nil)\n\n if new_profile = ask_for_new_rsync_profile\n add_profile(new_profile)\n\n if args[3] and args[3] == \"schedule\"\n schedule\n end\n end\n\n return new_profile\n end", "def create_initial_account_and_profile!\n account = accounts.create!(name: I18n.t('.default.account.name'))\n profiles.create!(name: I18n.t('.default.profile.name'), account_id: account.id)\n end", "def initialize(profile)\n @profile = profile\n end", "def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = devise_current_user.setting.build_profile(profile_params) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t\t# If Profile is save then that's take it into the profile show page\n\t\t\tredirect_to profile_path(surgeon_profile)\n\t\telse\n\t\t\t# If Profile is not save then that's take in into the same page \n\t\t\tredirect_to :back\n\t\tend #Condition End\n\tend", "def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.build_profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => 'Profile was successfully created.' }\n format.json { render :json => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_new_profile(project_root, profile_name, profile_base_path)\n # Clean the profile_path to make it a valid path\n profile_base_path = Bebox::Profile.cleanpath(profile_base_path)\n # Check if the profile name is valid\n return unless name_valid?(profile_name, profile_base_path)\n # Check if the profile exist\n profile_path = profile_base_path.empty? ? profile_name : profile_complete_path(profile_base_path, profile_name)\n return error(_('wizard.profile.name_exist')%{profile: profile_path}) if profile_exists?(project_root, profile_path)\n # Profile creation\n profile = Bebox::Profile.new(profile_name, project_root, profile_base_path)\n output = profile.create\n ok _('wizard.profile.creation_success')%{profile: profile_path}\n return output\n end", "def set_profile\n @profile = (current_user.profile ||= Profile.create)\n end", "def create\n build_identity\n save_identity || render(template: 'profiles/show')\n end", "def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def profile(_name, _options={}, &_block)\n _name = _name.to_sym\n raise Canned::SetupError.new \"Duplicated profile identifier '#{_name}'\" if profiles.has_key? _name\n\n profile = Canned::Profile.new\n ProfileDsl.new(profile, profiles).instance_eval &_block\n profiles[_name] = profile\n end", "def setProfile\n p = Profile.new\n p.slug = self.firstname + self.lastname\n self.profile = p \n self.save\n end", "def create\n @profile = current_user.build_profile(pro_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { redirect_to new_profile_path, alert: 'Please fill all fields' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n\t\t@profile = Profile.new\n\tend", "def new\n\t\t@profile = Profile.new\n\tend", "def new\n @profile = Profile.new\n end", "def profile\n super\n end", "def profile\n super\n end", "def initialize(params={})\n profile_set = params.has_key?(:profile) || params.has_key?(\"profile\")\n params[:profile_attributes] = params.delete(:profile) if params.has_key?(:profile) && params[:profile].is_a?(Hash)\n super\n self.profile ||= Profile.new unless profile_set\n end", "def create\n @params = profile_params\n if @params[\"country\"]\n @params[\"country\"] = CS.get[profile_params[:country].to_sym]\n end\n if @params[\"state\"].size==2\n @states = CS.get profile_params[:country].to_sym\n @params[\"state\"] = @states[profile_params[:state].to_sym]\n end\n\n if current_user.profile #if Profile already exists\n @profile = current_user.profile\n @projects = @profile.projects\n if !params[\"edit-profile-languages\"].empty?\n @lan_array = JSON.parse(params[\"edit-profile-languages\"])\n @params[\"languages\"] = @lan_array\n end\n if !@profile.profile_photo.nil? & params[\"profile_photo\"].empty?\n @params[\"profile_photo\"] = @profile.profile_photo\n else\n @params[\"profile_photo\"] = params[\"profile_photo\"].empty? ? nil : params[\"profile_photo\"]\n end\n if !@profile.banner_photo.nil? & params[\"banner_photo\"].empty?\n @params[\"banner_photo\"] = @profile.banner_photo\n else\n @params[\"banner_photo\"] = params[\"banner_photo\"].empty? ? nil : params[\"banner_photo\"]\n end\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n else\n if(params[:first_signup] == \"true\")\n @user = current_user\n @profile = Profile.new() #create new Profile\n @user.profile = @profile\n @lan_array = JSON.parse(params[\"languages\"])\n @params[\"languages\"] = @lan_array\n coordinates = Geocoder.search(profile_params[:city]).first.coordinates\n latitude = coordinates[0]\n longitude = coordinates[1]\n @params[\"time_zone\"] = Timezone.lookup(latitude,longitude).name\n\n respond_to do |format|\n if @profile.update(@params)\n format.html { redirect_to '/profile/explores', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end\n end\nend", "def bootstrap!\n self.roles << Role.create(:title => 'user') unless self.roles.include?(:user)\n self.profile ||= Profile.create\n end", "def build_resource(hash=nil)\n self.resource = resource_class.new_with_session(hash || {}, session)\n self.resource.role = params[:r] if hash.blank?\n self.resource.build_profile if self.resource.profile.blank?\n end", "def new\n @profile = Profile.new\n if li_auth = current_user.linkedin_auth\n @avatar_url = li_auth.avatar_url\n # fetch fields from the user's linkedin profile\n li_client = li_auth.linkedin_client\n li_profile = li_client.profile(:fields => %w(three_current_positions formatted_name summary location phone_numbers main_address))\n\n if li_profile.present?\n # use current position's company, or the user's name if company unavailable\n if li_profile['three_current_positions'].total > 0\n @profile.name = li_profile['three_current_positions'].all.first.company.name\n else\n @profile.name = li_profile['formatted_name']\n end\n\n # description/summary\n @profile.description = li_profile['summary']\n\n # phone numbers\n if li_profile['phone_numbers'].total > 0\n li_profile['phone_numbers'].all.each do |p|\n phone = @profile.phones.build(\n :number => p['phone_number'], \n :phone_type => PhoneType.find_by_name_or_default(p['phone_type']))\n end\n end\n\n # TODO address. li_profile['main_address'] is a multi-line address string. needs parsed.\n end\n end\n @profile.build_location\n @phone = @profile.phones.build\n @phone.phone_type = PhoneType.find 1\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @profile }\n end\n end", "def profile; end", "def profile; end", "def create\n\t\t# Creating the profile for particular surgeon\n\t\tsurgeon_profile = current_user.setting.build_profile(speciality_name: params[:speciality_name],sub_speciality_name:params[:sub_speciality_name],:medical_school=>params[:medical_school],:residency=>params[:residency],:spe_training=>params[:spe_training],:my_favourite=>params[:my_favourite],:my_hobby=>params[:my_hobby],:more_about=>params[:more_about],:cover_image=>params[:cover_image],:profile_image=>params[:profile_image]) \n\t\t# Condition checking the profile is saved or not\n\t\tif surgeon_profile.save\n\t\t# response to the JSON\n\t\t render json: { success: true,message: \"Profile Successfully Created.\", response: surgeon_profile.as_json },:status=>200\n\t else\n\t render :json=> { success: false, message: surgeon_profile.errors },:status=> 203\n\t end\n\tend", "def add_profile(opts)\n opts = check_params(opts,[:profiles])\n super(opts)\n end", "def create\n\t\t@user = current_user\n\t\t@profile = @user.build_profile(profile_params) \n\t\tif @profile.save\n\t\t\tflash[:success] = \"Profile successfully created!\"\n\t\t\tredirect_to user_profile_path(@user)\n\t\telse\n\t\t\tflash[:notice] = 'Error: something went wrong.'\n\t\t\trender :action => \"new\" \n\t\tend\n\tend", "def create\n if ! params[:profile].blank? && DeveloperProfile.to_s == params[:profile][:type]\n @profile = DeveloperProfile.new(params[:profile])\n elsif ! params[:profile].blank? && ContractorProfile.to_s == params[:profile][:type]\n @profile = ContractorProfile.new(params[:profile])\n elsif ! params[:developer_profile].blank?\n @profile = DeveloperProfile.new(params[:developer_profile])\n elsif ! params[:contractor_profile].blank?\n @profile = ContractorProfile.new(params[:contractor_profile])\n end\n @profile.user_id = current_user.id\n @profile.website = nil\n\n respond_to do |format|\n if @profile.save\n @profile.user.send_welcome_notification\n format.html { \n if(current_user.sign_in_count == 1 && current_user.project_privileges.present?)\n redirect_to(project_path(current_user.project_privileges.first.project), :notice => 'Your profile was successfully created. Here is the project you were invited to bid on.') \n elsif(current_user.sign_in_count == 1 && current_user.invited_by.present?) \n redirect_to(projects_profile_path(current_user.invited_by.profile), :notice => 'Your profile was successfully created. Here are some projects from the user that invited you.') \n else\n redirect_to(profile_path(@profile), :notice => 'Profile was successfully created.') \n end\n }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_profile_with_http_info(sbp_profile, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: VApi#create_profile ...\"\n end\n \n # verify the required parameter 'sbp_profile' is set\n fail \"Missing the required parameter 'sbp_profile' when calling create_profile\" if sbp_profile.nil?\n \n # resource path\n path = \"/v1/profile/create\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/xml']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sbp_profile)\n \n\n auth_names = []\n data, status_code, headers = @api_client.call_api(:POST, 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 => 'SbpProfile')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VApi#create_profile\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def profile_builder\n @profile_builder ||=\n begin\n curtailment = @config.production_curtailment || 0.0\n\n if curtailment.positive? && @config.group.to_s.starts_with?('self:')\n raise 'Cannot use non-zero production_curtailment with a ' \\\n \"\\\"self:...\\\" curve in #{@node.key}\"\n end\n\n CurtailedProfile.new(\n @context.curves.curve(@config.group, @node),\n curtailment\n )\n end\n end", "def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end", "def profiles; end", "def profile( key, profile )\n profile = profile.dup\n base = profile.delete( :base_profile ) || :default\n base_profile = @profiles[ base ]\n if base_profile\n profile = base_profile.merge( profile )\n if base_profile[ :roles ] && profile[ :roles ]\n profile[ :roles ] = ( base_profile[ :roles ] | profile[ :roles ] )\n end\n end\n\n @profiles[ key ] = profile\n end", "def create\n @profile = Profile.create({\n name: params['profile']['name'],\n speciality: params['profile']['speciality'],\n city: params['profile']['city'],\n user_id: current_user['id']\n })\n @profile.save\n respond_with(@profile)\n end", "def new\n @profile = Profile.new\n end", "def new\n @profile = Profile.new\n end", "def new\n @profile = Profile.new\n end", "def createInstanceProfile\n if @config['bare_policies']\n raise MuError, \"#{self} has 'bare_policies' set, cannot create an instance profile without a role to bind\"\n end\n\n resp = begin\n MU.log \"Creating instance profile #{@mu_name} #{@config['credentials']}\"\n MU::Cloud::AWS.iam(credentials: @config['credentials']).create_instance_profile(\n instance_profile_name: @mu_name\n )\n rescue Aws::IAM::Errors::EntityAlreadyExists => e\n MU::Cloud::AWS.iam(credentials: @config['credentials']).get_instance_profile(\n instance_profile_name: @mu_name\n )\n end\n\n # make sure it's really there before moving on\n begin\n MU::Cloud::AWS.iam(credentials: @config['credentials']).get_instance_profile(instance_profile_name: @mu_name)\n rescue Aws::IAM::Errors::NoSuchEntity => e\n MU.log e.inspect, MU::WARN\n sleep 10\n retry\n end\n\n bindTo(\"instance_profile\", @mu_name)\n\n resp.instance_profile.arn\n end", "def create\n params[:profile][:tag_list] = params[:profile][:tag_list]\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n # Store friendly profile URI\n current_user.profile_uri = getUniqueURI(current_user) \n current_user.save\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @user.build_characteristics\n @user.build_profile\n end", "def create\n @current_object = Profile.new(params[:profile])\n respond_to do |format|\n if @current_object.save\n \n @current_object.create_profile_workspace\n flash[:notice] = 'Profile was successfully created.'\n format.html { redirect_to admin_profile_path(@current_object.id) }\n format.xml { render :xml => @current_object, :status => :created, :location => @current_object }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @current_object.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\r\n parameters = profile_params\r\n parameters[\"user\"] = current_user\r\n current_user.is_active = true\r\n UserRole.create(role_id:1, user_id:current_user.id)\r\n current_user.update(is_active:true)\r\n @profile = Profile.create(parameters)\r\n redirect_to root_path\r\n end", "def create_app_profile instance_id, app_profile_id, app_profile, ignore_warnings: nil\n instances.create_app_profile parent: instance_path(instance_id),\n app_profile_id: app_profile_id,\n app_profile: app_profile,\n ignore_warnings: ignore_warnings\n end", "def create\n @profile = current_user.build_profile(profile_params)\n if @profile.save\n # Show successful flash message and redirect to courses list\n flash[:notice] = \"You have created a new profile\"\n redirect_to profile_path(@profile)\n else\n # Render the new template\n render :new\n end\n end", "def createInstanceProfile\n if @config['bare_policies']\n raise MuError, \"#{self} has 'bare_policies' set, cannot create an instance profile without a role to bind\"\n end\n\n resp = begin\n MU.log \"Creating instance profile #{@mu_name} #{@credentials}\"\n MU::Cloud::AWS.iam(credentials: @credentials).create_instance_profile(\n instance_profile_name: @mu_name\n )\n rescue Aws::IAM::Errors::EntityAlreadyExists\n MU::Cloud::AWS.iam(credentials: @credentials).get_instance_profile(\n instance_profile_name: @mu_name\n )\n end\n\n # make sure it's really there before moving on\n begin\n MU::Cloud::AWS.iam(credentials: @credentials).get_instance_profile(instance_profile_name: @mu_name)\n rescue Aws::IAM::Errors::NoSuchEntity => e\n MU.log e.inspect, MU::WARN\n sleep 10\n retry\n end\n\n bindTo(\"instance_profile\", @mu_name)\n\n resp.instance_profile.arn\n end", "def set_profile(profile_contents)\n path = self.api_root + '/register/profile'\n process_firecloud_request(:post, path, profile_contents.to_json)\n end", "def install_profile( pp)\n log( \"Installing Provisioning Profile: #{File.basename(pp)} ...\")\n uuid = get_profile_id( pp )\n dest = File.expand_path(\"#{HOME}/Library/MobileDevice/Provisioning Profiles/#{uuid}.mobileprovision\")\n do_cmd(\"cp \\\"#{pp}\\\" \\\"#{dest}\\\"\")\n uuid\nend", "def create\n assign_params_to_attributes\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n if @profile.save\n flash[:notice] = I18n.t('profile.create.notice')\n redirect_to user_path(current_user)\n else\n @user = current_user\n assing_attributes_to_params\n flash.now[:error] = I18n.t('profile.create.error')\n render :action => \"new\"\n end\n end", "def create_profile(ipython_path, owner, _name, _ipython_settings_dir)\n bash 'create_profile' do\n user owner\n group owner\n code <<-EOH\n # #{ipython_path} notebook --generate-config\n EOH\n environment\n end\nend", "def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end", "def create_from_rpx(profile_data)\n user = new_from_rpx(profile_data)\n user.save\n user\n end", "def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end", "def setup\r\n @model = Profile\r\n @record_one = Profile.find(1)\r\n @new_obj = {\r\n :bio => 'I am awesome',\r\n :user_id => 1,\r\n :address_line1 => ' 1600 Pennsylvania Avenue NW',\r\n :address_line2 => 'bunker #4',\r\n :city => 'Washington',\r\n :job_title=>'Manager',\r\n :company=>\"Uncle Sam's Military Surplus\",\r\n :state=> 'DC',\r\n :postal_code =>'20500',\r\n :telephone=>'202-456-1111',\r\n :fax=>'202-456-2461'\r\n }\r\n end", "def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def initialise_profile(page)\r\n @profile[:name] = Helper.get_name(page)\r\n @profile[:server] = Helper.get_server(page)\r\n @profile[:introduction] = Helper.get_introduction(page)\r\n @profile[:title] = Helper.get_title(page)\r\n @profile[:portrait] = Helper.get_portrait(page)\r\n @profile[:hp] = Helper.get_hp(page)\r\n @profile[:mp] = Helper.get_mp(page)\r\n @profile[:tp] = Helper.get_tp(page)\r\n @profile[:sex] = Helper.get_sex(page)\r\n @profile[:race] = Helper.get_race(page)\r\n @profile[:clan] = Helper.get_clan(page)\r\n @profile[:nameday] = Helper.get_nameday(page)\r\n @profile[:guardian] = Helper.get_guardian(page)\r\n @profile[:city] = Helper.get_city(page)\r\n @profile[:grand_company] = Helper.get_grand_company(page)\r\n @profile[:free_company] = Helper.get_free_company(page)\r\n @profile[:disciple] = DiscipleList.new(page.xpath(\"//table[@class='class_list']/tr/td\"))\r\n @profile[:gear] = GearList.new(page.xpath(\"(//div[@class='item_detail_box'])[position() < 14]\"))\r\n @profile[:attribute] = AttributeList.new(page.xpath('//div[starts-with(@class, \"param_left_area_inner\")]/ul/li'))\r\n @mounts = CollectableList.new(page.xpath('(//div[@class=\"minion_box clearfix\"])[1]/a'))\r\n @minions = CollectableList.new(page.xpath('(//div[@class=\"minion_box clearfix\"])[2]/a'))\r\n end", "def doctor_project(project,target, identity, profileUuid)\n log( \"Modifiying Project FIle to sign with #{identity} identity ...\")\n\n project = ZergXcode.load(project)\n configuration = 'Release'\n build_configurations = project[\"buildConfigurationList\"][\"buildConfigurations\"]\n configuration_object = build_configurations.select { |item| item['name'] == configuration }[0]\n configuration_object[\"buildSettings\"][\"PROVISIONING_PROFILE\"] = profileUuid\n configuration_object[\"buildSettings\"][\"PROVISIONING_PROFILE[sdk=iphoneos*]\"] = profileUuid\n configuration_object[\"buildSettings\"][\"CODE_SIGN_IDENTITY\"] = identity\n configuration_object[\"buildSettings\"][\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"] = identity\n\n target = project[\"targets\"].select {|item| item['name'] == target }[0]\n build_configurations = target[\"buildConfigurationList\"][\"buildConfigurations\"]\n configuration_object = build_configurations.select {|item|item['name'] == configuration }[0]\n configuration_object[\"buildSettings\"][\"PROVISIONING_PROFILE[sdk=iphoneos*]\"] = profileUuid\n configuration_object[\"buildSettings\"][\"CODE_SIGN_IDENTITY[sdk=iphoneos*]\"] = identity\n\n project.save!\nend", "def create\n @admin_profile = Admin::Profile.new(admin_profile_params)\n\n respond_to do |format|\n if @admin_profile.save\n unless params[:admin_profile][:avatar].blank?\n preloaded = Cloudinary::Uploader.upload(params[:admin_profile][:avatar], :use_filename => true, :public_id => \"profiles/#{@admin_profile.id}\")\n end\n\n unless params[:admin_profile][:profile_skills_attributes].blank?\n params[:admin_profile][:profile_skills_attributes].each do |skill|\n admin_skill = Admin::ProfileSkill.create({profile_id: @admin_profile.id, name: skill[1][:name], skill: skill[1][:skill]})\n admin_skill.save\n end\n end\n\n unless params[:admin_profile][:profile_hobbies_attributes].blank?\n params[:admin_profile][:profile_hobbies_attributes].each do |hobby|\n admin_hobby = Admin::ProfileHobby.create({profile_id: @admin_profile.id, name: hobby[1][:name]})\n admin_hobby.save\n end\n end\n\n format.html { redirect_to admin_root_path, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_profile }\n else\n format.html { render action: 'new'}\n format.json { render json: @admin_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n \n @profile.user_id = current_user.id\n @profile.full_name = @profile.first_name + @profile.last_name\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => t('alerts.profiles.create') }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_app_profile \\\n instance_id,\n app_profile_id,\n app_profile,\n ignore_warnings: nil\n execute do\n instances.create_app_profile(\n instance_path(instance_id),\n app_profile_id,\n app_profile,\n ignore_warnings: ignore_warnings\n )\n end\n end", "def create\n @cleaners_profile = Cleaners::Profile.new(cleaners_profile_params)\n\n respond_to do |format|\n if @cleaners_profile.save\n format.html { redirect_to after_signup_path(:preference) }\n format.json { render action: 'show', status: :created, location: @cleaners_profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @cleaners_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profile = current_user.build_profile(params[:profile])\n @logotype = @profile.build_logotype(params[:logotype]) \n\n respond_to do |format|\n if @profile.save\n flash[:notice] = 'Profile was successfully created.'\n format.html { redirect_to :action => 'show' }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n format.atom { \n headers[\"Location\"] = formatted_user_profile_url(@user, :atom )\n render :action => 'show',\n :status => :created\n }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n format.atom { render :xml => @profile.errors.to_xml, :status => :bad_request }\n end\n end\n end" ]
[ "0.7719582", "0.7672295", "0.7652865", "0.73636985", "0.72576296", "0.7215689", "0.7161155", "0.7064951", "0.7061944", "0.69696933", "0.678461", "0.6732514", "0.6692094", "0.663513", "0.66213346", "0.66147035", "0.6565796", "0.6563821", "0.6544508", "0.6513363", "0.6456759", "0.64213985", "0.6403112", "0.6402952", "0.6359499", "0.6333708", "0.6314784", "0.6279583", "0.6259264", "0.6190307", "0.61890507", "0.61861914", "0.6182909", "0.61709887", "0.6160523", "0.6142352", "0.6140389", "0.61265665", "0.61231995", "0.6114818", "0.6070773", "0.6069085", "0.60223854", "0.60071516", "0.5999062", "0.59902716", "0.59875524", "0.5969403", "0.59656966", "0.59656966", "0.5960105", "0.5953925", "0.5953925", "0.5949912", "0.5948043", "0.5946076", "0.59393984", "0.5932214", "0.5922483", "0.5922483", "0.59149", "0.59066707", "0.5871998", "0.5866278", "0.58562636", "0.5854442", "0.58427197", "0.582346", "0.5814787", "0.581378", "0.57949984", "0.57949984", "0.57949984", "0.5791079", "0.57836974", "0.5772539", "0.5752108", "0.5745147", "0.57431716", "0.5727769", "0.57248694", "0.5716014", "0.57072914", "0.56783056", "0.5666987", "0.5657942", "0.56575125", "0.5655244", "0.56535405", "0.56392133", "0.56390697", "0.56306744", "0.5629558", "0.56270224", "0.56262636", "0.562156", "0.5616457", "0.5593854", "0.5583898", "0.5576354" ]
0.7596895
3
Returns combination of email address and Profile name
def identity "#{email} #{profile.name} " end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_display_name\n return self.has_profile? ?\n self.profile.first_name + \" \" + self.profile.last_name :\n self.email\n end", "def name_and_email\r\n if email\r\n return \"#{self.entire_full_name} <#{self.email}>\"\r\n else\r\n return nil\r\n end\r\n end", "def to_s\n if profile and profile.to_s.present?\n profile.to_s\n else\n email\n end\n end", "def name\n if first_name && last_name\n return \"#{first_name} #{last_name}\"\n else\n return email\n end\n end", "def name\n \"#{@profile[:first_name]} #{@profile[:last_name]}\"\n end", "def full_name\n return '' unless profile\n profile.full_name\n end", "def display_name\n return \"#{first_name} #{last_name}\".strip if first_name\n return email\n end", "def name_and_email\n email_address = Notifier.unprettify(self.email)\n self.name.blank? ? email_address : \"\\\"#{self.name}\\\" <#{email_address}>\"\n end", "def full_name\n if self.profile.present?\n \"#{self.profile.first_name.capitalize} #{self.profile.last_name.capitalize}\"\n else\n \"#{username.capitalize}\"\n end\n end", "def welcome_name\n if profile.nil? or (profile.user_first_name.nil? and profile.user_last_name.nil?)\n email \n else\n self.full_name\n end\n end", "def full_name\n \"#{user_profile.first_name} #{user_profile.last_name}\" unless user_profile.blank?\n end", "def name\n if self[:name].blank?\n (self[:email] || \"\").split('@')[0].split('.').map(&:capitalize).join(' ')\n else\n self[:name]\n end\n end", "def email_with_name\n if email\n %Q{\"#{first} #{last}\" <#{email}>}\n end\n end", "def email; default_profile.try :email; end", "def display_name\n #self.email.split('@')[0]\n self.username\n end", "def profile_name\n name.present? ? name : identifier\n end", "def name\n [first_name, last_name].compact.join(\" \").presence || email\n end", "def display_name\n display = [first_name, last_name].join(' ').strip\n display.blank? ? email : display\n end", "def full_name\n if first_name? && last_name?\n name_words = first_name.split(\" \") + last_name.split(\" \")\n return name_words.map{ |w| w.capitalize }.join(\" \")\n else\n return email\n end\n end", "def name_display\n if first_name || last_name\n \"#{first_name} #{last_name}\".strip\n else\n email\n end\n end", "def email\n @json['profile']['email'] rescue nil\n end", "def get_user_name\n if first_name.blank?\n return email.split('@').first.capitalize unless email.blank? \n else\n return first_name.capitalize + \" \" + last_name.capitalize\n end \n return ''\n end", "def my_full_name\n \"#{self.profile.first_name} #{self.profile.last_name}\"\n end", "def profile_name\n return self.profile.name\n end", "def email(full = false)\n full ? \"#{self.profile.name} <#{self.login}>\" : self.login\n end", "def show_name\n return_string = \"\"\n if first_name.present? || last_name.present?\n return_string = \"#{first_name} #{last_name}\".strip\n end\n if login.present?\n return_string = return_string.blank? ? login : \"#{return_string} (#{login})\".strip\n end\n if return_string.blank?\n return_string = email\n end\n return_string\n end", "def name\n \temail.split('@')[0]\n end", "def display_name\n email\n end", "def find_name_or_email\n if self.first_name.present? && self.last_name.present?\n self.first_name + \" \" + self.last_name\n else\n self.name || self.email\n end\n end", "def profileName \n \"profileName\" \n end", "def name\n name_str = \"#{first_name} #{last_name}\".strip\n if name_str.length < 1\n name_str = email\n end\n if name_str.length < 1\n name_str = \"Person utan namn (id #{id})\"\n end\n name_str\n end", "def email_address_with_name\n \"\\\"#{name}\\\" <#{info.email}>\"\n end", "def email_with_name\n \"#{full_name} <#{email.to_s}>\"\n end", "def full_name\n \n if (not self.first_name.nil? and not self.first_name.eql? \"\") or (not self.last_name.nil? and not self.last_name.eql? \"\")\n \"#{self.title} #{self.first_name} #{self.last_name}\".strip\n elsif self.username\n self.username \n else\n # wrapped email only prefix\n\n parsed_email = self.email.split('@')\n parsed_email[0]\n end\n end", "def name_or_contact_info\n if name.blank?\n [email, phone].join(', ')\n else\n name\n end\n end", "def display_name\n \"#{username} <#{email}>\"\n end", "def first_name\r\n @profile[:name].split(/ /).first\r\n end", "def name(use_email = true)\n if (firstname.blank? && surname.blank?) || use_email then\n return email\n else\n name = \"#{firstname} #{surname}\"\n return name.strip\n end\n end", "def last_name\r\n @profile[:name].split(/ /).last\r\n end", "def full_name\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"full_name\"]\n end", "def name\n result = []\n result << self.first_name\n result << self.last_name\n if result.compact.empty?\n self.user.login if self.user\n else\n result.compact.map {|m| m.to_s.strip}.reject {|i| i.blank?}.join(' ')\n end\n end", "def name\n if first_name.present? || last_name.present?\n [first_name, last_name].join(\" \").strip\n else\n username\n end\n end", "def load_profile(token)\n profile = GoogleService.user_info(token)\n email_field = profile[\"emails\"].select do |email| \n email[\"type\"] == \"account\"\n end\n\n email = email_field[0][\"value\"] if email_field && email_field.size > 0\n\n {:displayName => profile[\"displayName\"],\n :image => profile[\"image\"][\"url\"],\n :url => profile[\"url\"],\n :email => email} \n end", "def name\n profile.user.name\n end", "def name_or_email\n if name.present?\n name\n else\n email\n end\n end", "def email_name\n @email_name || if self[:email]\n split_host = URI.parse(\"#{self[:email]}\").path.split('@')\n \"#{split_host.first}\" if 2 == split_host.size\n end\n rescue URI::InvalidURIError\n nil\n end", "def fallback_name\n users_data['email'].split('@').first.parameterize.titleize\n end", "def username \n #The code below will return the users email however, the split will seperate the email based on the parameters entered into the brackets. The code below will split the email at the @ symbol, resulting in the email changing from example@example.com to example @ example.com. The [0] after the brackets is used to determine the index value of the email that should be displayed. When the email is split each section is provided with an index value, starting at 0. The first part of the email (example) will be given the index of 0. This will result in the code displaying example. The capitalize at the end of the statement is used to caplitalise the first letter of the email address.\n return self.email.split('@')[0].capitalize\n end", "def display_name\n email.gsub(/@.*/, \"\")\n end", "def account_name\n return company.company_name unless company.nil? || company.company_name.nil?\n\n [forename, surname].join(' ')\n end", "def email_with_name\n \"#{name} <#{email}>\"\n end", "def email_with_name\n \"#{name} <#{email}>\"\n end", "def email_with_name\n \"#{name} <#{email}>\"\n end", "def email_from_infos\n user_infos.map(&:email).try(:first)\n end", "def display_name\n if !self.first_name.blank?\n self.first_name\n elsif !self.name.blank?\n self.name\n elsif !self.provider_username.blank?\n self.provider_username\n else\n self.email\n end\n end", "def to_s\n \tif first_name.blank? && last_name.blank?\n \t\temail\n \telsif first_name.blank?\n \t\tlast_name\n \telsif last_name.blank?\n \t\tfirst_name\n \telse\n \t\tfirst_name + \" \" + last_name\n \tend\n end", "def display_name\n last_name.blank? ?\n (first_name.blank? ? email : first_name) :\n (first_name.blank? ? last_name : (first_name + ' ' + last_name))\n end", "def get_email_address\n response = get_current_user_meta('email')\n email = response['query']['userinfo']['email']\n return if email == ''\n\n email\n end", "def show_name\n \tif first_name\n \t\t\"#{first_name}\".strip.squeeze(\" \")\n \telse\n \t\temail\n \tend\n end", "def display_name\n self.display_name = self.profile.nickname? ? self.profile.nickname : self.username\n end", "def identifier\n unless full_name.blank?\n full_name\n else\n email.split('@').join(' from ')\n end\n end", "def full_name\n if (forename != '' && surname != '')\n forename+' '+surname\n elsif (forename != '')\n forename\n elsif (email != '')\n email\n end\n end", "def name(use_email = true)\n if (firstname.blank? && surname.blank?) || use_email\n email\n else\n name = \"#{firstname} #{surname}\"\n name.strip\n end\n end", "def email_in_name(thing)\n return unless thing.include?(\"@\")\n parts = thing.split(\" \")\n emails = parts.reject { |part| !part.include?(\"@\") }\n results = []\n Array(emails).each do |email|\n id = email.split('@')[0]\n results << (login_name(id) || results_hash(mail: [email]))\n end\n results\n end", "def display_name\n @json['profile']['displayName'] rescue nil\n end", "def get_name_surname\n\t\tuser.name + ' ' + user.surname\n\tend", "def name\n @json['profile']['name']['formatted'] rescue nil\n end", "def display_name\n self.email\n end", "def display_name\n name || email\n end", "def display_name\n name || email\n end", "def personal_name\n data[:personal_name]\n end", "def name\n\t\tif name_source.present?\n\t\t\tproviders = [\"twitter\",\"facebook\",\"google_oauth2\",\"lastfm\",\"vimeo\"]\n\t\t\tp,v = name_source.split(\"::\",2)\n\t\t\treturn name_source unless p.in? providers\n\t\t\tl = self.links.find_by(provider: p)\n\t\t\tif l\n\t\t\t\tnames = l.names\n\t\t\t\treturn names[v.to_sym] if names.is_a? Hash and v and names[v.to_sym]\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn custom_name if custom_name.present?\n\t\treturn email.split('@')[0].titleize if email.present?\n\t\tUser.default_name\n\tend", "def get_attendee_name_from_email(attemail, companyid, matterid)\n attemail = attemail.chomp\n cnt = Contact.first(:conditions => {:company_id => companyid, :email => attemail})\n usr = User.first(:conditions => {:company_id => companyid, :email => attemail})\n if cnt or usr\n if cnt\n cnt.full_name\n else\n usr.full_name\n end\n end\n end", "def get_first_and_last_name\n if first_name && last_name && !first_name.empty? && !last_name.empty?\n [first_name, last_name]\n elsif description.present?\n [\n description.split(' ')[0],\n description.split(' ')[1]\n ]\n else\n [name[0..4], ''] # Return just the first 5 char from the username, just to increase the chances\n end\n end", "def find_profile_user(full_name)\n name = split_phrase(full_name)\n profile = Profile.find_by_first_name_and_last_name(name.first, name.last)\n user = profile.user unless profile.blank?\n user\n end", "def username\n profile['Username']\n end", "def displayname\n\t\treturn self[:displayName] ||\n\t\t\t[ self.givenName, self.sn ].compact.join( ' ' )\n\tend", "def to_s\n emails = email.nil? || email.empty? ? '' : \" <#{email.join('; ')}>\"\n \"#{first_name} #{surname}#{emails}\"\n end", "def get_account_name email_addr\n account, other = email_addr.split '@'\n dovecot_accounts[account.downcase]\n end", "def full_name\n \treturn \"#{first_name} #{last_name}\".strip if(first_name || last_name) \n \t\"Anonymous\"\n end", "def username_and_first_name\n if first_name.nil?\n username\n else\n \"#{username} (#{first_name})\"\n end\n end", "def email\n if read_attribute(:active) == 1\n if Rails.env.development?\n self.first_name + \" \" + self.last_name + \" <dtg_ror_devel@lists.teradyne.com>\"\n else\n read_attribute(:email)\n end\n else\n \"\"\n end\n end", "def display_name\n if cas_surname and cas_givenname\n cas_givenname + ' ' + cas_surname\n else\n username\n end\n end", "def full_name\n full_name = object.first_name + \" \" + object.last_name\n if object.profile.try(:search_engine_privacy).present?\n display_name = object.profile.try(:search_engine_privacy) == \"Show my full name\" ? full_name : object.first_name + \" \" + object.last_name.chr\n else\n display_name = full_name\n end\n return display_name \n end", "def full_name\n if user_data\n \"#{user_data['first_name']&.downcase&.capitalize} #{user_data['last_name']&.downcase&.capitalize}\"\n end\n end", "def email\n if self.alternate_email.blank?\n if self.alumni?\n \"#{self.username}@alumni.calvin.edu\"\n else\n \"#{self.username}@students.calvin.edu\"\n end\n else\n self.alternate_email\n end\n end", "def title_after_name(emailname)\n result = nil\n if emailname.count(',') > 0\n new_name = emailname.split(',')[0]\n result = email_for_name(new_name) if new_name.count(' ') > 0\n end\n result\n end", "def display_name\n first_name.blank? || last_name.blank? ? email : first_name + \" \" + last_name\n end", "def name\n email\n end", "def name\n email\n end", "def extract_name(email)\n\t\t# Uses regular expressions to remove everything after the \"@ as well as any digits\"\n\t\temail.gsub(/@.*$/,'').gsub(/[0-9]+/,'')\n\tend", "def user_full_name\n return object.billing_name if object.billing_name.present?\n \"#{user_firstname} #{user_lastname}\"\n end", "def name\n\t\tn = names\n\t\treturn n[:fullname] if n[:fullname]\n\t\treturn n[:username] if n[:username]\n\t\treturn I18n.translate(\"user.name.unknown\")\n\tend", "def display_name\n display_name = @current_profile.display_name\n end", "def display_name\n return attributes['display_name'] unless attributes['display_name'].blank?\n return \"#{attributes['first_name']} #{attributes['last_name']}\" unless attributes['first_name'].blank? && attributes['last_name'].blank?\n return '(unknown)'\n end", "def to_s\n name || email\n end", "def name\n \"#{self.class.name.titleize}: #{user.email rescue 'unknown user'}\"\n end", "def title\n if (self.first_name && self.first_name.length != 0)\n self.first_name + ' ' + self.last_name\n else\n self.email\n end\n end", "def full_name(person)\n name = person[\"first_name\"] + \" \" + person[\"last_name\"]\n return name\nend", "def formatted_email\n\t\t# because @name and @email are both instance variables, they are available in formatted_email\n\t\t\"#{@name} <#{@email}>\"\n\tend" ]
[ "0.7697218", "0.7293876", "0.7223716", "0.71921855", "0.7151555", "0.7044281", "0.7034166", "0.70239383", "0.70093167", "0.6962292", "0.69519824", "0.69434667", "0.6897871", "0.68928665", "0.6877373", "0.6874562", "0.686755", "0.68573684", "0.6849019", "0.68449956", "0.6818181", "0.6801848", "0.67968976", "0.6754546", "0.67404836", "0.6720764", "0.6718438", "0.6696795", "0.6687352", "0.66760653", "0.6673292", "0.66447073", "0.66245514", "0.6619959", "0.66051793", "0.66000766", "0.65596676", "0.65477395", "0.65462214", "0.65184885", "0.6498325", "0.64863986", "0.6470746", "0.6455788", "0.64476526", "0.6441602", "0.6432641", "0.64318573", "0.64288896", "0.63991314", "0.63867193", "0.63867193", "0.63867193", "0.63786244", "0.6376337", "0.636527", "0.63538384", "0.6326504", "0.63178074", "0.6316026", "0.6306453", "0.6305194", "0.6304261", "0.62922895", "0.62897563", "0.62878346", "0.6282701", "0.62781286", "0.62768227", "0.62768227", "0.6275723", "0.6272305", "0.62587875", "0.62488955", "0.62427884", "0.6234784", "0.6232386", "0.6227951", "0.6226562", "0.62255716", "0.6225081", "0.62214655", "0.62120247", "0.6206702", "0.62052035", "0.62033015", "0.62021583", "0.61986595", "0.61908877", "0.61908877", "0.6183095", "0.6172889", "0.617136", "0.6169022", "0.6163312", "0.61618185", "0.6158333", "0.6155736", "0.6154662", "0.6153194" ]
0.7101414
5
Returns under supervision clinics and examining clinics
def related_clinics _clinics = [] under_supervision_clinics.each do |c| unless _clinics.include?(c) _clinics.append(c) end end clinics.each do |c| unless _clinics.include?(c) _clinics.append(c) end end return _clinics end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_related_clinics?\n if under_supervision_clinics.count > 0 || clinics.count > 0\n return true\n end\n return false\n end", "def collect_crime_information\n ### Crime information\n mark_data_crime_information = Array.new\n crime_information = @case_details[:case][:system][:crime]\n\n mark_data_crime_information << 'Answer the following about each crime present in the evidence on the system'\n crime_information.each do | key, value | mark_data_crime_information << \"-#{key.capitalize}::#{value}\"\n end\n mark_data_crime_information << ''\n\n return mark_data_crime_information\n end", "def list_citizens\n\t\tputs \"\"\n\t\t@citizens.each do |citizen|\n\t\t\tprint \"#{citizen.voter_id}\\t#{citizen.class}, #{citizen.name}, \"\n\t\t\tputs case citizen\n\t\t\twhen Person then citizen.politics\n\t\t\twhen Politician then citizen.party\n\t\t\tend\n\t\tend\n\t\tputs \"No citizens yet!\" if @citizens.none?\n\tend", "def current_diagnoses\n self.encounters.current.all(:include => [:observations]).map{|encounter| \n encounter.observations.active.all(\n :conditions => [\"obs.concept_id = ? OR obs.concept_id = ?\", \n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "def locate_cheapest_clinic(gestational_age: 999, limit: 5)\n puts 'NOT IMPLEMENTED YET'\n # @helper = ::ClinicFinder::GestationHelper.new(gestational_age)\n # filtered_clinics = filter_by_params gestational_age, naf_only, medicaid_only\n\n # @gestational_tier = @helper.gestational_tier\n # decorate_data(available_clinics)\n end", "def suitable_for_all\n \tdisciplines = Discipline.find(:all)\n \tdisciplines.each do |discipline|\n \t\tself.suitable_for(discipline.name)\n \tend\n end", "def search_clinic_doctors\n if !@general_specializations.empty?\n clinic_doctors\n missing_specializations\n search_repeat unless @all_specializations.empty?\n else\n search_repeat\n end\n end", "def all_cops?; end", "def my_cults_slogans\n self.cults.each do |cult|\n puts cult.slogan\n end\n end", "def mechanics\n Mechanic.all.select do |mechanic_ob|\n #binding.pry\n mechanic_ob.specialty == self.classification\n end\nend", "def round1_all_cand\n Candidate.all.select do |can|\n if can.level_of_governments == \"Local Election\"\n puts''\n puts\" \"\n puts\" #{can.name} \"\n puts\" \"\n puts\" State: #{can.state} \"\n puts\" Party: #{can.party} \"\n puts\" Age: #{can.age} \"\n puts\" Years of Experience: #{can.years_of_experience} \"\n puts\" Level of Government: #{can.level_of_governments} \"\n puts\" \"\n puts' ==================================================='\n end\n end\n end", "def subcontract_category; end", "def fetch_constituent_catkeys\n fetch_member_orders_by_druid_and_constituent_parents\n constituent_info.each_key do |constituent_druid|\n dro = Dro.find_by(external_identifier: constituent_druid)\n @constituent_info[constituent_druid][:catkeys] = dro.identification['catalogLinks'].select { |catalog_link| catalog_link['catalog'] == 'symphony' }\n end\n end", "def superwork_influences\n find_related_frbr_objects( :is_influenced_by, :which_superworks?) \n end", "def scientist; end", "def my_cults_slogans\n cults.each {|cult| puts cult.slogan }\n end", "def my_cults_slogans\n self.cults.each do |cult|\n puts cult.slogans\n end\n end", "def risd_terminology # :nologin:\n end", "def round2_all_cand\n Candidate.all.select do |can|\n if can.level_of_governments == \"State Election\"\n puts''\n puts\" \"\n puts\" #{can.name} \"\n puts\" \"\n puts\" State: #{can.state} \"\n puts\" Party: #{can.party} \"\n puts\" Age: #{can.age} \"\n puts\" Years of Experience: #{can.years_of_experience} \"\n puts\" Level of Government: #{can.level_of_governments} \"\n puts\" \"\n puts' ==================================================='\n end\n end\n end", "def mechanics\n Mechanic.all.select{|mechanic|mechanic.specialty == self.classification}\n end", "def critical_risks\n\t\t\t\t\twhere(:severity => 4).where(:rollup_finding => false)\n\t\t\t\tend", "def production_curtailment; end", "def cpl\n end", "def villain; end", "def villain; end", "def villain; end", "def current_clown; end", "def current_clown; end", "def my_cults_slogans\n self.bloodoaths.map do |blood|\n blood.cult.slogan\n end\n end", "def health_remark_code_segments\n @eob = service.insurance_payment_eob\n facility = @eob.check_information.job.batch.facility\n health_remark_code_segments = []\n health_remark_code_segments << compute_lq(\"in\")\n health_remark_code_segments << compute_lq(\"out\") \n if facility.details[:interest_in_service_line] && service.interest_service_line?\n health_remark_code_segments << lq_rx_segments(\"109975\") if @eob.claim_interest.to_f > 0.0 \n end \n health_remark_code_segments << lq_rx_segments(\"109702\") if @eob.hcra.to_f > 0.0\n health_remark_code_segments.compact!\n health_remark_code_segments.flatten\n end", "def clinic_doctors\n @general_specializations.each do |spec|\n @doctors << Clinic.new(@clinic[:id]).find_doctors_by_specialization(spec[:id])\n end\n end", "def info_show_profession_of_faith\n chosen_baptized_catholic? && !baptized_catholic\n end", "def collegiate_rivals\n end", "def cutoffs\n end", "def forkless(interspinous_interdevour, cladodontid_michel)\n end", "def s_situational\n SegmentReqs_::Situational\n end", "def unit_citizens\n world.units.active.find_all { |u| \n unit_iscitizen(u)\n }\n end", "def invention; end", "def list_celebrities\n puts \"\\nAnd here are the celebrities who share your birthday! Celebrate together! Sing the lyric TOGETHER!!!\\n\"\n generate_list\n end", "def determine_active_critics\n \tresult = Critic.all\n \tresult.each do | critic |\n \t\treviews_1_year_ago = critic.critic_movies.where(\"date > ?\", 2.year.ago)\n \t\tif reviews_1_year_ago.any?\n \t\t\tcritic.active = true\n \t\t\tputs critic.first_name + critic.last_name + \" is active\"\n \t\telse\n \t\t\tcritic.active = false\n \t\t\tputs critic.first_name + critic.last_name + \" is not active\"\n\n \t\tend\n \t\tcritic.save\n \tend\n end", "def electromechanical; end", "def my_cults_slogans\n self.cults.map do |cult|\n cult.slogan\n end\n end", "def thorins_company; end", "def cults\n self.cur_oaths.map {|bloodoath| bloodoath.cult}\n end", "def species\n # taxonomy sentence:\n # TODO: this assumes perfect coverage of A1 and A2 for all species, which is a bad idea. Have contingencies.\n what = a1\n family = a2\n species_parts = []\n\n if match = growth_habit_matches.by_type(:x_species)\n species_parts << trait_sentence_part(\n \"#{name_clause} is \"\\\n \"#{a_or_an(match.trait[:object_term][:name])} %s \"\\\n \"species of #{what}\",\n match.trait\n )\n elsif match = growth_habit_matches.by_type(:species_of_x)\n species_parts << trait_sentence_part(\n \"#{name_clause} is a species of %s\",\n match.trait\n )\n else\n species_parts << \"#{name_clause} is a species of #{what}\"\n end\n\n if family\n species_parts << \" in the family #{a2}\"\n end\n\n if match = growth_habit_matches.by_type(:and_a_x)\n species_parts << trait_sentence_part(\n \", and #{a_or_an(match.trait[:object_term][:name])} %s\",\n match.trait\n )\n elsif match = growth_habit_matches.by_type(:x_growth_habit)\n species_parts << trait_sentence_part(\n \", with #{a_or_an(match.trait[:object_term][:name])} %s growth habit\",\n match.trait\n )\n end\n\n species_parts << \".\"\n @sentences << species_parts.join(\"\")\n\n if is_it_extinct?\n term_sentence(\"This species is %s.\", \"extinct\", Eol::Uris.extinction, Eol::Uris.extinct)\n elsif @page.iucn_status_key && IucnKeys.include?(@page.iucn_status_key.to_sym)\n handle_iucn @page.iucn_status_key.to_sym\n end\n\n # If the species [is extinct], insert an extinction status sentence between the taxonomy sentence\n # and the distribution sentence. extinction status sentence: This species is extinct.\n\n # If the species [is marine], insert an environment sentence between the taxonomy sentence and the distribution\n # sentence. environment sentence: \"It is marine.\" If the species is both marine and extinct, insert both the\n # extinction status sentence and the environment sentence, with the extinction status sentence first.\n term_sentence(\"It is found in %s.\", \"marine habitat\", Eol::Uris.environment, Eol::Uris.marine) if is_it_marine?\n\n # Distribution sentence: It is found in [G1].\n @sentences << \"It is found in #{g1}.\" if g1\n end", "def is_lichen?\n lifeform.include?(\"lichen\")\n end", "def round3_all_cand\n Candidate.all.select do |can|\n if can.level_of_governments == \"National Election\"\n puts''\n puts\" \"\n puts\" #{can.name} \"\n puts\" \"\n puts\" State: #{can.state} \"\n puts\" Party: #{can.party} \"\n puts\" Age: #{can.age} \"\n puts\" Years of Experience: #{can.years_of_experience} \"\n puts\" Level of Government: #{can.level_of_governments} \"\n puts\" \"\n puts' ==================================================='\n end\n end\n end", "def lifters\n # binding.pry\n memberships.map { |membership| membership.lifter }.uniq\n end", "def full_line\n RetortApi.markov_chain(identity: { medium: 'bible' })\nend", "def winter_olympics_sport; end", "def extracosmic_expansive_onstand(lymphatolysis_fissure, french, whauve_diapophysial)\n unsuckled_catsup(apterygota, unfightable_phoneticist)\n end", "def my_cults_slogans\n Bloodoath.all.each do |bloodoath|\n if bloodoath.follower == self\n puts bloodoath.cult.slogan\n end\n end\n end", "def scotch\n puts \"Which type of Scotch would you like to explore?\"\n puts <<-DOC\n 1. Single Malt\n 2. Blended Malt\n 3. Blended\n 4. Grain\n DOC\n scotch_type_list\n end", "def get_celebrity_status\n set_imdb if @imdb_data\n set_wikipedia if @wikipedia_data\n set_social_data if @fullcontact_data\n end", "def raw_critical_risks\n\t\t\t\t\twhere(:severity => 4)\n\t\t\t\tend", "def essentials(on,dc)\n # Create the essential list.\n es = []\n\n # For each cube of on, check if it is essential.\n on.each_cube do |cube|\n # Step 1: build the +cover+ (on-cube)+dc.\n # NOTE: could be done without allocating multiple covers,\n # but this is much readable this way, so kept as is as long\n # as there do not seem to be any much performance penalty.\n cover = (on-cube)+dc\n # Step 2: Gather the concensus beteen each cube of +cover+\n # and their sharp with +cube+.\n cons = Cover.new(*on.each_variable)\n cover.each_cube do |ccube|\n # Depending on the distance.\n dist = cube.distance(ccube)\n # If the distance is >1 there is no consensus.\n # Otherwise:\n if (dist == 1) then\n # The distance is 1, the consensus is computed directly.\n cons << ccube.consensus(cube)\n elsif (dist == 0)\n # The distance is 0, sharp ccube from cube and\n # compute the concensus from each resulting prime cube.\n ccube.sharp(cube).each do |scube|\n scube = scube.consensus(cube)\n cons << scube if scube\n end\n end\n end\n # Step 3: check if +cube+ is covered by cover+cons.\n # This is done by checking is the cofactor with cube\n # is not a tautology.\n unless (cons+dc).cofactor_cube(cube).is_tautology?\n # +cube+ is not covered by cover+cons, it is an essential.\n es << cube\n end\n end\n \n # Create the resulting cover.\n result = Cover.new(*on.each_variable)\n es.each { |es| result << es }\n return result\n end", "def superwork_evidences\n find_related_frbr_objects( :is_evidence_of, :which_superworks?) \n end", "def unusual_sport; end", "def info_risks\n\t\t\t\t\twhere(:severity => 0).where(:rollup_finding => false)\n\t\t\t\tend", "def mechanics\n cars.map {|c| c.mechanic}\n end", "def techniques_by_tactic(only_platform: /.*/)\n techniques_by_tactic = Hash.new {|h, k| h[k] = []}\n techniques.each do |technique|\n next unless !technique['x_mitre_platforms'].nil?\n next unless technique['x_mitre_platforms'].any? { |platform| platform.downcase.sub(\" \", \"-\") =~ only_platform }\n\n technique.fetch('kill_chain_phases', []).select { |phase| phase['kill_chain_name'] == 'mitre-attack' }.each do |tactic|\n techniques_by_tactic[tactic.fetch('phase_name')] << technique\n end\n end\n techniques_by_tactic\n end", "def round2_my_party_cand\n Candidate.all.select do |can|\n if can.party == self.party and can.level_of_governments == \"State Election\"\n puts''\n puts\" \"\n puts\" #{can.name} \"\n puts\" \"\n puts\" State: #{can.state} \"\n puts\" Party: #{can.party} \"\n puts\" Age: #{can.age} \"\n puts\" Years of Experience: #{can.years_of_experience} \"\n puts\" Level of Government: #{can.level_of_governments} \"\n puts\" \"\n puts' ==================================================='\n end\n end\n end", "def raining\r\n OUTFIT[@climate_service.rain]\r\n end", "def is_vaccine?\n vaccine\n end", "def mycelial_gristmilling()\n xenopteri_shebang(sectwise_cessor, ungular_pietism)\n end", "def initialize # clinic\n # @clinic = clinic\n # @company = clinic.company\n # @nfe_company = clinic.nfe_company\n \n response = update\n end", "def intensifier; end", "def callsites\n return @callsites if @callsites\n @callsites = instructions.list.select { |i| i.callees.length > 0 }\n end", "def aetiology_processor(line)\n\t\tline.strip.scan(/^(Aetiology and immunopathogenesis|Aetiology)$/) do |match|\n\t\t\treturn [\"on\",line.strip]\n\t\tend\n\t\treturn [\"off\",line.strip]\n\tend", "def in_law; end", "def round1_my_party_cand\n Candidate.all.select do |can|\n if can.party == self.party and can.level_of_governments == \"Local Election\"\n puts''\n puts\" \"\n puts\" #{can.name} \"\n puts\" \"\n puts\" State: #{can.state} \"\n puts\" Party: #{can.party} \"\n puts\" Age: #{can.age} \"\n puts\" Years of Experience: #{can.years_of_experience} \"\n puts\" Level of Government: #{can.level_of_governments} \"\n puts\" \"\n puts' ==================================================='\n end\n end\n end", "def on_the_offensive(brd)\n attack = []\n WINNING_LINES.each do |line|\n current_line = brd.values_at(*line)\n if current_line.count(COMPUTER_MARKER) == 2\n attack = line\n end\n attack # returns array that is the best attack vector\nend\n\ndef determine_threat(brd)\n threat_line = []\n WINNING_LINES.each do |line|\n current_line = brd.values_at(*line)\n if current_line.any?(COMPUTER_MARKER)\n next\n elsif current_line.count(PLAYER_MARKER) == 2\n threat_line = line\n end\n end\n threat_line\nend", "def covered_lines; end", "def celebrity; end", "def celebrity; end", "def caveats; nil end", "def caveats; nil end", "def summer_olympics_sport; end", "def disciplines_for(discipline)\n if discipline\n [Discipline[discipline]]\n else\n #alphere this is causing nil discipline error in UpcomingEvents.find_all\n #[Discipline[:road], Discipline[:mountain_bike], Discipline[:bmx], Discipline[:track], Discipline[:cyclocross]]\n #works: [Discipline[:road]]\n disciplines = Array.new\n Discipline.find_all_names.each do | name |\n disciplines << (Discipline[name.to_sym]) unless name.to_s == ''\n end\n disciplines\n end\n end", "def blood_oaths #<-- blood oath selects all cult members in bloodOath Class file\n BloodOath.all.select { |blood_oath| blood_oath.cult == self}\n end", "def current_diagnoses(patient_id)\n patient = Patient.find(patient_id)\n patient.encounters.current.includes([:observations]).map{|encounter|\n encounter.observations.where([\"obs.concept_id = ? OR obs.concept_id = ?\",\n ConceptName.find_by_name(\"DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "def cults\n # the code on the line below is the same as:\n # self.blood_oaths.map do |blood_oath|\n # blood_oath.cult\n # end\n self.blood_oaths.map(&:cult)\n end", "def get_smokers\n get_clients.select{ |client| client.smoke_cigarettes}\n end", "def qualified_candidates(candidates)\n puts \"Candidates that meet your specs:\"\n\n qualified = candidates.select do |c|\n experienced?(c)\n has_enough_github_pts?(c) &&\n has_right_languages?(c) &&\n applied_within_15_days?(c) &&\n is_of_age?(c)\n end\nend", "def get_missions_in_cat\r\n missions = []\r\n \r\n return missions\r\n end", "def colt(year); inproceedings('COLT', year) end", "def index\n @critics = Critic.all\n end", "def court_division\n case(court)\n when \"superior\"\n \"Suffolk County Civil\"\n when /^bmc/\n court_name\n else\n \"N/A\"\n end\n end", "def cults \n oaths = BloodOath.all.find_all {|oath| oath.follower == self}\n oaths.map {|oath| oath.cult}\n # oaths = BloodOath.all.find_all do |oath| \n # oath.follower == self\n # end\n\n # oaths.map do|oath| \n # oath.cult\n # end \n end", "def get_clinic_with_cache(station_id:, clinic_id:)\n Rails.cache.fetch(\"vaos_clinic_#{station_id}_#{clinic_id}\", expires_in: 12.hours) do\n get_clinic(station_id:, clinic_id:)\n end\n end", "def cults\n bloodoaths.map do |cults| \n cults.cult.name\n end\n end", "def cults\n # * returns an `Array` of this follower's cults\n # follows single source of truth\n my_oaths = BloodOath.all.select do |blood_oath|\n blood_oath.follower == self\n end\n my_cults = my_oaths.map do |my_oath|\n my_oath.cult\n end\n my_cults\n end", "def expertise\n subcategories.map(&:name).to_sentence\n end", "def scraper_categories\n scraped = Scraper.scrape_website\n Flower.all \n #find method?\n # if price == $0..$79\n # @@low << flower_object\n # elsif == $80..$149\n # @@med << flower_object\n # else\n # @@high << flower_object\n # end \n\n # binding.pry\n end", "def captains\n 1\n end", "def get_contemporary_seasons_involved_into(season)\n @swimmer.seasons.is_in_range(season.begin_date, season.end_date)\n end", "def show\n load_plan\n load_curriculum_for_show_and_edit\n authorize! :read, @curriculum\n\n @competences = Competence.where(:curriculum_id => @curriculum.id, :parent_competence_id => nil).includes([{:children => :localized_description}, :localized_description]).all\n #@competences = @curriculum.competences.joins(:competence_descriptions).includes(:localized_description, :skills => [:localized_description]).where(:parent_competence_id => nil, :competence_descriptions => {:locale => I18n.locale}) .order('competence_descriptions.name')\n @competences.sort! { |competence, other| competence.localized_name <=> other.localized_name }\n\n if @study_plan\n @chosen_competence_ids = @study_plan.competence_ids.to_set\n else\n @chosen_competence_ids = []\n end\n \n respond_to do |format|\n format.html { render :action => :show, :layout => 'fixed' }\n end\n \n log(\"view_competences\")\n end", "def qualified_color(candidates)\n candidates.each do |candidate| \n if experience?(candidate) && languages?(candidate) && last_15_days?(candidate) && over_17?(candidate)\n puts candidate.to_s.green\n else\n puts candidate.to_s.red\n end\n end\nend", "def pregnancy_c32(xml)\n if pregnant\n xml.component do\n xml.section do\n xml.title \"Results\"\n xml.text \"Patient is currently pregnant\"\n xml.entry do\n xml.observation(\"classCode\" => \"OBS\", \"moodCode\" => \"EVN\") do\n # why is code here you ask, because the schema states it needs to be \n # event though the C32 doc does not include it, one more reason to just\n # hate the CDA/CCD/C32 specs\n xml.code(\"code\" => \"77386006\",\n \"displayName\" => \"Patient currently pregnant\",\n \"codeSystem\" => \"2.16.840.1.113883.6.96\",\n \"codeSystemName\" => \"SNOMED CT\")\n xml.value(\"xsi:type\" => \"CD\",\n \"code\" => \"77386006\",\n \"displayName\" => \"Patient currently pregnant\",\n \"codeSystem\" => \"2.16.840.1.113883.6.96\",\n \"codeSystemName\" => \"SNOMED CT\")\n end\n end\n end\n end\n end\n end", "def services\n Car.all.find do |c| \n c.classification == self.specialty\n end\nend" ]
[ "0.57600874", "0.5593624", "0.5485031", "0.5426158", "0.541172", "0.5404782", "0.53919417", "0.53701174", "0.5294311", "0.52568156", "0.5213306", "0.52102417", "0.52045923", "0.5204297", "0.5203712", "0.5191047", "0.51907796", "0.51808304", "0.5177272", "0.51751316", "0.5173349", "0.5171431", "0.51676434", "0.51407266", "0.51407266", "0.51407266", "0.51343733", "0.51343733", "0.5115228", "0.5110445", "0.5107961", "0.509889", "0.508391", "0.5070415", "0.50577676", "0.50569", "0.5056464", "0.5053425", "0.50304466", "0.5023957", "0.5016531", "0.5012108", "0.5008664", "0.4996939", "0.49889114", "0.49878123", "0.49869883", "0.49864218", "0.49820673", "0.49741623", "0.49683213", "0.49575198", "0.49545234", "0.49415353", "0.49399072", "0.4937461", "0.4933797", "0.4931691", "0.49313563", "0.4915979", "0.49045345", "0.49013588", "0.48977134", "0.48966974", "0.48958227", "0.4895804", "0.48950768", "0.48920187", "0.4890392", "0.48752126", "0.48713577", "0.48691005", "0.48644844", "0.48634747", "0.48634747", "0.4860739", "0.4860739", "0.48538092", "0.48533657", "0.48507452", "0.48473448", "0.4841077", "0.4838575", "0.4837414", "0.48366988", "0.48355988", "0.48328564", "0.48313433", "0.48290688", "0.4825733", "0.48232543", "0.48223004", "0.48194534", "0.4811299", "0.48106667", "0.48076922", "0.4806243", "0.48033035", "0.48017818", "0.47982243" ]
0.65987307
0
Returns all patient in under supervision clinics or patient which has registered by user.
def related_patients _patients=[] under_supervision_clinics.each do |clinic| clinic.registrations.each do |reg| unless _patients.include?(reg.patient) _patients.append(reg.patient) end end end registrations.each do |reg| unless _patients.include?(reg.patient) _patients.append(reg.patient) end end return _patients end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patients \n patients = Patient.all.select do |patient|\n patient.doctor == self\n end\n\n # patients.map do |patient|\n # patient.name\n # end\n end", "def patients \n # patients = []\n # Appointment.all.each do | appointment |\n # if appointment.doctor == self \n # patients << appointment.patient\n # end\n # end\n # patients\n all_app = Appointment.all.select do | appointment |\n appointment.doctor == self\n end\n all_patients = all_app.collect do | appointment |\n appointment.patient.name\n end\n # all_patients.map do | patient |\n # patient.name\n # end\n end", "def patients\n patients_array = []\n Appointment.all.each do |appointment|\n if appointment.doctor == self\n patients_array.push(appointment.patient)\n end\n end\n patients_array.uniq\n end", "def patients\r\n\t\tAppointment.all.collect do |appt|\r\n\t\t\t\tappt.patient if appt.doctor == self\r\n\t\tend\r\n\tend", "def patients\n\t\tAppointment.all.collect do |appt|\n\t\t\t\tappt.patient if appt.doctor == self\n\t\tend\n\tend", "def patients\n self.appointments.map do |doctors_appts|\n doctors_appts.patient\n end\n end", "def viewable_patients\n jurisdiction.all_patients\n end", "def patients\n my_patients = self.appointments.map do |appointment|\n appointment.patient\n end \n\n my_patients.uniq\n end", "def index\n @user = current_user\n\n if admin_role?\n @patients = Patient.all\n elsif !(admin_role?)\n @patients = @user.patients\n end\n end", "def patients\r\n appointments.map { |s|s.patient }\r\n end", "def patients\n Observation.select('patient_id, birthdate, patient_current_regimen(patient_id, obs_datetime) as regimen')\n .joins(:encounter)\n .joins('INNER JOIN person USING (person_id)')\n .where(concept_id: ConceptName.find_by_name('Viral load').concept_id,\n obs_datetime: (start_date..end_date),\n value_numeric: viral_load_range)\n .merge(Encounter.where(encounter_type: EncounterType.find_by_name('LAB ORDERS').encounter_type_id))\n .group(:person_id)\n .order(obs_datetime: :desc)\n end", "def index\n \n @patients = nil\n #Fazer a verificação se é neuropsicologo\n if current_login.has_role? :secretary\n logged_user = Secretary.first(:conditions => \"login_id = #{current_login.id}\")\n @patients = Patient.is_active.in_clinic(logged_user.clinic.id).all\n elsif current_login.has_role? :neuropsychologist\n logged_user = Neuropsychologist.first(:conditions => \"login_id = #{current_login.id}\")\n # para obter os pacientes do neuropsicolgo é necessario ir a tabela das sessoes\n appointments = Appointment.where(:neuropsychologist_id => logged_user.id)\n @patients = appointments.collect(&:patient).uniq\n end\n\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patients }\n end\n end", "def index\n @patients = current_user.patients\n end", "def patients\n self.appointments.map do |appointment|\n appointment.patient\n # binding.pry\n end\n # Appointments.all.select {|doc| }\n end", "def patients\n appointments.map{|appointment| appointment.patient}.uniq\n end", "def patients\n self.appointments.collect do |appointment|\n appointment.patient\n end\n end", "def patients\n self.appointments.collect do |appointment|\n appointment.patient\n end\n end", "def patients\n self.appointments.collect do |a|\n a.patient\n end\n end", "def patients\n appointments.collect { |appt| appt.patient }\n end", "def patients\n appointments.map do |appointment|\n appointment.patient\n end\n end", "def index\n @visible=any_filters?\n @patients = apply_scopes(Patient).all\n if current_user.user_type==\"doctor\"\n @patients = @patients.where(health_center_id: current_user.health_center_id)\n else\n @patients = @patients.where(user_id: current_user.id)\n end\n @params = params\n\n end", "def patients\n @appointments.collect do |appt|\n appt.patient\n end\n end", "def get_patients(ids)\n if has_role?(:enroller)\n enrolled_patients.find(ids)\n elsif has_role?(:public_health)\n viewable_patients.find(ids)\n elsif has_role?(:public_health_enroller)\n viewable_patients.find(ids)\n elsif has_role?(:admin)\n nil\n end\n end", "def has_related_patient?\n if registrations.count > 0\n return true\n end\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n return true\n end\n end\n return false\n end", "def patients\n self.appointments.collect do |appointment|\n appointment.patient\n end\n end", "def get_patient\n @get_patient ||= patient_service.get(user.icn)\n end", "def patients\n patients = User.patients\n render json: { status: 200, data: patients }\n end", "def index\n @physicians = Physician.where(user_id: current_user.id)\n @users = User.where(id: current_user.id)\n end", "def index\n @patients = Patient.all.from_user(current_user.id)\n end", "def index \n @patients = current_user.patients \n # Which patients should a user see when they're logged in? \n # We only show the patients that belong to the current user.\n # With devise, current_user is accessible in controllers and views. \n # If there is no current user or a User isn't logged in we're redirected to login ?? \n end", "def show\n authorize User\n @doctors = DoctorPatient.where(patient: @patient, status: 'active').map(&:doctor)\n end", "def query_surgical_profiles_inc_patients(\n current_user, page=1, limit=@@RESULTS_LIMIT)\n return SurgicalProfile.query_all_by_patient_id_inc_patients(\n current_user, self.id, page, limit\n )\n end", "def patients\napps = []\nAppointment.all.each do |x|\n if x.doctor == self\n apps << x.patient\n end\nend\napps\nend", "def index\n if mobile_device? && current_user?\n patient_service = BloodSelectionService.new(session_login_user, session_password_user)\n response = patient_service.patients\n patient_data_set = PatientDataSet.parse(response)\n @patients = patient_data_set.patients.sort_by! do |patient|\n patient.prsn_Externalization\n end\n end\n end", "def appointments\n Appointment.all.select { |x| x.patient == self }\n end", "def getPatientList\n return @patientTable.patientList\n end", "def index\n user = current_user\n sub_ids = []\n if not current_user.admin\n if params[:result] == \"true\"\n @patients = user.patients.where(result: true).order(:case_id).page(params[:page]).per(25)\n else\n @patients = user.patients.order(:case_id).page(params[:page]).per(25)\n end\n else\n if params[:result] == \"true\"\n @patients = Patient.where(result: true).order(:case_id).page(params[:page]).per(25)\n else\n @patients = Patient.order(:case_id).page(params[:page]).per(25)\n end\n end\n end", "def patient\n insurance_provider.patient\n end", "def patients\n # appointments\n # self.appointments.collect <- same as map \n ####### \n # self.appointments.map do |appointment|\n # appointment.patient\n # end\n ########\n self.appointments.map{|appointment| appointment.patient}.uniq\n #######\n # self.appointments.map(&:patient).uniq\n #######\n # self.appointments.map(&:patient).to_set\n end", "def index\n @human = current_user.humen.find(params[:human_id])\n @patients = @human.patients\n end", "def users\n\t\tproficiencies_by_type(\"User\")\n\tend", "def related_clinics\n _clinics = []\n under_supervision_clinics.each do |c|\n unless _clinics.include?(c)\n _clinics.append(c)\n end\n end\n clinics.each do |c|\n unless _clinics.include?(c)\n _clinics.append(c)\n end\n end\n return _clinics\n end", "def enrolled_patients\n begin\n patients = enroller_table_data(params, current_user)\n rescue InvalidQueryError => e\n return render json: e, status: :bad_request\n end\n\n render json: patients\n end", "def show\n @certification_users = []\n\n #TODO: make a better SQL query for this\n @certification.users.sort_by(&:name).each do |user|\n @certification_users.push user if can? :read, user\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @certification }\n end\n end", "def get_patient(id)\n current_resource_owner.viewable_patients.find_by(id: id)\n end", "def appointments\n Appointment.all.select do |appointment| appointment.patient == self end\n end", "def index\n if Patient == current_model\n Rails.logger.debug \"--- Looking up top-level patient info ---\"\n @objects = @authorized_user.patients\n elsif params[:patient]\n Rails.logger.debug \"--- Patient specified in request ---\"\n head :unauthorized and return unless can_access_patient?(params[:patient])\n \n @objects = current_model.where(patient_id: params[:patient])\n else\n Rails.logger.debug \"--- Patient implied ---\"\n head :bad_request and return unless patient_implicit?\n \n @objects = current_model.where(patient_id: @authorized_user.patients.first)\n end\n\n respond_to do |format|\n format.json { render json: @objects }\n format.xml { render xml: @objects }\n end\n end", "def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n end\n end", "def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n end\n end", "def enrolled_patients\n created_patients\n end", "def appointments\n Appointment.all.select {|appointments| appointments.patient == self}\n end", "def get_students\n registrations.select{|r| !r.instructor}.map{|r| r.user}\n end", "def organ_donors\n Patient.where(is_organ_donor: true)\nend", "def appointments\n Appointment.all.select {|appt| appt.patient == self}\n end", "def details_view_patient\n @patient = current_user.user_record\n @appointments = Appointment.all(:conditions => { :patient_id => @patient.id })\n find_reports(current_user.id)\n end", "def current_diagnoses\n self.encounters.current.all(:include => [:observations]).map{|encounter| \n encounter.observations.active.all(\n :conditions => [\"obs.concept_id = ? OR obs.concept_id = ?\", \n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "def index\n \n if current_user.role?('ADMIN')\n @patients = Patient.all \n else\n @patients = Patient.where(:user_id => current_user.id)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @patients }\n end\n end", "def index\n @pacients = []\n\n Pacient.all.each do |p|\n if p.interviewer_email == current_interviewer.email\n @pacients << p\n end\n end\n end", "def appointments\n Appointment.all.select{|x| x.patient == self}\nend", "def index\n @enrolled_patients = current_user.enrolled_patients.eager_load(:jurisdiction)\n redirect_to(root_url) && return unless current_user.can_create_patient?\n end", "def index\n @legal_documents = LegalDocument.where(admin_user: current_user.admin_user)\n @patient = Patient.find(params[:patient_id])\n @clinic_history = ClinicHistory.find(params[:clinic_history_id])\n end", "def show\n @patient = @client.patients.find(params[:id]) unless current_user.staff?\n @patient = Patient.find(params[:id]) if current_user.staff?\n \n # Build patient history (table) of cases, examinations and treatments\n @patient_history = []\n @patient.accidents.each do |accident|\n record = []\n record[0] = accident.id\n @patient_history << record if accident.chiropractic_examinations.blank?\n accident.chiropractic_examinations.each do |examination|\n record = []\n record[0] = accident.id\n record[1] = examination.id\n @patient_history << record if examination.chiropractic_treatments.blank?\n examination.chiropractic_treatments.each do |treatment|\n record = []\n record[0] = accident.id\n record[1] = examination.id\n record[2] = treatment.id\n @patient_history << record\n end\n end\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patient }\n end\n end", "def index\n @patient = Patient.find(params[:patient_id])\n set_patient_session @patient.id, @patient.patient_name \n @managed_cares = @patient.managed_cares.joins(:subscriber)\n @title = \"Patient Managed Care Information\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @managed_cares }\n end\n end", "def appointments\n Appointment.all.select { |appointment| appointment.patient == self }\nend", "def current_diagnoses(patient_id)\n patient = Patient.find(patient_id)\n patient.encounters.current.includes([:observations]).map{|encounter|\n encounter.observations.where([\"obs.concept_id = ? OR obs.concept_id = ?\",\n ConceptName.find_by_name(\"DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end", "def index\n @patients = Patient.where(host_org: current_user.host_org).sort_by { |p| p.approved ? 0 : 1 }.sort_by(&:first_name)\n end", "def index\n @doctors = Doctor.in_clinic(@doctor).includes(:department)\n end", "def appointments\n Appointment.all.select{|appointment| appointment.patient == self}\nend", "def find_visiting_patients(date)\n day_start, day_end = TimeUtils.day_bounds(date)\n Patient.find_by_sql(\n [\n 'SELECT patient.* FROM patient INNER JOIN encounter USING (patient_id)\n WHERE encounter.encounter_datetime BETWEEN ? AND ?\n AND encounter.voided = 0 AND patient.voided = 0\n GROUP BY patient.patient_id',\n day_start, day_end\n ]\n )\n end", "def index\n if current_user.admin?\n @visits = Visit.where([\"patient_id IS NOT NULL\"])\n else\n @visits = Visit.where(patient_id: current_user.patient.id)\n end\n end", "def index\n if !current_user.patient?\n @patient_histories=PatientHistory.all\n else \n @patient_histories = PatientHistory.where(:patient_profile =>current_user.patient_profile)\n end\n end", "def all\n status_not_acceptable && return unless accept_header?\n\n patient = get_patient(params.permit(:id)[:id])\n\n status_forbidden && return if patient.nil?\n\n # Gather assessments and lab results\n assessments = patient.assessments || []\n laboratories = patient.laboratories || []\n all = [patient] + assessments.to_a + laboratories.to_a\n results = all.collect { |r| FHIR::Bundle::Entry.new(fullUrl: full_url_helper(r.as_fhir), resource: r.as_fhir) }\n\n # Construct bundle from monitoree and data\n bundle = FHIR::Bundle.new(\n id: SecureRandom.uuid,\n meta: FHIR::Meta.new(lastUpdated: DateTime.now.strftime('%FT%T%:z')),\n type: 'searchset',\n total: all.size,\n entry: results\n )\n\n status_ok(bundle) && return\n rescue StandardError\n render json: operation_outcome_fatal.to_json, status: :internal_server_error\n end", "def appointments\n Appointment.all.select {|appointment| appointment.patient == self}\n # Appointment.all.select {|appointment| appointment.doctor == self}\n end", "def index\n user = current_user\n if not current_user.admin\n lab_ids = []\n user.labs.each do |lab|\n lab_ids.push(lab.id)\n end\n if params[:result] == \"true\"\n patients = Patient.includes(:users_patients)\n .where('result = true and (users_patients.user_id = ? or lab_id IN (?))', user.id, lab_ids)\n .references(:users_patients)\n @patients = patients.order(:case_id).page(params[:page]).per(25)\n else\n patients = Patient.includes(:users_patients)\n .where('users_patients.user_id = ? or lab_id IN (?)', user.id, lab_ids)\n .references(:users_patients)\n @patients = patients.order(:case_id).page(params[:page]).per(25)\n end\n else\n if params[:result] == \"true\"\n @patients = Patient.where(result: true).order(:case_id).page(params[:page]).per(25)\n else\n @patients = Patient.order(:case_id).page(params[:page]).per(25)\n end\n end\n end", "def appointments \n Appointment.all.select do |a|\n a.patient == self\n end\nend", "def index\n @title = 'Enroller Dashboard'\n @possible_jurisdiction_paths = current_user.jurisdiction.subtree.pluck(:id, :path).to_h\n @all_assigned_users = current_user.patients.where.not(assigned_user: nil).pluck(:assigned_user).uniq.sort\n redirect_to(root_url) && return unless current_user.can_create_patient?\n end", "def signed_up_registrants\n registrants = []\n if event_category.present?\n registrants = event_category.signed_up_registrants\n end\n\n if competition.present?\n registrants = signed_up_competitors.map { |comp| comp.registrants }.flatten\n end\n\n registrants.select { |reg| registrant_passes_filters(reg) }\n end", "def set_patients\n @user = current_user\n end", "def any_registered(user)\n # juniors can't do anything, so it's all currently in registered adult\n end", "def get_patient(id)\n if has_role?(:enroller)\n enrolled_patients.find_by_id(id)\n elsif has_role?(:public_health)\n viewable_patients.find_by_id(id)\n elsif has_role?(:public_health_enroller)\n viewable_patients.find_by_id(id)\n elsif has_role?(:admin)\n nil\n end\n end", "def index\n if !user_signed_in?\n redirect_to new_user_session_url \n else \n @patients = Patient.where(:user_id => current_user.id).paginate(page: params[:page],per_page: 20)\n end\n end", "def findable_curriculum_vitaes\n if current_user.admin_access\n CurriculumVitae\n else\n current_user.curriculum_vitaes\n end\n end", "def index\n @conference_details = ConferenceDetail.where(user_id: current_user.id)\n end", "def profile\n \t\t@patient = Patient.all\n #@current_user = User.find(params[:id])\n end", "def call_list_patients(line)\n ordered_patients(line).reject { |x| recently_called_by_user? x }\n end", "def physicians\n physicians = User.physicians\n render json: { status: 200, data: physicians }\n end", "def show\n # The purpose of this block is to build two lists of trials, one being the\n # trials that a clinician manages, the other being trials that they are\n # just participating in. It removes duplicates from the watching list, if\n # they are in the managed list.\n managed = current_user.clinical_trials\n excludes = managed.pluck(:id)\n\n tcids = current_user.trial_clinicians.pluck(:clinical_trial_id)\n\n if tcids.empty?\n watching = []\n else\n watching = ClinicalTrial.where('id in (?)', tcids)\n if !excludes.empty?\n watching = watching.where('id not in (?)', excludes)\n end\n end\n\n @managed_list = managed\n @watching_list = watching\n end", "def users\n company_ids = [self.id]\n company_ids += advisor_company_ids if advised?\n\n user_ids = UserAffiliation.where(:company_id.in => company_ids).with_access.only(:user_id).map(&:user_id)\n User.where(:id.in => user_ids).order_by(created_at: :asc)\n end", "def index\n if user_signed_in?\n @recordatorios = current_user.recordatorios.all\n end\n end", "def show\n @user_list= []\n \n @customtable = CustomeTable.where(:identifier_id => @hackathon.id)\n @reguser = Registration.where(:hackathon_id => @hackathon.id)\n \n @reguser.each do |user| \n u = User.find(user.userId)\n @user_list.push(u.user_name)\n end\n end", "def diagnosis_name_list\n\t\t@diagnose = devise_current_user.diagnose.to_a.uniq {|diagnosis| diagnosis.name}\n\tend", "def index\n @appointments = Appointment.all\n @patient_appointments = Appointment.where(patient_id: current_patient.id)\n @specialties = Specialty.all\n end", "def index\n @patient = Patient.find(params[:patient_id])\n @prescriptions = Prescription.where(:patient_id => params[:patient_id]).where(:active => true)\n end", "def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n #binding.pry\n end\n end", "def can_access_patient?(patient_id)\n @authorized_user.patients.map { |patient| patient.id }.include?(patient_id.to_i)\n end", "def supervisor\n @supervisors = Allocation.all.order(created_at: :desc).where(student_id: current_student.id)\n end", "def index\n @diagnostic_helps = DiagnosticHelp.where(admin_user: current_user.admin_user)\n @patient = Patient.find(params[:patient_id])\n @clinic_history = ClinicHistory.find(params[:clinic_history_id])\n end", "def blood_oaths #<-- blood oath selects all cult members in bloodOath Class file\n BloodOath.all.select { |blood_oath| blood_oath.cult == self}\n end", "def index\n if @laboratory\n @appointments = @laboratory.appointments.where(user_id: @user.id)\n else\n @appointments = @user.appointments.all\n end\n end", "def search\n @doctors = Doctor.in_clinic(@admin).includes(:department)\n @doctors = @doctors.where(\n \"lower(last_name) = ?\", params[:doctors][:last_name].downcase).\n includes(:department) unless params[:doctors][:last_name].empty?\n @doctors = @doctors.where(\n \"lower(first_name) = ?\", params[:doctors][:first_name].downcase).\n includes(:department) unless params[:doctors][:first_name].empty?\n @doctors = @doctors.where(\n department: Department.where(\n \"lower(name) = ?\", params[:doctors][:department].downcase).\n in_clinic(@admin).first).includes(:department) unless\n params[:doctors][:department].empty?\n end" ]
[ "0.6718713", "0.6711171", "0.6654876", "0.66456383", "0.6594897", "0.6467883", "0.64512306", "0.63740176", "0.6357986", "0.63559896", "0.6330614", "0.6329396", "0.63286906", "0.6292245", "0.62911683", "0.6262743", "0.626208", "0.6252315", "0.6251028", "0.61814636", "0.616832", "0.6154216", "0.6150566", "0.6058437", "0.60517466", "0.6043087", "0.5997883", "0.59934974", "0.59791344", "0.5966313", "0.59397626", "0.58734995", "0.58734465", "0.5862605", "0.5857338", "0.58503324", "0.58287954", "0.58179766", "0.5799815", "0.5799078", "0.57894844", "0.5780062", "0.5778578", "0.5764558", "0.57481676", "0.5737428", "0.5733769", "0.5712294", "0.5712294", "0.5708808", "0.5704484", "0.5693041", "0.5690371", "0.5667171", "0.5665615", "0.5648727", "0.564664", "0.5644773", "0.5641484", "0.56389755", "0.5636473", "0.5633138", "0.56286585", "0.56205827", "0.56082016", "0.55991757", "0.5576497", "0.55703825", "0.5568402", "0.556491", "0.55460566", "0.5519659", "0.5515978", "0.55069464", "0.54978406", "0.5496709", "0.5486917", "0.5484708", "0.54828924", "0.5481854", "0.54579425", "0.5449395", "0.5441979", "0.54263955", "0.54174435", "0.5415952", "0.5389332", "0.53875554", "0.53867686", "0.5386381", "0.53838867", "0.53697336", "0.5368236", "0.5342032", "0.5339937", "0.531738", "0.5316374", "0.5314137", "0.5313415", "0.5313387" ]
0.7480559
0
Returns all under supervision Studies plus related Studies.
def related_studies _studies = [] under_supervision_studies.each do |study| unless _studies.include?(study) _studies.append(study) end end studies.each do |study| unless _studies.include?(study) _studies.append(study) end end return _studies end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @studies = current_user.available_studies\n end", "def list_studies\n act = StudyListAction.new(self)\n act.get\n end", "def index\n @studies = Study.all\n end", "def index\n @studies = Study.all\n end", "def search_studies\n @studies = Study.search(search_query, query_args)\n return {\n :recordsTotal => @studies.total_entries,\n :data => @studies.map{|s| study_result_to_json(s)},\n :aggs => @studies.aggs\n }\n end", "def index\n @thesis_supervisions = ThesisSupervision.all\n end", "def index\n @other_studies = @university.other_studies.page(params[:page])\n @studies = @other_studies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @other_studies }\n end\n end", "def students \n sk = Sektion.where(:teacher_id => self.id).map(&:id)\n sids = StudentRoster.where(:sektion_id => sk).map(&:student_id).uniq\n return Student.where(:id => sids)\n end", "def superwork_evidences\n find_related_frbr_objects( :is_evidence_of, :which_superworks?) \n end", "def index\n @program_of_studies = ProgramOfStudy.all\n end", "def index\n @study_sites = StudySite.all\n end", "def index\n #sample_ids.each {|x| @studies << Study.find_by_nct_id(x)}\n #@studies\n @studies=Study.completed_since(Date.today-100.days)\n #@studies=Study.sponsored_by('Duke')\n @definitions=Aact::DataDefinition.all\n #@studies=[Aact::Study.find_by_nct_id('NCT01132846')]\n #@studies=Study.all\n end", "def index\n @title = \"Studies\"\n\n respond_to do |format|\n format.html do\n @my_studies = Study.with_user(current_user.netid)\n end\n format.json do\n render :json => Study.with_user(current_user.netid).to_json\n end\n end\n end", "def index\n\tStudy.adjustThreshold\n @studies = Study.all\n end", "def index\n @employer_studies = @university.employer_studies.page(params[:page])\n @studies = @employer_studies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employer_studies }\n end\n end", "def query_sources(study)\n study_raw = {:errors => []}\n study_raw[:study] = query_study_source(study.irb_number)\n study_raw[:roles] = query_roles_source(study.irb_number)\n study_raw[:involvements] = {}\n if study.is_managed?\n study_raw[:involvements] = query_involvements_source(study.irb_number, study.managing_system)\n end\n\n # collecting our errors\n study_raw[:errors].concat(study_raw[:study][:errors])\n study_raw[:errors].concat(study_raw[:roles][:errors])\n study_raw[:errors].concat(study_raw[:involvements][:errors]) if study.is_managed?\n return study_raw\n end", "def index\n @studies = Study.where(active: true, public: true)\n @studies = @studies.reverse_each\n end", "def selectable_studies_mapped_to_investigation(current_study)\n studies = Study.authorized_for('edit').to_a\n studies << current_study if current_study && !current_study.can_edit?\n investigation_map = {}\n studies.each do |study|\n investigation_map[study.investigation] ||= []\n investigation_map[study.investigation] << study\n end\n investigation_map\n end", "def index\n s = User.find(session[:user_id])\n @studies= Study.where(:user_id => s.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @studies }\n end\n end", "def index\n @applicant_field_of_studies = current_applicant.applicant_field_of_studies.all\n end", "def students\n Rollcall::Student.find_all_by_school_id schools\n end", "def index\n @case_studies = CaseStudy.all\n end", "def scoped_collection\n\t\t\tStory.includes(:students)\n\t\tend", "def show\n @casestudies = Casestudy.all\n\n @q = Casestudy.ransack(params[:q])\n @casestudies = @q.result(distinct: true)\n end", "def index\n @sours = @swit.sours.all\n \n end", "def index\n @studies = Study.find_studies_with_details(current_user.superadmin? ? nil : current_user&.id)\n @study_statistics_by_id = Study.get_study_statistics(studies: @studies)\n authorize! :read, StudyCompletion\n end", "def index\n @study_sources = StudySource.all\n end", "def index\n @study_groups = StudyGroup.all\n end", "def external\n @plan_subjects = PlanSubject.find_unfinished_external_for(@user)\n @students = @plan_subjects.map {|ps| ps.study_plan.index.student}.uniq\n end", "def index\n @studies = Study.all\n #render json: @studies\n end", "def index\n puts \"Index method called...\"\n @studies = Study.all\n\n # render json: @studies\n end", "def students\n self.course_person.all(:type => \"student\").persons\n end", "def students\n @courses = Course.where(\"teacher_id=?\",session[:user].teacher_id)\n student_ids = Array.new\n @courses.each{ |c|\n student_ids.push(c.courseStudents)\n }\n student_ids.each{ |array|\n array.each{ |student|\n @students.push(student)\n }\n }\n @students.uniq!\n end", "def manage\n begin\n @studies = Study.where(user_id: session[:user_id])\n @studies = @studies.reverse_each\n end\n end", "def set_study\n @study = Study.find(params[:id])\n @datasets = @study.datasets\n end", "def index\n @studies = Study.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @studies }\n end\n end", "def students\n self.boating_tests.collect{|test| test.student} \n end", "def index\n @enrollment = Participantstudysite.new\n @participants = Participant.all\n @allstudy= Studysite.select(\"sites.name||'('||sites.location||')-'||studies.title||'('||studies.principal_investigator||')' as text,studysites.id as key\").joins(:site,:study)\n\n end", "def index\n @studytypes = Studytype.all\n end", "def index\n @bible_studies = BibleStudy.all\n end", "def index\n @subestations = Subestation.all\n end", "def student_voice_survey_insights\n insights = []\n\n # always add any q2 self reflection, if enabled\n if PerDistrict.new.include_q2_self_reflection_insights?\n insights += grades_reflection_insights()\n end\n\n # check for mid-year and take if it it's there\n mid_year_form = ImportedForm.latest_for_student_id(@student.id, ImportedForm::SHS_WHAT_I_WANT_MY_TEACHER_TO_KNOW_MID_YEAR)\n return insights + imported_form_insights(mid_year_form) if mid_year_form.present?\n\n # if not, include fall survey insights if there are any\n most_recent_fall_survey = StudentVoiceCompletedSurvey.most_recent_fall_student_voice_survey(@student.id)\n if most_recent_fall_survey.present?\n insights += profile_insights_from_survey(most_recent_fall_survey)\n end\n\n insights\n end", "def contests()\n\t\tself.as_contestants.collect{|c| c.contest }\n\tend", "def index\n @socioeconomic_studies = SocioeconomicStudy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socioeconomic_studies }\n end\n end", "def show\n study_id = params[:study_id]\n creator_id = params[:creator_id]\n @study = Study.find(:first, :conditions=>[\"id=?\",study_id], :include=>[:primary_publication, :primary_publication_numbers])\n @user_studies = Study.joins(:primary_publication).find(:all, :conditions=>[\"creator_id = ? and studies.id <> ? and project_id = ?\",creator_id, study_id, @study.project_id], :include=>[:primary_publication, :primary_publication_numbers], :order=>[\"title ASC\"])\n all_user_ids = UserProjectRole.find(:all, :conditions=>[\"project_id=? AND role IN (?)\", @study.project_id, [\"lead\",\"editor\"]], :select=>[\"user_id\"])\n @all_users = User.find(:all, :conditions=>[\"id IN (?)\", all_user_ids.collect{|x| x.user_id}], :order=>[\"login ASC\"])\n end", "def index\n @interesting_things = @student.interesting_things\n @other_interesting_things = Student.where.not(id: @student.id).map do|student|\n student.interesting_things[@student.id % Student.count] || student.interesting_things.sample\n end.compact\n end", "def search\n begin\n if params[:email] != \"\" && params[:study_name] != \"\"\n @header = \"Studies: #{params[:study_name]} by #{params[:email]}\"\n @studies = Study.where(originator: params[:email], name: params[:study_name], active: true, public: true)\n elsif params[:email] != \"\"\n @header = \"Studies: #{params[:email]}\"\n @studies = Study.where(originator: params[:email], active: true, public: true)\n elsif params[:study_name] != \"\"\n @header = \"Studies: #{params[:study_name]}\"\n @studies = Study.where(name: params[:study_name], active: true, public: true)\n else\n redirect_to(studies_path)\n return\n end\n @studies = @studies.reverse_each\n rescue\n redirect_to(studies_path)\n end\n end", "def get_students\n ret=[]\n self.get_class_schools.each do |classe|\n ret.concat classe.students\n end\n #puts \"========================== teacher.get_students: #{ret.count}\"\n ret\n end", "def index\n @study_files = StudyFile.all\n end", "def show_all_students\n Student.all\n end", "def index\n @suggetions = Suggetion.all\n end", "def get_interests\n\t\t@si = SocietyInterest.where(society_id: self.id)\n\t\t@interests = []\n\t\t@si.each do |s|\n\t\t\t@interests << Interest.find_by_id(s.interest_id)\n\t\tend\n\t\treturn @interests\n end", "def index\n @science_instances = ScienceInstance.all\n end", "def superwork_influences\n find_related_frbr_objects( :is_influenced_by, :which_superworks?) \n end", "def index\n @sciences = Science.all\n end", "def index\n @stu_has_deps = StuHasDep.all\n end", "def stig_findings(category=\"I\")\n\t\t\t\t\twhere('plugin_id IN (:plugins)', :plugins => Plugin.where(:stig_severity => category).select(:id)).order(\"severity DESC\")\n\t\t\t\tend", "def show\n @inform = @study.inform\n @all_cups_price = 0\n @inform.studies.each do |study|\n @all_cups_price += study.price * study.factor\n end\n end", "def for_archive(archive)\n self.archive_studies.find_by_archive_id(archive.id)\n end", "def index\n @saddnesses = Saddness.all\n end", "def set_study\n if Study.find_by(id: params[:id])&.type == Study::GENERAL_TYPE\n @study = Study.includes(:study_details).find_by(id: params[:id])\n else\n @study = Study.includes(study_details: :study_group_notifications).find_by(id: params[:id])\n end\n return if @study\n\n redirect_to(admin_dashboard_index_url, notice: 'Study does not exists')\n end", "def assigned_slogans\n Slogan.where(mission_id: mission_ids)\n end", "def index\n @spliffs = Spliff.all\n end", "def index\n @swit_sours = SwitSour.all\n end", "def index\n @stilages = Stilage.all\n end", "def index\n @stu_reg_semesters = StuRegSemester.all\n end", "def submission_preview\n # load a random study, or use selected study\n @studies = Study.where(public: true).pluck(:name, :id)\n end", "def index\n @stks = Stk.all\n end", "def grouped_options_for_study_selection(current_study)\n investigation_map = selectable_studies_mapped_to_investigation(current_study)\n investigation_map.compact!\n investigation_map.keys.collect do |investigation|\n if investigation.present?\n title = investigation.can_view? ? h(investigation.title) : \"#{t('investigation')} title is hidden\"\n [title, investigation_map[investigation].collect { |study| [h(study.title), study.id] }]\n end\n end\n end", "def index\n @page_title = \"Bible Studies\"\n @page_description = \"Browse Bible studies by recent, most popular and liked.\"\n @type = params[:type].try(:downcase)\n case @type\n when \"popular\"\n @studies = Study.popular.page(params[:page])\n when \"liked\"\n @studies = current_user ? current_user.get_voted(Study).page(params[:page]) : Kaminari.paginate_array([]).page(params[:page])\n when \"mine\"\n @studies = current_user ? Study.mine(current_user.id).page(params[:page]) : Kaminari.paginate_array([]).page(params[:page])\n else\n @studies = Study.recent.page(params[:page])\n end\n end", "def index\n @institutes = Institute.all.order('name asc')\n @collections = {}\n @institutes.each do |institute|\n @collections[institute.id] = institute.collections.select(&:published?)\n end\n\n @depositing_institutes = @institutes.select { |i| i.depositing == true }\n @other_institutes = @institutes.select { |i| i.depositing.blank? }\n end", "def collection\n apply_scopes(super).order(:date).includes{[person, shift.shift_group, shift.county]}.uniq\n end", "def index\n @studens = Studen.all\n end", "def index\n\t\t@students = Student.all.order(:created_at)\n\t\t@cohorts = Cohort.all\n\t\t\n\tend", "def index\n if logged_in?\n @user = current_user\n @situations = @user.situations.all\n @scores = @user.scores.all\n studying_switches_for_situations\n elsif\n @user = current_user\n redirect_to \"/situations\"\n else\n redirect_to \"/\"\n end\n end", "def index\n @ststus = Ststu.all\n end", "def get_surveys\n survey_types = SurveyType.all(:conditions=>[\"name != ?\", \"test\"])\n non_empty_survey_types = []\n survey_types.each do |survey_type|\n any_datasets = false\n survey_type.surveys.each do |survey|\n any_datasets = true unless survey.datasets.empty?\n end\n if any_datasets \n non_empty_survey_types << survey_type\n end\n end\n surveys = []\n non_empty_survey_types.each do |survey_type|\n survey_type.surveys.each do |survey|\n unless survey.datasets.empty? \n surveys << survey unless !Authorization.is_authorized?(\"show\", nil, survey, current_user)\n end\n end\n end\n return surveys\n end", "def index\n @seihinns = Seihinn.all\n end", "def related_clinics\n _clinics = []\n under_supervision_clinics.each do |c|\n unless _clinics.include?(c)\n _clinics.append(c)\n end\n end\n clinics.each do |c|\n unless _clinics.include?(c)\n _clinics.append(c)\n end\n end\n return _clinics\n end", "def students\n users.students\n end", "def index\n @students = Student.all\n @schooles = School.all\n end", "def stories\n project.stories_in_iteration(self)\n end", "def sis_only\n @works = Work.sis_only\n render :index\n end", "def all_site_details\r\n @nsc.sites\r\n end", "def index\n authorize HigherEducationInstitution\n @higher_education_institutions = HigherEducationInstitution.order(:name).search(params[:search]).page(params[:page])\n end", "def index\n @sabstracts = Sabstract.all\n end", "def index\n @student_parents = StudentParent.all\n end", "def students\n placements.collect{|p| p.person }.compact.uniq\n end", "def index\n @student_sites = StudentSite.all\n end", "def index\n @semesters = Semester.all\n end", "def index\n @semesters = Semester.all\n end", "def super\n @schools = School.all", "def create\n @participant = Participant.new(participant_params)\n @studysite = Studysite.where('id = ?', params[:sitestudy]) \n #@study = Study.where(:title => params[:studysite])\n #@allstudy= Studysite.includes(:sites,:studies)\n respond_to do |format|\n if @participant.save\n #@participant.studysites.build \n @participant.studysites << @studysite\n format.html { redirect_to @participant, notice: 'Participant was successfully created.' }\n format.json { render :show, status: :created, location: @participant }\n else\n set_studysite\n format.html { render :new }\n format.json { render json: @participant.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @unstructured_data = UnstructuredDatum.includes(:subcriterium).all\n end", "def get_students \n User.joins(learnables: {skill: {teachables: :user}}).where(\"users_users_skills.id = ? and users.id != ?\", id, id).distinct\n end", "def list_cohorts\n @students.each do |student_info|\n if (@cohorts.include? (student_info[:cohort])) == false\n @cohorts << student_info[:cohort]\n end\n end\nend", "def index\n @theses = Thesis.all\n \n end", "def get_exercises_list\n exercises_list = []\n inst_sections.each do |inst_section|\n exercises_ids = inst_section.inst_book_section_exercises.collect(&:inst_exercise_id).compact\n exercises_objs = InstExercise.where(id: exercises_ids)\n exercises_list.concat exercises_objs.collect(&:short_name)\n end\n return exercises_list\n end", "def better_seeds_query\n data = House.plants.includes(:seeds)\n all_seeds = []\n\n data.each do |plant|\n all_seeds.push(plant.seeds)\n end\n\n all_seeds\n\n end", "def index\n @diseasesubsets = Diseasesubset.all\n end" ]
[ "0.6606388", "0.6588492", "0.647142", "0.647142", "0.6366238", "0.61600095", "0.61304826", "0.6032676", "0.60041785", "0.5976543", "0.59527296", "0.58857405", "0.5883488", "0.5823642", "0.57641864", "0.5749698", "0.57420963", "0.57380223", "0.57028353", "0.569883", "0.56821656", "0.56791633", "0.5645853", "0.5614482", "0.5594631", "0.55732226", "0.5569627", "0.5568031", "0.55668247", "0.5563354", "0.5559762", "0.55387497", "0.5511959", "0.54945016", "0.5487016", "0.5474333", "0.54482013", "0.5441418", "0.54294807", "0.54141605", "0.5397571", "0.5379239", "0.53647304", "0.53591704", "0.5336079", "0.5332346", "0.52987206", "0.52740353", "0.52309966", "0.52191", "0.51673216", "0.5150887", "0.51472735", "0.5145099", "0.5139984", "0.51272804", "0.5124477", "0.51209015", "0.51176167", "0.5103984", "0.51025206", "0.510021", "0.509466", "0.50744313", "0.50720453", "0.5070934", "0.50633335", "0.50576055", "0.5055736", "0.50522274", "0.50512946", "0.5047221", "0.5041881", "0.5041344", "0.5039244", "0.5035013", "0.5031337", "0.5029095", "0.50218564", "0.50206906", "0.50141823", "0.5014056", "0.50128984", "0.50084764", "0.5000082", "0.49775258", "0.49736413", "0.49713024", "0.497121", "0.4970427", "0.4970427", "0.49662808", "0.49645036", "0.49633777", "0.495797", "0.49531487", "0.4947129", "0.49388194", "0.49378547", "0.49360186" ]
0.8671109
0
Returns true if User has at least one related Patient
def has_related_patient? if registrations.count > 0 return true end under_supervision_clinics.each do |clinic| clinic.registrations.each do |reg| return true end end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def patient_implicit?\n @authorized_user.patients.size == 1 \n end", "def recipe_belongs_to_user(user)\n if user.recipes.select {|s| s.users == users}.count > 0\n return true\n else\n return false\n end\n end", "def in_relationship?(user)\n return true if UserProject.where(user: user, project: self).first\n end", "def has_member? user_or_person\n user_or_person = user_or_person.try(:person) if user_or_person.is_a?(User)\n self.people.include? user_or_person\n end", "def is_referente?\n return (Convention.all(:conditions => {:user_id => self.id}).count > 0)\n end", "def belongs_to_user?(user)\n self.user == user\n end", "def belongs_to?(user)\n return nil if user.nil?\n\n owner == user\n end", "def is_member?(user)\n return true if user.id == self.created_by.id\n self.users.any? { |u| u.id == user.id }\n end", "def is_reservable?\n if self.is_a? Patient\n return false\n end\n true\n end", "def belongs_to?(user)\n return false unless user.instance_of? User\n return self.owner == user\n end", "def with_relationships?\n self.fields.any? { |field| field.is_relationship? }\n end", "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n people.include? user_or_person\n end", "def includes?(user)\n # is a directly associated User\n self.users.where(id: user.id).count.positive? ||\n # has a matching email address\n self.email_patterns.find{ |p| p.matches?(user.email) }.present? ||\n # belongs to an associated department\n self.departments.where(name: user.department&.name).count.positive? ||\n # is of an associated affiliation\n self.affiliations.where(id: user.affiliation_id).count.positive? ||\n # belongs to an associated AD group\n # (this check comes last because it is the most expensive)\n self.ad_groups.find{ |g| user.belongs_to_ad_group?(g) }.present?\n end", "def belongs_toUser?(user_id)\n if session[:user_id] == user_id\n return true\n else\n return false\n end\n end", "def check\n if unique_has_one_association?\n check_unique_has_one\n else\n check_remaining\n end\n end", "def has_one?\n true\n end", "def has_users?\n\t\tself.users.size > 0\n\tend", "def member?(trip)\n trip.users.include?(self)\n end", "def has_competitor?(user_id)\n get_relation(user_id).try(:started?)\n end", "def is_customer?\n if self.is_a? Patient\n return true\n end\n false\n end", "def has_user?\n !user.nil?\n end", "def has_user?(user)\n self.users.include?(user)\n end", "def belongs_to?(target_user)\n user == target_user\n end", "def user_is_associated_with_project\n return if user_id.nil? || project_id.nil? ||\n user.projects.exists?(id: project.id)\n errors.add(:user_id, 'is not associated with this Project')\n end", "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n current_people.include? user_or_person\n end", "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n current_people.include? user_or_person\n end", "def can_access_patient?(patient_id)\n @authorized_user.patients.map { |patient| patient.id }.include?(patient_id.to_i)\n end", "def belongs_to_user?(test_user)\n user && user.id == test_user.id\n end", "def must_belong_to_user_type\n if user_type_class.where(user_id: self.id).empty?\n errors.add(:base, \"User Type object not created: #{user_type_class.to_s}\")\n return false\n end\n\n return true\n end", "def has_any_model_relationship?\n !model_relationship.eql?(NONE)\n end", "def permisos?(id)\n if DeviceUser.where(id_user: id.to_s, id_dispositivo: self.id.to_s).count > 0\n\n return true\n end\n\n return false\n\n end", "def is_a_patient?\n ((!self.role.blank?) && (self.role == self.class::PATIENT))\n end", "def belongs_to_user(logged_user_id)\n if self.property_id != 0\n if self.property.belongs_to_user(logged_user_id)\n return true\n else\n return false\n end\n elsif self.renter_id != 0\n if self.renter.belongs_to_user(logged_user_id)\n return true\n else\n return false\n end\n end\n end", "def activity_relations?(*args)\n activity_relations(*args).any?\n end", "def related?(user)\n [from_user_id, to_user_id].include?(user&.id)\n end", "def associated?(participant) \n (not participant.nil?) and participant_ids.include?(participant.id)\n end", "def has_persona_in? room\n p = room.personas.find_by(account_id: self.id)\n !p.nil? # true when has persona, false when no persona\n end", "def has_user_permission?(object)\n object and object.user and current_user and object.user == current_user\n end", "def owned?\n user.present?\n end", "def valid?\n return false if @principals.nil?\n return false if @relation.nil?\n true\n end", "def belongs_to?\n not property? and not multiple?\n end", "def member_of?(context)\n context.users.include? self\n end", "def occupied?\n !patient.nil?\n end", "def is_associated?\n itinerary = self.selected_itinerary\n if itinerary.nil?\n return false\n end\n\n service = itinerary.service\n if service.nil?\n return false\n end\n\n return service.is_associated_with_user? self.trip.user\n\n end", "def ensure_not_referenced_by_any_user\n if users.empty?\n return true\n else\n errors.add(:base, 'Courses present')\n return false\n end\n end", "def can_edit_patient(patient_id)\n patient = Patient.find(patient_id)\n if patient \n patient.registrations.each do | registration | \n if registration.clinic.supervisor == self || registration.user == self\n return true\n end\n end\n end\n return false\n end", "def user_exists?(user)\n User.find(user.id) != nil && (participants.where(user_id: user.id).count > 0 || user == super_admin)\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 multiple_associations?\n associations.any? { |col,assocs| assocs.length > 1 }\n end", "def child_or_classroom_assigned?\n current_user.has_child_or_classroom_assigned?\n end", "def associated?\n @associated\n end", "def user?(user)\n user.id == self.user_id if user\n end", "def has_pet?\n current_user_pet && current_user_pet != nil\n end", "def user?(user)\n self.user_id == user.id if user\n end", "def user?(user)\n self.user_id == user.id if user\n end", "def user?(user)\n self.user_id == user.id if user\n end", "def is_a_member?(user_id)\n return true if user_id && self.user_id == user_id\n return user_id && Note_User.first(:user_id => user_id, :note_id => self.id )\n end", "def show?\n if (@record.user_id == @user.id) || user.faculty?\n return true\n else\n return false\n end\n end", "def belongs_to?(group)\n group.all_users.include? self\n end", "def belongs_to?(group)\n group.all_users.include? self\n end", "def belongs_to?(group)\n group.all_users.include? self\n end", "def only_one_primary_by_user\n\n\t\treturn true if self.user.nil?\n\t\tnumber_of_primary_email_of_the_user = self.user.email_source_accounts.where(primary: true).count\n\t\tif number_of_primary_email_of_the_user > 0 && self.primary\n\t\t\t#errors.add(\"You can't add more than one primary email_source_account by user\")\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend", "def can_be_created_by?(user)\n \n not (user.usergroups & usergroups).empty?\n\n end", "def attended?(user)\n self.attendees.include?(user)\n # self.users.map{|user| user.id }.include?(user_id)\n end", "def has_owner(user)\n return self.user.id==user.id\n end", "def valid?\n @valid ||= begin \n relation.exists?\n true # set valid to true, if relation.exists?(model) does not throw any exception\n rescue\n false\n end\n end", "def has_associations?\n (!self.pulves.empty? ||\n !self.labours.empty? || \n !self.factures.empty? || \n !self.ventes.empty?)\n end", "def only_one_responsible?\n responsibles.count == 1\n end", "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "def connected_with?(user)\n find_any_friendship_with(user).present?\n end", "def has_social_and_not_persisted\n !self.social_sessions.empty? && self.id.nil?\n end", "def actuale? opt = \"\"\n relation = opt.to_s.tableize\n\n actuale = false\n model.dependent_relations.each do |dependent_relation|\n tmp = self.send dependent_relation\n if relation == dependent_relation\n actuale ||= tmp.all.size > 1\n else\n actuale ||= tmp.exists?\n end\n end\n actuale\n end", "def used?\n !InterviewerUser.joins(:candidates_interviews).where(:interviewer_users => {:interviewer_id => id}).empty?\n end", "def test_has_many_patients\r\n responsible_party_patient_count = @responsible_party.patients.count\r\n patient_count = Patient.count\r\n assert_not_equal(0, responsible_party_patient_count, \"No Patient's found for this ResponsibleParty.\")\r\n end", "def has_one_valid?(relation)\n relation = klass.reflect_on_association(relation)\n\n return true if relation[:relation] ==\n ::Mongoid::Relations::Referenced::One\n\n invalid_relation(\n ::Mongoid::Relations::Referenced::One, relation[:relation]\n )\n end", "def has_data?\n @has_data ||= relation.count() > 0\n end", "def is_friend?(user)\n friendship = Friendship.find_by(user_id: self.id, friend_id: user.id)\n friendship.present?\n end", "def owner?(user)\n\t\tuser.id == self.user.id\n\tend", "def has_permission_with?(user)\r\n\t\t\treturn user.has_permission?(privacy_owner, self.class.privacy_rule_name, privacy_object_id)\r\n\t\tend", "def can_notify? user\n return false if self.id == user.id\n not notification_exists? user\n end", "def user_id_exists\n begin\n User.find(self.user_id)\n rescue ActiveRecord::RecordNotFound\n errors.add(:user_id, \"user_id foreign key must exist\")\n false\n end\n end", "def registration_owned?\n if current_user\n current_user == Registration.find_by(id: params[:id]).user\n end\n end", "def user?(user)\n users.include? user\n end", "def owned_by?(u)\n self.user == u\n end", "def at_least_one? association\n errors.add(:base, \"must add at least one #{association}\") if association.blank?\n end", "def owner?\n record.id == user.id\n end", "def create?\n @user != nil\n end", "def ensure_not_referenced_by_any_group\n if users.empty?\n return true\n else\n errors.add(:base, 'users present')\n return false\n end\n end", "def is_relationship?\n %w(belongs_to has_many many_to_many).include?(self.type.to_s)\n end", "def belongs_to_current_profile_user?\n !!(@current_user.id == @user.id)\n end", "def belongs_to_current_profile_user?\n !!(@current_user.id == @user.id)\n end", "def following?(user)\n\tself.followed_users.exists?(user.id)\nend", "def can_access user\n return self.users.include? user\n end", "def belongs_to?\n true\n end", "def member?(user_id, meetup_id)\n Attendance.where(user_id: user_id, meetup_id: meetup_id).empty?\nend", "def connected_with?(user)\n find_any_friendship_with(user).present?\n end", "def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end", "def resolved?\n\t\t!self.user_id.nil?\n\tend" ]
[ "0.7036032", "0.6339519", "0.6283754", "0.62703687", "0.62432325", "0.62104934", "0.61614543", "0.6143775", "0.6142951", "0.61388975", "0.6086811", "0.6022274", "0.5994241", "0.59829044", "0.5973832", "0.59705424", "0.5957213", "0.5952646", "0.5923433", "0.5915635", "0.59142864", "0.5914099", "0.59024435", "0.5864868", "0.58391404", "0.58391404", "0.58287865", "0.58230096", "0.5816612", "0.5813175", "0.5802701", "0.5784821", "0.5777025", "0.5768697", "0.57662505", "0.57532936", "0.5752801", "0.5749028", "0.57482976", "0.5744134", "0.5741779", "0.5725638", "0.5724213", "0.57229227", "0.57143027", "0.57107323", "0.5700554", "0.5697018", "0.5697018", "0.5692895", "0.56838685", "0.5672719", "0.5672137", "0.5669909", "0.56587994", "0.56587994", "0.56587994", "0.5658571", "0.56568104", "0.56544745", "0.56544745", "0.56538796", "0.56535095", "0.5637716", "0.563356", "0.562047", "0.56098884", "0.560659", "0.5604118", "0.5597891", "0.5597891", "0.5595082", "0.5594181", "0.5586955", "0.55798715", "0.55755645", "0.5569273", "0.5562016", "0.5559737", "0.5557524", "0.5550552", "0.55499035", "0.5548712", "0.5545321", "0.5544833", "0.5543504", "0.55406755", "0.55355793", "0.5535285", "0.5532338", "0.5524824", "0.5520975", "0.5520975", "0.5519227", "0.55120754", "0.5508862", "0.5499948", "0.5498616", "0.5496519", "0.5494414" ]
0.6925893
1
Returns true if User has at least one related Clinic
def has_related_clinics? if under_supervision_clinics.count > 0 || clinics.count > 0 return true end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def in_relationship?(user)\n return true if UserProject.where(user: user, project: self).first\n end", "def recipe_belongs_to_user(user)\n if user.recipes.select {|s| s.users == users}.count > 0\n return true\n else\n return false\n end\n end", "def has_competitor?(user_id)\n get_relation(user_id).try(:started?)\n end", "def candy_belongs_to_user(current_user)\n if self.shop.user_id == current_user.id\n return true\n else\n return false\n end\n end", "def belongs_to_user?(user)\n self.user == user\n end", "def is_referente?\n return (Convention.all(:conditions => {:user_id => self.id}).count > 0)\n end", "def has_related_patient?\n if registrations.count > 0\n return true\n end\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n return true\n end\n end\n return false\n end", "def is_associated?\n itinerary = self.selected_itinerary\n if itinerary.nil?\n return false\n end\n\n service = itinerary.service\n if service.nil?\n return false\n end\n\n return service.is_associated_with_user? self.trip.user\n\n end", "def belongs_to_user?(test_user)\n user && user.id == test_user.id\n end", "def has_category?(user)\n has = HasCategory.where(users_id: user.id, categories_id: self[:id]).take\n return (has != nil)\n end", "def relational?\n ancestors.include?(Relational)\n end", "def ensure_not_referenced_by_any_user\n if users.empty?\n return true\n else\n errors.add(:base, 'Courses present')\n return false\n end\n end", "def belongs_to?(user)\n return nil if user.nil?\n\n owner == user\n end", "def belongs_to?(user)\n return false unless user.instance_of? User\n return self.owner == user\n end", "def belongs_to?(target_user)\n user == target_user\n end", "def is_relationship?\n %w(belongs_to has_many many_to_many).include?(self.type.to_s)\n end", "def has_associated\n self.portfolio && self.design && self.plan\n end", "def with_relationships?\n self.fields.any? { |field| field.is_relationship? }\n end", "def belongs_to?\n not property? and not multiple?\n end", "def includes?(user)\n # is a directly associated User\n self.users.where(id: user.id).count.positive? ||\n # has a matching email address\n self.email_patterns.find{ |p| p.matches?(user.email) }.present? ||\n # belongs to an associated department\n self.departments.where(name: user.department&.name).count.positive? ||\n # is of an associated affiliation\n self.affiliations.where(id: user.affiliation_id).count.positive? ||\n # belongs to an associated AD group\n # (this check comes last because it is the most expensive)\n self.ad_groups.find{ |g| user.belongs_to_ad_group?(g) }.present?\n end", "def has_classmates?\n belongs_to_classroom? ? !classroom.students.empty? : nil\n end", "def belongs_to_current_profile_user?\n !!(@current_user.id == @user.id)\n end", "def belongs_to_current_profile_user?\n !!(@current_user.id == @user.id)\n end", "def belongs_toUser?(user_id)\n if session[:user_id] == user_id\n return true\n else\n return false\n end\n end", "def objected?\n objections.any?\n end", "def belongs_to?(group)\n group.all_users.include? self\n end", "def belongs_to?(group)\n group.all_users.include? self\n end", "def belongs_to?(group)\n group.all_users.include? self\n end", "def belongs_to?\n true\n end", "def user_is_associated_with_project\n return if user_id.nil? || project_id.nil? ||\n user.projects.exists?(id: project.id)\n errors.add(:user_id, 'is not associated with this Project')\n end", "def must_belong_to_user_type\n if user_type_class.where(user_id: self.id).empty?\n errors.add(:base, \"User Type object not created: #{user_type_class.to_s}\")\n return false\n end\n\n return true\n end", "def collaborate?\n record.private? && (record.user_id == user.id || user.admin?)\n end", "def valid?\n return false if @principals.nil?\n return false if @relation.nil?\n true\n end", "def owns?(what)\n if what.respond_to?(:user_ids)\n return what.user_ids.include?(self.id)\n elsif what.respond_to?(:user_id)\n return what.user_id == self.id\n end\n return self.is_cesia?\n end", "def check\n if unique_has_one_association?\n check_unique_has_one\n else\n check_remaining\n end\n end", "def has_carnivore?\n @carnivores.count > 0\n end", "def has_company?\n if self.group && self.group.company\n true\n else\n false\n end\n end", "def associated?\n @associated\n end", "def belongs_to_user(logged_user_id)\n if self.property_id != 0\n if self.property.belongs_to_user(logged_user_id)\n return true\n else\n return false\n end\n elsif self.renter_id != 0\n if self.renter.belongs_to_user(logged_user_id)\n return true\n else\n return false\n end\n end\n end", "def belongs_to_user(user)\n user.account.id == self.account_id\n end", "def related?\n self.rel == \"related\"\n end", "def has_user?(user)\n self.users.include?(user)\n end", "def actuale? opt = \"\"\n relation = opt.to_s.tableize\n\n actuale = false\n model.dependent_relations.each do |dependent_relation|\n tmp = self.send dependent_relation\n if relation == dependent_relation\n actuale ||= tmp.all.size > 1\n else\n actuale ||= tmp.exists?\n end\n end\n actuale\n end", "def can_access user\n return self.users.include? user\n end", "def requested_through_parents?\n (@parents.blank?) ? false : true\n end", "def has_collaborator(user, record)\n record.collaborators.exists?(email: user.email)\n end", "def member_of?(context)\n context.users.include? self\n end", "def connected_with?(user)\n find_any_friendship_with(user).present?\n end", "def cfo_as_treasurer?\n current_user.cfo? && User.treasurer.first.try(:id).blank?\n end", "def has_one?\n true\n end", "def composite?\n relation.is_a?(Relation::Composite)\n end", "def association?(object, associations); end", "def has_associations?\n (!self.pulves.empty? ||\n !self.labours.empty? || \n !self.factures.empty? || \n !self.ventes.empty?)\n end", "def related?(user)\n [from_user_id, to_user_id].include?(user&.id)\n end", "def participa?(otro_user)\n cousers.include?(otro_user)\n end", "def belongs_to?\n\n !!belongs_to_config\n\n end", "def has_autorisation_icarien?(duser)\n drequest = {\n where: {user_id: duser[:id], raison: 'ICARIEN ACTIF'}\n }\n table_autorisations_online.count(drequest) > 0\n end", "def charities_exist\n exists = false\n User.all.each do |r|\n if User.is_charity(r.id)\n exists = true\n break\n end\n end\n exists\n end", "def child_or_classroom_assigned?\n current_user.has_child_or_classroom_assigned?\n end", "def connected_with?(user)\n find_any_friendship_with(user).present?\n end", "def has_user?\n !user.nil?\n end", "def has_been_acquired_by_user?(user)\n current_user_profile = Profile.find_by(user_id: user.id)\n addition = Addition.find_by(profile_id: current_user_profile, story_id: self.id)\n addition != nil\n end", "def reviews?(resource)\n project = resource.projects.hidden.first\n project && project.collaborators.exists?(id)\n end", "def coach?\n students.any?\n end", "def is_or_belongs_to?(arg)\n if arg.is_a?(User)\n self == arg\n elsif arg.is_a?(Group)\n arg.users.include?(self)\n else\n false\n end\n end", "def preconditions\n %i[\n has_one\n has_many\n ].include?(association.macro) && association.through_reflection.nil? && association.klass\n rescue StandardError\n false\n end", "def conditions_met?(object, associations); end", "def is_belongs_to? user\n \tPost.find_by(user_id: user.id, id: id)\n \t# Post.find_by(user_id: user.id, id: self.id) both are same, it's just that self is not required, rails is smart!\n end", "def member?(trip)\n trip.users.include?(self)\n end", "def request_sent?(_user_id)\n pending_user_relationships.where(user_id: _user_id).any?\n end", "def advised?\n advisor_company_affiliations.with_access.present?\n end", "def validic_user_provisioned?\n return (!self.validic_id.nil? && !self.validic_access_token.nil?)\n end", "def show?\n @user.has_role?(:admin) || @record.course.user_id == @user.id || @record.course.bought(@user) == false\n end", "def has_any_model_relationship?\n !model_relationship.eql?(NONE)\n end", "def multiple_associations?\n associations.any? { |col,assocs| assocs.length > 1 }\n end", "def has_many?\n @macro == :belongs_to\n end", "def is_owned\n !!(\n @training &&\n @training.id &&\n (\n @is_admin_logged_in || (@current_user && (@training.user_id == @current_user.id))\n )\n )\n end", "def primary_restaurant?\n primary_employment.present? && primary_employment.restaurant.present?\n end", "def parents_readable_by?(user, parents)\n return false if parents.blank?\n parents = [parents] if !parents.is_a?(Array)\n parents.find_all{ |parent| parent.readable_by?(user) }.size > 0\n end", "def belongs_to_college(college_id)\n self.course_selections.joins(:course).where('courses.college_id=?', college_id).any?\n end", "def used?\n !InterviewerUser.joins(:candidates_interviews).where(:interviewer_users => {:interviewer_id => id}).empty?\n end", "def coupons?\n coupons.any?\n end", "def university_pending?\n university && line_items_pending_any?\n end", "def preconditions\n %i[\n has_one\n has_many\n ].include?(association.macro) && association.through_reflection.nil? && association.klass\n rescue NameError\n false\n end", "def contains_relations?\n resource_handler.resource_relations.present?\n end", "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "def subscribed_by?(user)\n subscriptions.where(user: user).any?\n end", "def ensure_not_referenced_by_any_course\n if courses.empty?\n return true\n else\n errors.add(:base, 'Courses present')\n return false\n end\n end", "def conditions_satisfied_by?(course_user)\n conditions.all? { |condition| condition.satisfied_by?(course_user) }\n end", "def has_course?(course)\n self.courses.include?(course)\n end", "def has_course?(course)\n self.courses.include?(course)\n end", "def exist?\n Neo4j::Relationship.exist?(self)\n end", "def reviewed_school?(user)\n self.reviews.exists?(user: user)\n end", "def championship_associate?\n return false unless associations?\n\n @championship_associate ||= @associations.key?(:championship)\n end", "def is_network_admin_for_user? user\n UserNetwork.where(:network_id => user.networks.collect(&:id), :user_id => self.id, :administrator => true).size > 0\n end", "def owned?\n user.present?\n end", "def has_memberships?\n how_many_memberships? > 0\n end", "def client?\n roles.count == 1 && has_role?('client')\n end", "def shared?(resource)\n collaborators = Account.find_by_sql(<<-EOS\n select distinct on (a.id)\n a.id as id, a.organization_id as organization_id, a.role as role\n from accounts as a\n inner join collaborations as c1\n on c1.account_id = a.id\n inner join collaborations as c2\n on c2.account_id = #{id} and c2.project_id = c1.project_id\n inner join projects as p\n on p.id = c1.project_id and p.hidden = false\n inner join project_memberships as pm\n on pm.project_id = c1.project_id and pm.document_id = #{resource.document_id}\n where a.id != #{id}\n EOS\n )\n collaborators.any? {|account| account.owns_or_collaborates?(resource) }\n end", "def is_owned_by_user?(user)\n self.user == user\n end" ]
[ "0.67243934", "0.6620375", "0.6517182", "0.63059944", "0.6282876", "0.6255948", "0.62288344", "0.6199234", "0.6159448", "0.61420673", "0.6131008", "0.6104984", "0.6049592", "0.6048655", "0.60464734", "0.6042106", "0.6022729", "0.60218203", "0.60066277", "0.59614027", "0.59469175", "0.5944827", "0.5944827", "0.5929069", "0.5890366", "0.58809346", "0.58809346", "0.58798826", "0.5872145", "0.5857761", "0.58362406", "0.5815089", "0.5813095", "0.5801349", "0.5793065", "0.5769267", "0.5763837", "0.57496125", "0.57419413", "0.5738518", "0.572264", "0.5711238", "0.5698707", "0.56954324", "0.56540906", "0.56391966", "0.5637204", "0.56285495", "0.5627136", "0.5623229", "0.56194806", "0.5616953", "0.56146824", "0.5614135", "0.56101197", "0.55999523", "0.5573189", "0.55728084", "0.55691993", "0.5559709", "0.5546288", "0.55455977", "0.55448776", "0.5544098", "0.55440676", "0.5543719", "0.5541606", "0.5537916", "0.55292606", "0.55282485", "0.5523851", "0.55189455", "0.5512233", "0.5508023", "0.5507823", "0.54974955", "0.5493763", "0.549308", "0.5490878", "0.5488004", "0.5482305", "0.5473382", "0.5468201", "0.5467321", "0.54638684", "0.5462097", "0.5462097", "0.5461328", "0.54607576", "0.5442045", "0.5442045", "0.5441348", "0.543824", "0.5434183", "0.5433157", "0.54321766", "0.5426992", "0.5418129", "0.5411806", "0.5408279" ]
0.7263277
0
Returns true if User is a supervisor of at least one Clinic
def is_supervisor? not under_supervision_clinics.empty? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def superuser?\n member_of_group?(\"Superusers\")\n end", "def super_user? \n current_user.role.role == \"Super\" \n end", "def validate_supervisor\r\n return false unless @current_user.is_supervisor?\r\n expense = Expense.find(params[:id]) rescue nil\r\n return false if expense.blank?\r\n expense.user.supervisor_id == @current_user.id || expense.project.supervisor_id == @current_user.id\r\n end", "def has_related_clinics?\n if under_supervision_clinics.count > 0 || clinics.count > 0\n return true\n end\n return false\n end", "def is_user?(_user)\n teacher = _user.class == User ? _user.portal_teacher : _user\n teachers.include? teacher\n end", "def supervisor?(area)\n self.student? and return false\n self.area_ids.include?(area.id) \n end", "def is_super?\n current_teacher && current_teacher.id == 1\n end", "def is_superuser?(*args)\n\t\t\tself.role_names.include?('superuser')\n\t\tend", "def is_superuser?(*args)\n\t\tself.role_names.include?('superuser')\n\tend", "def is_approver?(user)\n\n self.users.include?(user)\n\n end", "def superuser?\n env && env.key?(\"warden\") && env[\"warden\"].authenticate?(scope: :superuser)\n end", "def is_an_lcr_designer?\n designer = self.roles.detect { |r| r.name == 'Designer'}\n designer && !self.employee?\n end", "def validate_supervisor_or_admin \r\n return validate_supervisor if @current_user.is_supervisor?\r\n return @current_user.is_administrator?\r\n end", "def is_super_user?\n @super_user\n end", "def traveler?\n !admin_or_staff? && !superuser?\n end", "def is_super?\n state = false\n roles.each do |role|\n state = true if role.name.eql?(ENV['SUPER_N'] || ENV['SUPER_C']) && user_roles.find_by(role_id: role.id, active: true)\n end\n state\n end", "def is_profesor?\n self.role.name.eql?(Role::PROFESOR)\n end", "def is_rollcall_nurse?\n has_role?(:nurse, 'rollcall')\n end", "def admin? ; user.instance_of? User and user.role >= 2 ; end", "def senior_member?\n\t\tsenior != true\n\tend", "def teacher_is_super( teacher)\n teacher == Teacher.first\n end", "def average_roles_has_super_user?\n return self.roles_as(:identifiers).include?(AverageRoles.configuration.super_user) unless AverageRoles.configuration.super_user == nil\n return false\n end", "def has_competitor?(user_id)\n get_relation(user_id).try(:started?)\n end", "def advisor?\n self.role == \"advisor\"\n end", "def has_collaborator(user, record)\n record.collaborators.exists?(email: user.email)\n end", "def child_or_classroom_assigned?\n current_user.has_child_or_classroom_assigned?\n end", "def superadmin?\n current_user.has_role? :superadmin\n end", "def collaborate?\n record.private? && (record.user_id == user.id || user.admin?)\n end", "def readable_by?(user)\n return true if user.has_role?(:admin, resource.unit)\n return true if user.has_role?(:wizard, resource.unit)\n user == resource\n end", "def is_inviter?(user)\n membership_status(user) == StudentMembership::STATUSES[:inviter]\n end", "def employs?(user)\n employees.include?(user) or (affiliate == user) or user.admin?\n end", "def visa_required?\n user.visa_required? && schengen?\n end", "def curator?\n role == 'superuser' || role == 'curator' || role == 'tenant_curator'\n end", "def is_superuser?\n superuser? && supermode?\n end", "def staff?\n has_role? :staff, :any\n end", "def can_edit_user?(user)\n if self.has_role?('superuser')\n return true\n elsif !self.has_role?('admin')\n return false\n end\n return !(user.has_role?('superuser') || user.has_role?('admin'))\n end", "def partner_staff?\n staff? && agencies.any? { |a| a.partner? }\n end", "def super_admin?\n self.role == \"Super Admin\"\n end", "def user?\n has_role? :user\n end", "def superuser?(user, opts={})\n unh = self._user_and_host(user, opts[:host])\n row = self.user?(user, opts)\n return false unless row\n return row['Super_priv'] == 'Y'\n end", "def authorized_to_act_as_superuser?\n member_of? Ddr::Auth.superuser_group\n end", "def super_user?\n super_user\n end", "def participa?(otro_user)\n cousers.include?(otro_user)\n end", "def super_admin?\n self.role.role_name == \"super_admin\"\n end", "def customer?\n role?(UserRoles::CUSTOMER)\n end", "def user_exists?(user)\n User.find(user.id) != nil && (participants.where(user_id: user.id).count > 0 || user == super_admin)\n end", "def user_is_customer?\n (user_signed_in? && current_user.is_customer?)\n end", "def super_admin?\n #logged_in? && current_user.has_role?('super_admin')\n logged_in? && (current_user.roles.map{|role| role.name}).include?('super_admin')\n end", "def superadmin?\n\t\trole == \"superadmin\"\n\tend", "def belongs_to_user?(user)\n self.user == user\n end", "def edited_with_inheritance_by?(user)\n return true if editors.include?(user)\n return true if teachable&.lecture&.editors&.include?(user)\n return true if teachable&.lecture&.teacher == user\n return true if teachable&.course&.editors&.include?(user)\n false\n end", "def can_view_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def staff_member?\n admin? || staff?\n end", "def can_edit_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def super?\n logged_in? && current_user.super\n end", "def staff?\n if self.role and self.role < 4 \n true\n end\n end", "def supervisor_check?(user_id)\n db_params = {\n host: ENV['host'],\n port: ENV['port'],\n dbname: ENV['dbname'],\n user: ENV['user'],\n password: ENV['password']\n }\n db = PG::Connection.new(db_params)\n supervisors = db.exec(\"SELECT supervisor FROM supervisor\").values\n alt_supervisors = db.exec(\"SELECT alt_supervisor FROM supervisor\").values\n supervisor_list = supervisors.flatten\n alt_supervisor_list = alt_supervisors.flatten\n db.close\n if supervisor_list.include?(user_id) || alt_supervisor_list.include?(user_id)\n true\n else\n false\n end\nend", "def staff?\n self.role.role_type == \"staff\"\n end", "def visible_to? a_user\n a_user.participating_programs.include? program\n end", "def client?\n roles.count == 1 && has_role?('client')\n end", "def is_self_auditor?(user)\n (self.design.designer_id == user.id ||\n self.audit_teammates.detect { |t| t.user_id == user.id && t.self? })\n end", "def may_interview?(*args)\n\t\t\t(self.role_names & \n\t\t\t\t['superuser','administrator','editor','interviewer']\n\t\t\t).length > 0\n\t\tend", "def is_superadmin\n user = UserAdmin.find_by_user_id(current_user.id)\n if user and user.level == 3\n return true || false\n end\n end", "def attended?(user)\n self.attendees.include?(user)\n # self.users.map{|user| user.id }.include?(user_id)\n end", "def can_create_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def member_of?(context)\n context.users.include? self\n end", "def creatable_by?(user)\n user.administrator?\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 customer?\n self.role.role_type == \"customer\"\n end", "def student?\n return logged_in? && (current_user.class == Student)\n end", "def user_conforms?(user)\n @rule.call(user)\n end", "def show?\n @user.has_role?(:admin) || @record.course.user_id == @user.id || @record.course.bought(@user) == false\n end", "def is_student?\n self.role==\"student\"\n end", "def list_users?\n user.present? && user.admin?\n end", "def parents_readable_by?(user, parents)\n return false if parents.blank?\n parents = [parents] if !parents.is_a?(Array)\n parents.find_all{ |parent| parent.readable_by?(user) }.size > 0\n end", "def has_autorisation_icarien?(duser)\n drequest = {\n where: {user_id: duser[:id], raison: 'ICARIEN ACTIF'}\n }\n table_autorisations_online.count(drequest) > 0\n end", "def has_user?(user)\n self.users.include?(user)\n end", "def _accessible_through_family? user, edit_or_view\n descendent_access, sibling_access, nephew_access =\n if edit_or_view == :edit\n [user.can_edit_descendents_resources, user.can_edit_siblings_resources || user.manager?, user.can_edit_nephews_resources]\n else\n [user.can_view_descendents_resources, user.can_view_siblings_resources || user.manager?, user.can_view_nephews_resources]\n end\n # check permission to access siblings' stuff\n return true if sibling_access and self.agent.parent_id == user.parent_id\n # check permission to access descendents' stuff\n return true if descendent_access and self.agent.descendent?(user)\n # check permission to access nephews' stuff\n return true if nephew_access and self.agent.parent_id != user.parent_id and self.agent.descendent?(user.parent)\n # default return\n false\n end", "def fine_grain_discipline_requirements_present?(discipline)\n (request_staffs.detect{|rs| rs.discipline == discipline and rs.visit_type == nil} and\n request_staffs.detect{|rs| rs.discipline == discipline and rs.visit_type}) ? true : false\n end", "def external?\n return true unless person\n (person.is_a?(Volunteer) || person.is_a?(Student)) ? true : false\n end", "def verify_super_admin(user)\n if user.role.blank? || user.role.nome != \"SuperAdmin\"\n return true\n end\n\n if current_user.role.nome == \"SuperAdmin\"\n return true\n end\n\n return false\n end", "def is_staff\n if current_user.role < 4\n return true || false\n end\n end", "def has_access?(user)\n return false if user.nil?\n self.user == user || user.is_admin?\n end", "def student?\n if self.role and self.role == 4 \n true\n end\n end", "def is_super_admin?\n user_type == 'super_admin'\n end", "def student?\n self.role == \"student\"\n end", "def readable?(user)\n confirmed? || self == user\n end", "def is_customer?\n if self.is_a? Patient\n return true\n end\n false\n end", "def recipe_belongs_to_user(user)\n if user.recipes.select {|s| s.users == users}.count > 0\n return true\n else\n return false\n end\n end", "def member?(trip)\n trip.users.include?(self)\n end", "def is_rollcall_health_officer?\n has_role?(:health_officer, 'rollcall')\n end", "def advised?\n advisor_company_affiliations.with_access.present?\n end", "def is_super_admin?\n ((!user_group_id.nil?) && has_permission(:is_super_admin))\n end", "def analyst?\n has_role?(:analyst)\n end", "def is_advisor?\n not advisor_companies.empty?\n end", "def user?\n is_a?(Merit::User)\n end", "def staff?\n STAFF_ROLES.include?(CourseUser.roles[role.to_sym])\n end", "def student?\n return self.eduPersonAffiliation==\"student\"\n end", "def is_user?\n usertype == 'user'\n end", "def can_enter?(user)\n self.is_active &&\n self.teams.include?(user.team) &&\n (self.start_date < Time.now) && (!self.finish_date || self.finish_date > Time.now)\n end" ]
[ "0.64548934", "0.64488566", "0.64465547", "0.63090485", "0.6204991", "0.6194085", "0.6141487", "0.61306256", "0.6126601", "0.6125404", "0.6058233", "0.6046268", "0.60306084", "0.6016667", "0.6002127", "0.5987492", "0.5985422", "0.59661233", "0.5956504", "0.5942219", "0.5921701", "0.5916091", "0.59112686", "0.59065604", "0.5905308", "0.58950734", "0.5889575", "0.5838568", "0.58324534", "0.581618", "0.58149177", "0.5810748", "0.5810585", "0.58101875", "0.5807456", "0.5801045", "0.5800262", "0.579838", "0.5796469", "0.579391", "0.57938856", "0.57917", "0.57896185", "0.5784798", "0.5781884", "0.5779514", "0.57773906", "0.57771033", "0.5774357", "0.5772194", "0.57655585", "0.5758943", "0.5754914", "0.5751189", "0.5750912", "0.5747359", "0.57365376", "0.5729976", "0.5718851", "0.57180923", "0.5708", "0.570718", "0.5699519", "0.5683755", "0.5681641", "0.56736445", "0.56663877", "0.5664342", "0.5656167", "0.565056", "0.5647466", "0.56451744", "0.56428593", "0.5641523", "0.56365705", "0.5632506", "0.56293106", "0.56276083", "0.5623987", "0.56234527", "0.56213766", "0.5617459", "0.56087554", "0.5607957", "0.56044465", "0.5598115", "0.5594696", "0.55937856", "0.55923516", "0.55853325", "0.55792594", "0.5578785", "0.5573893", "0.557252", "0.5568942", "0.55650944", "0.556237", "0.5559228", "0.55511856", "0.55480516" ]
0.7470939
0
Returns true if User has access to Patient
def can_edit_patient(patient_id) patient = Patient.find(patient_id) if patient patient.registrations.each do | registration | if registration.clinic.supervisor == self || registration.user == self return true end end end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def can_access_patient?(patient_id)\n @authorized_user.patients.map { |patient| patient.id }.include?(patient_id.to_i)\n end", "def patient_implicit?\n @authorized_user.patients.size == 1 \n end", "def can_view_patient?\n has_role?(:enroller) || has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@measurement.nil?\n patient = @measurement.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def can_view_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def can_access?(user)\n user == self.user\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@template_day.nil?\n result = @template_day.patient.dietician.id == current_user.id\n elsif !@patient.nil?\n result = @patient.id == current_user.id or @patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def can_edit_patient?\n has_role?(:enroller) || has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def can_edit_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@training.nil?\n patient = @training.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def can_access user\n return self.users.include? user\n end", "def has_access(developer)\r\n current_user.id == developer.id\r\n end", "def can_access?\n allows_current_user_access_to? :access\n end", "def is_a_patient?\n ((!self.role.blank?) && (self.role == self.class::PATIENT))\n end", "def can_create_patient?\n has_role?(:enroller) || has_role?(:public_health_enroller)\n end", "def user?\n permissions == 'user'\n end", "def show?\n @current_user.permission('Fdp', :guest)\n end", "def has_user_permission?(object)\n object and object.user and current_user and object.user == current_user\n end", "def can_view_patient_assessments?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def show?\n @current_user.permission('Department', :guest)\n end", "def can_create_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def can_remind_patient?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def has_access?(user)\n return false if user.nil?\n self.user == user || user.is_admin?\n end", "def has_privilege?\n if (!logged_in?)\n redirect_to '/login' and return\n elsif (params[:user_id].to_i != current_user.id)\n redirect_to user_events_path(current_user) and return\n end\n end", "def accountant_can_read?(permission)\n session[:usertype].to_s == 'accountant' and session[\"acc_#{permission}\".to_sym].to_i == 1\n end", "def can?\n current_user\n end", "def can_edit_patient_assessments?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def show?\n @current_user.permission('Ration', :guest)\n end", "def accountant_can_write?(permission)\n session[:usertype].to_s == 'accountant' and session[\"acc_#{permission}\".to_sym].to_i == 2\n end", "def show?\n @current_user.permission('Donor', :guest)\n end", "def has_permission_with?(user)\r\n\t\t\treturn user.has_permission?(privacy_owner, self.class.privacy_rule_name, privacy_object_id)\r\n\t\tend", "def readable_by?(user)\n user.in_session?(resource) || user.admin_for?(resource.course)\n end", "def has_resource_permission()\n resource = resource().find(params[:id])\n unless (current_user.admin? or current_user == resource)\n redirect_to(user_path(current_user), :alert => t(:permission_denied))\n end\n return true\n end", "def show?\n @current_user.permission('Bid', :guest)\n end", "def show?\n @current_user.permission('FdpContact', :guest)\n end", "def has_privilege?\n has_all? || has_direct?\n end", "def has_access\n if !current_user\n redirect_to \"/error\"\n return false;\n end\n return true\n end", "def accessible_by?(user)\n return false unless user&.logged_in?\n\n accessible_by_user?(user)\n end", "def can_user_access?(user)\n if user.is_account_holder_or_administrator? || self.is_user_tagged_to_team?(user)\n true\n else\n false\n end\n end", "def show?\n user_record? || user.accessible_registrants.include?(record) || event_planner? || super_admin?\n end", "def can_view_patient_close_contacts?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def show?\n user.id == record.id || user.administrator?\n end", "def allows_admin_access_for?(user_or_person)\n if user_or_person.is_a?(User)\n return true if user_or_person.admin?\n person = user_or_person.person\n elsif user_or_person.is_a?(Person)\n person = user_or_person\n end\n return false if person.nil?\n return true if person.current_lead?\n return true if event_coordinator == person\n return true if person.event_attendances.find_by_event_id(id).try(:admin?)\n return false\n end", "def visible_to?(resource)\n if self.visible || self.user_id == resource.id #|| assuming they have an ID\n true\n else\n false\n end\n end", "def is_potential_user?\n\t\ttrue\n\tend", "def access action\n\t\tif current_user\n \treturn true\n else\n \treturn false\n end\n\n\tend", "def user_permission\n has_controller_permission?('user')\n end", "def visible_to?(identity)\n return true if !restricted && !deleted && published\n return false if nobody?(identity)\n return true if identity.god and identity.realm == self.realm\n identity.id == created_by\n end", "def has_resource_permission()\n resource = resource().find(params[:id])\n unless (current_user.admin? or current_user == resource.user)\n render 'shared/403', :status => 403\n return false\n end\n return true\n end", "def show?\n if (@record.user_id == @user.id) || user.faculty?\n return true\n else\n return false\n end\n end", "def can_access user\n list = List.find(self.list_id)\n\n return list.can_access user\n end", "def can_create_patient_assessments?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def has_related_patient?\n if registrations.count > 0\n return true\n end\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n return true\n end\n end\n return false\n end", "def restricted?\n return ( self.user_type == User::USER_TYPE_NORMAL )\n end", "def from_expert?\n !anonymous? && user.is_expert?\n end", "def has_access?\n true\n end", "def has_access?\n true\n end", "def define_eccept\n if current_user.info.id == @resource.id || can_manage_has_one(current_user.info, @resource, Info)\n true\n else\n redirect_to root_path\n end\n end", "def _accessible? user_or_id, edit_or_view\n # get user id\n user_id = user_or_id.to_i\n # quick response if user is self.agent\n return true if self.agent_id == user_id\n # get user object\n user = user_or_id.is_a?(Fixnum) ? Usage::User.find(user_or_id) : user_or_id\n if user.super?\n return true\n elsif user.agent? or user.manager?\n return true if _accessible_through_family?(user, edit_or_view)\n elsif user.sales_support?\n return true if _accessible_for_sales_support?(user)\n end\n false\n end", "def has_access?(id)\n unless current_is?(id)\n flash[:alert]=\"Sorry you don't have accesss to that.\"\n return false\n end\n true\n end", "def has_privilege?\n if (!logged_in?)\n redirect_to '/login' and return\n elsif (params[:user_id].to_i != current_user.id)\n redirect_to user_stories_path(current_user) and return\n end\n end", "def accessible\n accessible_for(Aurita.user)\n end", "def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end", "def is_reservable?\n if self.is_a? Patient\n return false\n end\n true\n end", "def student_access_allowed?\n return true if scopes.include_any?(Scopes::READ_ALL)\n if username && scopes.include_any?(Scopes::READ_ROLE_BASED)\n return has_any_role? PRIVILEGED_ROLES\n end\n false\n end", "def permitAccess\n\tif session[:id] == nil\n\t\treturn false\n\telse\n\t\treturn true\n\tend\nend", "def write_permitted?\n return (acting_user.administrator? || users.member?(acting_user))\n end", "def show?\n @current_user.permission('Commodity', :guest)\n end", "def can_edit_patient_close_contacts?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def authorize?(person)\n person.is_admin?\n end", "def authorize?(user)\n user && user.moderator?\n end", "def can_read?(user=@session.user)\n effective_acl.can_read?(user)\n end", "def user?\n get_mode == :user\n end", "def accessible_by?(context)\n return false unless context.logged_in?\n\n accessible_by_user?(context.user)\n end", "def check_permission\n if ((session[:register].nil? || session[:register]==false) &&\n (session[:student_current_user].nil? || session[:student_current_user]==false) &&\n (session[:admin_current_user].nil? || session[:admin_current_user]==false))\n redirect_to \"/registration_home/index\"\n end\n end", "def action_allowed?\n current_user_has_student_privileges?\n end", "def can_read?(user)\n self == user\n end", "def can_read?(user)\n self == user\n end", "def can_read?(user)\n self == user\n end", "def mayView? ( other_user )\n if ( (not other_user.valid?) or ( other_user.is_a?(User) == false ) )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"basic check failed\"\n # d other_user.type\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return false\n end\n user = getUser()\n if ( other_user == user )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"same user as owner\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return true\n end\n if ( ( self.public_policy == Dfile::PP_MAYVIEW ) or ( self.public_policy == Dfile::PP_MAYEDIT ) )\n return true\n end\n if self.special_users\n special = self.special_users[other_user.id.to_s]\n if special\n if ( ( special == Dfile::PP_MAYVIEW ) or ( special == Dfile::PP_MAYEDIT ) )\n return true\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has special permission but not right one\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has no special permission\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n \n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"no special permissions\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n return false\n end", "def volunteer_logged_in?\n session[:id] && session[:volunteer]\n end", "def user_authorized?(user)\n user == current_user || is_admin?\n end", "def current_user?(user)\n user == current_person.user\n end", "def show?\n user.try(:admin?) || record.has_member?(user) \n end", "def is_permitted_for?( user )\n ( user.id == self.user.id ) or ( user.privileged? )\n end", "def user_can_view?(_check_user)\n true # everyone can view these\n end", "def is_customer?\n if self.is_a? Patient\n return true\n end\n false\n end", "def have_permission?(project, user)\n member = space_memberships.find_by(user: user)\n project.present? && member.lead_or_admin_or_contributor?\n end", "def logged_in_and_member?\n User.logged_in_and_member?\n end", "def logged_in_and_member?\n User.logged_in_and_member?\n end", "def define_eccept\n if current_user.info.id==@resource.id || can_manage_has_one(current_user.info, @resource, @model)\n return true\n else\n redirect_to root_path \n end\n end", "def owned_by?(user)\n if (access_restricted?)\n return self.acl.owner?(user)\n end\n return false\n end", "def is_member?(user)\n return true if user.id == self.created_by.id\n self.users.any? { |u| u.id == user.id }\n end", "def allow_access\n !current_cas_user.nil?\n end", "def members?\n user.hoa == hoa\n end", "def allow_access\n !@current_user.nil?\n end", "def user_is_allowed(resource, action)\n if (!logged_in?)\n redirect_to \"/login?return_url=\" + URI.encode(request.fullpath)\n return\n end\n \n @user = logged_in_user\n if (!@user.is_allowed(resource, action))\n @error = \"You don't have permission to \" + action + \" \" + resource\n render :template => \"extras/error\"\n return false\n end\n \n return true \n end", "def has_access\n if !current_user\n return false\n elsif current_user.mtu_id != @player.mtu_id && !Player.exists?(mtu_id: current_user.mtu_id, committee: true)\n return false\n end\n return true\n end", "def authorized?(user)\n true\n end" ]
[ "0.7958407", "0.7864747", "0.7576885", "0.74688303", "0.7402379", "0.7312102", "0.72564846", "0.7224729", "0.7199617", "0.71819997", "0.71429783", "0.7128856", "0.71084505", "0.70598763", "0.7019079", "0.69949764", "0.69775504", "0.6975886", "0.6951016", "0.69428456", "0.6922893", "0.69191885", "0.69144547", "0.6906122", "0.68530124", "0.68406636", "0.6808149", "0.68069917", "0.6802687", "0.6788159", "0.6776574", "0.6747586", "0.67118853", "0.670277", "0.6695035", "0.66896486", "0.66630304", "0.66513425", "0.6648289", "0.6647576", "0.6634784", "0.6630286", "0.66128695", "0.65916026", "0.6586031", "0.657652", "0.6559492", "0.654809", "0.6524105", "0.65229374", "0.6516652", "0.65166277", "0.65084255", "0.6506523", "0.6504469", "0.65003747", "0.64989024", "0.64989024", "0.6494584", "0.6469206", "0.6456017", "0.6436887", "0.64325863", "0.6431973", "0.6419059", "0.64120436", "0.6405826", "0.640462", "0.64038223", "0.6403462", "0.6402595", "0.64012223", "0.6393003", "0.6386757", "0.63838255", "0.63801396", "0.6379935", "0.6378663", "0.6378663", "0.6378663", "0.63689053", "0.63603604", "0.63581556", "0.6354519", "0.63516223", "0.6348753", "0.6344052", "0.6343776", "0.6338029", "0.63326794", "0.63326794", "0.6332275", "0.6318001", "0.63161075", "0.63087505", "0.63061243", "0.63020474", "0.6294189", "0.62939155", "0.62846285" ]
0.70012325
15
Returns true if User has access to Study
def can_edit_study(study_id) study = Study.find(study_id) if study if study.admin == self return true end study.users.each do | user | if user == self return true end end end return false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def student_access_allowed?\n return true if scopes.include_any?(Scopes::READ_ALL)\n if username && scopes.include_any?(Scopes::READ_ROLE_BASED)\n return has_any_role? PRIVILEGED_ROLES\n end\n false\n end", "def can_edit_study?(user)\n if self.study.queued_for_deletion?\n return false\n else\n return self.study.can_edit?(user)\n end\n end", "def action_allowed?\n current_user_has_student_privileges?\n end", "def has_access(developer)\r\n current_user.id == developer.id\r\n end", "def can_read?(user)\n (released? && assignment.released_for_student?(user)) ||\n assignment.can_edit?(user)\n end", "def can_access?(user)\n user == self.user\n end", "def readable_by?(user)\n user.in_session?(resource) || user.admin_for?(resource.course)\n end", "def is_authorized_for_student(student)\n return true if self.districtwide_access?\n\n return false if self.restricted_to_sped_students && !(student.program_assigned.in? ['Sp Ed', 'SEIP'])\n return false if self.restricted_to_english_language_learners && student.limited_english_proficiency == 'Fluent'\n return false if self.school.present? && self.school != student.school\n\n return true if self.schoolwide_access? || self.admin? # Schoolwide admin\n return true if self.has_access_to_grade_levels? && student.grade.in?(self.grade_level_access) # Grade level access\n return true if student.in?(self.students) # Homeroom level access\n false\n end", "def can_access?\n allows_current_user_access_to? :access\n end", "def has_access?(user)\n return false if user.nil?\n self.user == user || user.is_admin?\n end", "def user_can_view?(_check_user)\n true # everyone can view these\n end", "def student?\n return logged_in? && (current_user.class == Student)\n end", "def can_access user\n return self.users.include? user\n end", "def can_view?(u)\n\t\tu and (u.admin? or u.staff? or (u == self.user))\n\t\t# TODO: support users having explicit permission to view a document\n\t\t# TODO: support users belonging to group that has permission to view a document\n\tend", "def can_user_access?(user)\n if user.is_account_holder_or_administrator? || self.is_user_tagged_to_team?(user)\n true\n else\n false\n end\n end", "def can_view_patient_assessments?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def accessible_for?(user)\n user_id == user.id && !user.anonimous?\n end", "def has_access?\n true\n end", "def has_access?\n true\n end", "def can_access_student( student)\n # 2 ways to access all student: admin or access_all flag\n if (is_admin? || current_teacher.access_all_students)\n return true\n end\n\n # last gasp: check roster of accessible students\n find_student = RosterStudent.where( teacher_id: current_teacher.id, student_id: student.id)\n if ! find_student.blank?\n return true\n end\n\n false # nope - teacher cannot access this student's data\n end", "def has_privilege?\n if (!logged_in?)\n redirect_to '/login' and return\n elsif (params[:user_id].to_i != current_user.id)\n redirect_to user_stories_path(current_user) and return\n end\n end", "def student?\n @student = true if session[:role_name] == 'Student'\n end", "def viewable_by?(user)\n Sugar.public_browsing? || user ? true : false\n end", "def is_authorized_for_student?(student)\n begin\n return true if @educator.districtwide_access?\n\n return false if @educator.restricted_to_sped_students && !(student.program_assigned.in? ['Sp Ed', 'SEIP'])\n return false if @educator.restricted_to_english_language_learners && student.limited_english_proficiency == 'Fluent'\n return false if @educator.school_id.present? && student.school_id.present? && @educator.school_id != student.school_id\n\n return true if @educator.schoolwide_access? || @educator.admin? # Schoolwide admin\n return true if @educator.has_access_to_grade_levels? && student.grade.in?(@educator.grade_level_access) # Grade level access\n return true if student.in?(@educator.students) # Homeroom level access\n return true if student.in?(@educator.section_students) # Section level access\n rescue ActiveModel::MissingAttributeError => err\n # We can't do authorization checks on models with `#select` that are missing\n # fields. If this happens, it's probably because the developer is trying to\n # to optimize a query. The authorization layer could only recover by making more\n # queries, so instead we raise and force the developer to figure out how to resolve.\n #\n # See `Authorizer.student_fields_for_authorization` and `Authorizer.educator_field_for_authorization`\n # to see what fields are required on each model.\n raise err\n end\n false\n end", "def accessible_by?(user)\n return false unless user&.logged_in?\n\n accessible_by_user?(user)\n end", "def can_view_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def can_read_content?(user)\n released_for_student?(user) || can_edit?(user)\n end", "def can_read?(user)\n (self.user == user) || course.can_edit?(user)\n end", "def access action\n\t\tif current_user\n \treturn true\n else\n \treturn false\n end\n\n\tend", "def logged_in?\n act = StudyListAction.new(self)\n act.get\n !(act.redirected_to_login?)\n end", "def has_access\n if !current_user\n redirect_to \"/error\"\n return false;\n end\n return true\n end", "def can_read?(user=@session.user)\n effective_acl.can_read?(user)\n end", "def allow_access_assessment\n can :access, Course::Assessment do |assessment|\n if assessment.view_password_protected?\n Course::Assessment::AuthenticationService.new(assessment, session).authenticated? ||\n assessment.submissions.by_user(user).count > 0\n else\n true\n end\n end\n end", "def can_access?(user)\n return true if self.class.standalone_page_available_to_user self, user\n\n user.has_access_to?(:read, :standalone_page, :_all_standalone_pages_)\n end", "def can_read?(user)\n assignment.grades_released? || can_grade?(user)\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@measurement.nil?\n patient = @measurement.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def check_access\n result = false\n if current_user.is_a? Admin\n result = true\n elsif !@training.nil?\n patient = @training.patient\n result = patient.id == current_user.id or patient.dietician.id == current_user.id\n end\n unless result\n redirect_to root_path, alert: \"Brak dostępu!\"\n end\n end", "def user_can_see?(user)\n !self.private || self.is_owner?(user)\n end", "def has_privilege?\n if (!logged_in?)\n redirect_to '/login' and return\n elsif (params[:user_id].to_i != current_user.id)\n redirect_to user_events_path(current_user) and return\n end\n end", "def student_logged_in?\n !current_student.nil?\n end", "def can_edit_patient_assessments?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def rollcall_student_required\n if current_user.is_rollcall_epi? || current_user.is_rollcall_health_officer? || current_user.is_rollcall_nurse? ||\n current_user.is_rollcall_admin?\n return true\n else\n redirect_to :action => \"unauthorized\", :controller => 'rollcall/rollcall_app'\n return false\n end\n end", "def can_read?(user)\n self == user\n end", "def can_read?(user)\n self == user\n end", "def can_read?(user)\n self == user\n end", "def student_logged_in?\n @student_logged_in ||= user_signed_in? and cur_student\n end", "def can?\n current_user\n end", "def authorized?(user)\n true\n end", "def visible_to?(user)\n if method = Garage.configuration.docs.docs_authorization_method\n method.call(document: self, user: user)\n else\n true\n end\n end", "def can_access user\n list = List.find(self.list_id)\n\n return list.can_access user\n end", "def can_view_patient?\n has_role?(:enroller) || has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def read_allowed?(user)\n true\n end", "def permitAccess\n\tif session[:id] == nil\n\t\treturn false\n\telse\n\t\treturn true\n\tend\nend", "def show?\n @user.has_role?(:admin) || @record.course.user_id == @user.id || @record.course.bought(@user) == false\n end", "def tutor_check?(academic_session, student_id)\n \tcurrent_user.is_student_tutor?(academic_session, student_id)\n end", "def is_contributor?(story)\n User.role_for_story(self, story.id) == \"loggedout\" || User.role_for_story(self, story.id) == \"reader\"\n end", "def visible_to? a_user\n a_user.participating_programs.include? program\n end", "def is_student?\n self.role==\"student\"\n end", "def student?\n self.role == \"student\"\n end", "def can_view?(user)\n if user.nil?\n false\n else\n # use if/elsif with explicit returns to ensure skipping downstream calls\n if self.study_shares.can_view.map do |email_address|\n remove_gmail_periods(email_address)\n end.include?(remove_gmail_periods(user.email))\n return true\n elsif self.can_edit?(user)\n return true\n else\n return self.user_in_group_share?(user, 'View', 'Reviewer')\n end\n end\n false\n end", "def viewer?\n user_role_id == UserRole::VIEWER\n end", "def user_owns_reflection?\n unless @reflection.student.uid == current_user.uid\n flash[:notice] = 'You may only edit your own reflections.'\n redirect_to reflections_url\n end\n end", "def can_report?(reporting_user) \n return self.user.schools.detect{|s|\n reporting_user.schools.include?(s)\n }\n end", "def readable_by?(user)\n return true if user.has_role?(:admin, resource.unit)\n return true if user.has_role?(:wizard, resource.unit)\n user == resource\n end", "def has_bucket_access?(user)\n if user.nil?\n false\n else\n if self.user == user\n return true\n elsif self.study_shares.non_reviewers.map(&:downcase).include?(user.email.downcase)\n return true\n else\n self.user_in_group_share?(user, 'View', 'Edit')\n end\n end\n end", "def view_authorized(current_user)\n return self.goal.public? || self.edit_authorized(current_user)\n end", "def user_authorized?(user)\n user == current_user || is_admin?\n end", "def mayView? ( other_user )\n if ( (not other_user.valid?) or ( other_user.is_a?(User) == false ) )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"basic check failed\"\n # d other_user.type\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return false\n end\n user = getUser()\n if ( other_user == user )\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"same user as owner\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n return true\n end\n if ( ( self.public_policy == Dfile::PP_MAYVIEW ) or ( self.public_policy == Dfile::PP_MAYEDIT ) )\n return true\n end\n if self.special_users\n special = self.special_users[other_user.id.to_s]\n if special\n if ( ( special == Dfile::PP_MAYVIEW ) or ( special == Dfile::PP_MAYEDIT ) )\n return true\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has special permission but not right one\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"User has no special permission\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n \n else\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n # d \"no special permissions\"\n # d \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\" \n end\n return false\n end", "def current_user_has_access?(uri, options=nil)\n opts = options || current_user.try(:user_options) || nil\n current_user.present? and current_user.has_access?(uri, opts)\n end", "def can_edit_patient_laboratories?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "def student_only?(sfuid)\n result = roles sfuid\n if result.join(\"\").eql? \"undergrad\"\n return true\n end\n false\n end", "def allow_access\n !current_cas_user.nil?\n end", "def has_access(**args)\n skip_redirect = !args[:skip_redirect].nil? ? args[:skip_redirect] : false\n # If Admin, or owns current Article\n if user_signed_in?\n puts '=== user signed in ==='\n if current_user.has_roles?(:admin) || @article.user_id == current_user.id\n puts '=== admin, or owner of article ==='\n @crud_access = true\n else\n @crud_access = false\n end\n if !skip_redirect && !@crud_access\n flash[:alert] = \"Access Denied!\"\n redirect_to articles_path and return false\n end\n return true\n end\n end", "def user?\n permissions == 'user'\n end", "def logged_in_as_student?\n !current_student.nil?\n end", "def show?\n @user && (can_update_seminar? || @record.holder_id == @user.id || @user.authorization.can_read?(@record.seminar.organization_id))\n end", "def show?\n GuidanceGroup.can_view?(@user, @record)\n end", "def from_expert?\n !anonymous? && user.is_expert?\n end", "def student?\n if self.role and self.role == 4 \n true\n end\n end", "def accessible_by?(context)\n return false unless context.logged_in?\n\n accessible_by_user?(context.user)\n end", "def authorize?(user)\n user && user.moderator?\n end", "def authorized\n\t\tif current_user\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "def authorized?(user, action)\n\t\ttrue\n\tend", "def show?\n @current_user.permission('Department', :guest)\n end", "def authorized?(user)\n current_user == user\nend", "def viewer?(current_user)\n return false unless current_user\n\n viewers.where(id: current_user).count == 1\n end", "def canBeReadBy? user\n unless user.class == Modeles::User\n username = user.to_s\n user = Modeles::User.find_by_name username\n unless user\n @errors << \"User #{username} doesn't exists\"\n return false\n end\n end\n if user.isAdmin == 1\n return true\n elsif user.name == @user\n if @userRights >= 4\n return true\n else\n return false\n end\n elsif isIncludedIn? user.groups, @group\n if @groupRights >= 4\n return true\n else\n return false\n end\n else\n if @othersRights >= 4\n return true\n else\n return false\n end\n end\n end", "def readable_by? user\n true\n end", "def can_be_viewed_by?(user)\n # you can always view your own tlog\n return true if user && user.id == self.id\n\n # skip if current user is blacklisted\n return false if user && self.is_blacklisted_for?(user)\n\n case self.tlog_settings.privacy\n when 'open'\n true\n\n # registration required\n when 'rr'\n user ? true : false\n\n # friend-mode\n when 'fr'\n user && self.all_friend_ids.include?(user.id)\n\n # only me\n when 'me'\n user && user.id == self.id\n end\n end", "def show?\n @current_user.permission('Ration', :guest)\n end", "def current_user_is_student\n if !current_user || current_user.role != 'student'\n head(403)\n end\n end", "def authorized_for_read?\n return true if !existing_record_check?\n if !current_user.nil?\n if current_user.has_role?(:admin)\n return true\n else\n return !current_user.groups.map{|g| g.is_a?(Group) ? g.id : g}.index(self.group_id).nil?\n end\n else\n return false\n end\n end", "def luxury_search_authorized?\n authorized_for?(:action => :read)\n end", "def view_authorized(current_user)\n return self.public? || self.edit_authorized(current_user)\n end", "def _accessible? user_or_id, edit_or_view\n # get user id\n user_id = user_or_id.to_i\n # quick response if user is self.agent\n return true if self.agent_id == user_id\n # get user object\n user = user_or_id.is_a?(Fixnum) ? Usage::User.find(user_or_id) : user_or_id\n if user.super?\n return true\n elsif user.agent? or user.manager?\n return true if _accessible_through_family?(user, edit_or_view)\n elsif user.sales_support?\n return true if _accessible_for_sales_support?(user)\n end\n false\n end", "def user?\n get_mode == :user\n end", "def may_interview?(*args)\n\t\t\t(self.role_names & \n\t\t\t\t['superuser','administrator','editor','interviewer']\n\t\t\t).length > 0\n\t\tend", "def authorized?(user, request, params)\n true\n end", "def restrict_access\n if session[:user_id]\n if !report_publication_params.nil?\n report_publication_params[:user_id] = session[:user_id]\n end\n else\n authenticate_or_request_with_http_token do |token, options|\n @user = User.where(:auth_token => token).first()\n if (@user)\n if !report_publication_params.nil?\n report_publication_params[:user_id] = @user.id\n end\n return true\n end\n false\n end\n end\n end", "def check_user_permissions\n if user_signed_in?\n if !current_user.is_admin? && !current_user.is_professor?\n redirect_to courses_path, notice: \"You don't have permission to access that page!\"\n end\n end\n end" ]
[ "0.7554266", "0.74695235", "0.7322401", "0.7247211", "0.72334814", "0.7179571", "0.71436745", "0.7126309", "0.709993", "0.700414", "0.69817096", "0.6959944", "0.6943501", "0.69411284", "0.6924641", "0.6922579", "0.6905834", "0.69035757", "0.69035757", "0.6898159", "0.6872384", "0.6836882", "0.6831989", "0.6819355", "0.68051195", "0.6797906", "0.67930245", "0.6792127", "0.6758253", "0.67501116", "0.6740397", "0.67218775", "0.67036694", "0.67028767", "0.66769594", "0.6672357", "0.66642445", "0.66317785", "0.66314", "0.6613468", "0.6603064", "0.65910965", "0.65769094", "0.65769094", "0.65769094", "0.65650326", "0.65558034", "0.6550672", "0.65290225", "0.6509023", "0.6502022", "0.6499229", "0.6491694", "0.64908063", "0.64823633", "0.64791405", "0.64714015", "0.64675826", "0.6467329", "0.64672714", "0.6466795", "0.646074", "0.64603", "0.6443792", "0.6443495", "0.6434705", "0.6433663", "0.64333004", "0.64302534", "0.6429974", "0.6423122", "0.64174265", "0.6414632", "0.64129835", "0.6401939", "0.639916", "0.63961196", "0.63951117", "0.6391185", "0.6385392", "0.63839877", "0.63820726", "0.63815874", "0.6380698", "0.63613075", "0.6357985", "0.63557214", "0.63538116", "0.6352411", "0.6338311", "0.63308984", "0.6329708", "0.6328987", "0.63262564", "0.63249063", "0.63160896", "0.63128555", "0.63103336", "0.6304489", "0.63028705" ]
0.758039
0
Returns true if user is approved or is admin (devise overrides)
def active_for_authentication? super && (approved? || self.admin) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def approved?\n (status == ConfigCenter::User::APPROVED)\n end", "def is_user_admin?\n user_active && user_active.permission_level == 2\n end", "def admin_user?\n (current_user.role == 'admin') if logged_in?\n end", "def admin_user?\n self.admin ==true\n end", "def admin_required\n self.current_user != :false && \n self.current_user.is_admin? ? true : access_denied\n end", "def admin?\n @user = current_user.is_admin?\n end", "def user_admin?\n user_logged_in? && @current_user.type == 'Admin'\n end", "def admin?\n if user_signed_in? && current_user.user_level == 1\n return true\n end\n return false\n end", "def is_admin?\n user_type == 'super_admin' || user_type == 'admin'\n end", "def admin_access?\n admin?\n end", "def is_admin?(user)\n user.admin > 0\n end", "def admin_authorized?\n\t\tif @user\n\t\t\t@user.level >= ADMIN_USER_LEVEL \n\t\telse\n\t\t\tnil\n\t\tend\n\tend", "def admin?\n self.user_type == TYPES[:admin]\n end", "def current_user_is_admin\n\t\ttrue if current_user.admin == 't'\n\tend", "def is_admin_user?\n if user_signed_in? == false\n @is_admin = false\n else\n @is_admin = (current_user.email == \"jpwendt@asu.edu\")\n end\n end", "def admin_user\n @current_user.admin?\n end", "def admin?\n user.admin?\n end", "def admin_user?\n current_user.admin\n end", "def active_for_authentication? \n super && is_approved? \n end", "def admin?\n user_signed_in? && current_user.admin?\n end", "def admin?\n return ( self.user_type == User::USER_TYPE_ADMIN )\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin') || access_denied\n end", "def normal_user?\n self.admin ==false\n end", "def admin?\n @user.admin?\n end", "def admin\n is_user_in_role(ADMIN_ROLE_ID)\n end", "def admin?\n\t\tcurrent_user.try(:admin)\n\tend", "def is_admin?\n return false unless logged_in?\n user = User.find_by_id(current_user)\n user.userstatus.status == \"admin\" ? true : false\n end", "def admin_user?\n if current_user != nil\n !!current_user.admin\n end\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication?\n super && approved?\n end", "def active_for_authentication? \n super && approved? \n end", "def is_admin?\n determine_user_role\n if @admin_user || @superadmin_user\n return true\n else\n return false\n end\n end", "def admin?\n current_user.admin?\n end", "def admin_user?\n\t\treturn self.user_category == \"admin\"\n\tend", "def admin?\n User.admin_logged_in?\n end", "def admin?\n super_user?\n end", "def user_is_admin?\n ALLOWED_USERS.include? current_user.email\n end", "def is_admin\n return current_user.role == User::ADMIN\n end", "def admin_required\n current_user.respond_to?('is_admin') && current_user.send('is_admin')\n end", "def admin?\n current_user.admin?\n end", "def is_admin?\n current_user && current_user.try(:admin?)\n end", "def user_authorized?(user)\n user == current_user || is_admin?\n end", "def admin?\n @current_user.admin?\n end", "def admin?\n user = check_user\n user.role == User.role_types['Admin']\n end", "def is_admin? \n return (user_signed_in? and current_user.role == 1)\n end", "def checkAdmin\n current_user.present? && current_user.isAdmin\n end", "def admin?\n self.admin_user\n end", "def admin_required\n current_user.is_admin? || access_denied\n end", "def current_user_is_admin?\n signed_in? && current_user.admin?\n end", "def admin_user\n (current_user.present? && current_user.admin?)\n end", "def active_for_authentication?\n super && approved?\n end", "def admin?\n user_role_id == UserRole::ADMIN\n end", "def admin_signed_in?\n current_user && current_user.admin?\n end", "def admin_signed_in?\n user_signed_in? && (current_user.type==\"Admin\")\n end", "def current_user_is_admin?\n current_user && current_user.is_admin\n end", "def is_admin\n current_user.admin?\n end", "def admin_signed_in?\n current_user.admin? if user_signed_in?\n end", "def admin?\n current_user && current_user.role?(\"admin\")\n end", "def active_for_authentication?\n super && self.approved?\n end", "def is_admin?\n current_user.role.eql?(\"admin\")\n end", "def is_admin?\n has_appt? || is_completed?\n end", "def is_admin?\n current_user && current_user.admin\n end", "def current_admin?(user)\n current_user.admin?\n end", "def is_admin_access\n if session[:is_admin] == \"true\"\n return true\n else\n if current_user.present?\n admin_status = User::ADMIN_ACCESS.include?(current_user.email)\n if admin_status\n session[:is_admin] = \"true\"\n return true\n else\n flash[:notice] = \"You don't have admin access. You cannot access this page.\"\n redirect_to root_path\n end\n else\n flash[:notice] = \"You don't have admin access. You cannot access this page.\"\n redirect_to root_path\n end\n end\n end", "def has_admin_access?\n admin? || moderator?\n end", "def is_admin?\n current_user && current_user.admin?\n end", "def eventunscrape?\n @user.is_admin?\n end", "def is_admin?\n current_user && current_user.admin?\n end", "def is_super_admin?\n user_type == 'super_admin'\n end", "def admin?\n if(@current_user)\n @current_user.admin?\n end\n end", "def is_admin?\n current_user and current_user.is_admin?\n end", "def is_admin?\n if valid_session?\n current_user.admin == true\n end\n end", "def current_user_is_admin?\n roles.include?(ADMIN_ROLE)\n end", "def admin_logged_in?\n User.admin_logged_in?\n end", "def admin_logged_in?\n User.admin_logged_in?\n end", "def is_admin\n if current_user.admin \n return true\n else\n redirect_to new_user_session_path\n return false\n end\n end", "def admin_user?\n \treturn self.user_category == \"admin\"\n end", "def is_admin?\n if user_signed_in?\n return current_user.is_admin\n else\n return false\n end\n end", "def admin?\n @current_user && @current_user.has_role?(:admin)\n end", "def update?\n user.admin?\n end", "def active_for_authentication?\n # User is approved when harp_id is assigned.\n # Approved flag is set programmatically when harp_id is set by an admin.\n super && is_approved?\n end", "def is_admin?\n signed_in? && current_user.admin?\n end", "def admin_yes_or_no(user)\n user.admin? ? \"Yes\" : \"No\"\n end", "def admin?\n logged_in? && current_user.admin\n end", "def user_is_admin\n unless logged_in? and is_admin?\n respond_with_error(\n \"You must have admin permissions to perform this action.\", \n root_path)\n end\n end", "def user_accessible?\n is_admin\n end", "def is_admin\n admin?\n end", "def current_user_admin?\n current_user && current_user.admin?\n end", "def is_admin?(user)\n permitted?(admins_join_table, user)\n end", "def is_admin?\n self.is_admin == \"true\"\n end", "def is_admin?\n current_user ? current_user.login == 'admin' : false\n end", "def admin? ; user.instance_of? User and user.role >= 2 ; end", "def admin?\n\t\tuser_session.admin?\n\tend", "def admin?\n logged_in? && current_user.admin?\n end", "def is_admin?\n admin\n end" ]
[ "0.78165925", "0.7652688", "0.76422215", "0.7614828", "0.7598862", "0.7593871", "0.75682545", "0.75663036", "0.75628185", "0.7550705", "0.75460887", "0.75263524", "0.7524237", "0.75115806", "0.75082296", "0.75049746", "0.7502475", "0.7501267", "0.7489247", "0.74862254", "0.74761087", "0.7474751", "0.74698985", "0.74685526", "0.7459721", "0.7452455", "0.7448685", "0.7439968", "0.7436748", "0.7436748", "0.7436748", "0.7436748", "0.7436748", "0.7436748", "0.7436748", "0.7436414", "0.7428175", "0.74268067", "0.7423014", "0.74191755", "0.74058014", "0.74012375", "0.7400223", "0.73985547", "0.73978686", "0.7397174", "0.73945564", "0.7394378", "0.7388208", "0.7387282", "0.73846376", "0.7384117", "0.73832595", "0.7381337", "0.7376752", "0.7375345", "0.7372788", "0.7359668", "0.7357697", "0.73559016", "0.7338827", "0.7321741", "0.73216707", "0.7317683", "0.73171407", "0.7316456", "0.73155105", "0.7313743", "0.731023", "0.73081505", "0.730066", "0.7300451", "0.72993785", "0.7297653", "0.7297565", "0.72943157", "0.72899634", "0.7283586", "0.72819364", "0.72819364", "0.7281397", "0.7272039", "0.7267834", "0.72652847", "0.7264116", "0.7263631", "0.72592515", "0.72554696", "0.725038", "0.7250032", "0.724929", "0.724658", "0.7242551", "0.7241442", "0.7239874", "0.72369426", "0.7235263", "0.72346884", "0.7229279", "0.72282124" ]
0.7961931
0
execute a block scoped to the current tenant unsets the current tenant after execution
def with_tenant(tenant, &block) Multitenant.current_tenant = tenant Multitenant.in_block = true save_and_change_default_scope_for_all yield ensure restore_default_scope Multitenant.in_block = false Multitenant.current_tenant = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def temp(tenant_session, &block)\n original = self.tenant_session\n begin\n self.tenant_session = tenant_session\n yield\n ensure\n self.tenant_session = original\n end\n end", "def scope_current_tenant &block\n if current_user\n current_user.create_tenant # make sure there is a tenant\n \n current_tenant.scope_schema &block\n else\n yield\n end\n end", "def reset\n return unless default_tenant\n\n Apartment.connection.execute \"use `#{default_tenant}`\"\n end", "def reset_tenant_scope_to_default \n put(\"/tenants.json/scope/clear\")\nend", "def block!\n self.blocked = Time.now\n self.save\n Token.block_access!(client_uri, resource_owner_uri)\n Authorization.block_access!(client_uri, resource_owner_uri)\n end", "def evict_tenant\n\t\t#if @is_rental?\n\tend", "def cleaning(&block)\n Sidekiq::TransactionGuard.testing { super(&block) }\n end", "def execute_block(&block)\n @currently_executing_block = true\n output \"tell session id #{name}_tty\"\n self.instance_eval(&block)\n output \"end tell\"\n @currently_executing_block = false\n end", "def unblock!\n self.blocked = nil\n self.save\n end", "def exec(&block)\n raise InvalidDbError if @stale\n\n return exec_in_staging(true, &block) if self.staging?\n\n begin\n self.staging\n exec_in_staging(false, &block)\n self.staging.write\n ensure\n self.unstage\n end\n\n end", "def block\n users_projects.find_each do |membership|\n return false unless membership.destroy\n end\n\n self.blocked = true\n save\n end", "def void_pending_authorizations\n self.transactions.authorized.pending.each do |t|\n t.account.void(t.authorization)\n end\n end", "def block\n #first pause those subscriptions as those will be reactivated once customer alters his payment details.\n @my_subscription.cancel_or_pause_subscription(\"paused\")\n #now, mark those subscription blocked.\n @my_subscription.block_subscription\n\n flash[:sub_cancelled] = \"#{@my_subscription.id} subscription has been paused \"\n redirect_to main_app.profile_users_path and return\n end", "def suspend()\n #This is a stub, used for indexing\n end", "def verify_tenant_access\n begin\n\n yield\n\n MultiTenant.pending_verification.each do |pending|\n rec, model = pending\n curr_id = MultiTenant.current_tenant.id\n\n multi_tenant_incr(rec)\n\n rec_tenant = rec.send(model)\n if rec_tenant.nil? then\n # if no tenant, then must be globally accessible\n multi_tenant_decr()\n return\n end\n\n other_id = rec_tenant.id\n if curr_id != other_id then\n # PANIC\n multi_tenant_reset()\n raise AccessException, \"illegal access: tried to access tenant.id=#{other_id}; current_tenant.id=#{curr_id}\"\n end\n\n multi_tenant_decr()\n end\n\n ensure\n MultiTenant.pending_verification.clear\n MultiTenant.current_tenant = nil\n end\n end", "def call(&block)\n execute(&block) if valid?\n execution_attempted!\n self\n end", "def destroy_block(user)\n delete \"blocks/destroy/#{user}\"\n end", "def execute(&block)\n TempTableContext.with_context(db) {|context| execute_in_context(context, &block)}\n end", "def run_stored_block\n self.run_in_context @stored_block if @stored_block\n end", "def without_approval(&block)\n memory = self.class.approvals_active # If we use #approvals_enabled? the global state might be incorrectly applied.\n self.class.approvals_off\n instance_eval &block\n ensure\n self.class.approvals_on if memory\n end", "def without_transaction\n n = Thread.current['open_transactions']\n Thread.current['open_transactions'] = 1\n yield\n Thread.current['open_transactions'] = n\n end", "def set_tenant\n if current_user\n current_account = Account.where(id: current_user.current_tenant_id).first\n set_current_tenant(current_account)\n end\n end", "def remove_block\n @user = User.current\n @user.pref.remove_block params[:block]\n @user.pref.save\n redirect_to my_page_layout_path\n end", "def with_tenant(tenant, options = {}, &block)\n previous_tenant = Multitenant.current_tenant\n Multitenant.current_tenant = tenant\n previous_extra_tenant_ids = Multitenant.extra_tenant_ids\n Multitenant.extra_tenant_ids = options[:extra_tenant_ids] if options[:extra_tenant_ids]\n yield\n ensure\n Multitenant.current_tenant = previous_tenant\n Multitenant.extra_tenant_ids = previous_extra_tenant_ids\n end", "def unblock_subscription\n self.update_attributes(is_blocked: false, blocked_at: nil)\n order_ids = self.orders.where(is_blocked: true).pluck(:id)\n Spree::Order.unblock_order(order_ids)\n end", "def block!(user)\n User.transaction do\n subscriptions = Subscription.where(:subscriber_id => user.id, :publisher_id => self.id)\n subscriptions.destroy_all\n \n new_blocking = Blocking.new\n new_blocking.requesting_user = self.id\n new_blocking.blocked_user = user.id\n new_blocking.save!\n end\n end", "def out_of_band()\n @workspace.database.transact_with(@workspace) do |transaction|\n yield(transaction)\n end\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def unprotected(&block)\n begin\n @unprotected = true\n block.call\n ensure\n @unprotected = false\n end\n end", "def void_pending_expired_authorizations\n self.transactions.authorized.pending.expired.each do |t|\n t.account.void(t.authorization)\n end\n end", "def transaction(&block)\n block.call\n end", "def suspend &block\n if block_given? then\n @mutex.synchronize {\n begin\n @suspended = true\n block.call(self)\n ensure\n @suspended = false\n end\n }\n end\n end", "def without_scope_condition(&block)\n if block_given?\n disable_scope_condition\n yield\n enable_scope_condition\n end\n end", "def without_instrumentation\n Appsignal::Transaction.current.pause! if Appsignal::Transaction.current\n yield\n ensure\n Appsignal::Transaction.current.resume! if Appsignal::Transaction.current\n end", "def without_instrumentation\n Appsignal::Transaction.current.pause! if Appsignal::Transaction.current\n yield\n ensure\n Appsignal::Transaction.current.resume! if Appsignal::Transaction.current\n end", "def set_current_tenant_if_necessary\n if !self.user.current_tenant\n self.user.current_tenant = self.tenant\n self.user.save\n end\n end", "def execute(&block)\n\tblock.call\nend", "def execute(&block)\n\tblock.call\nend", "def execute(&block)\n\tblock.call\nend", "def execute(&block)\n\tblock.call\nend", "def execute(&block)\n\tblock\nend", "def execute(&block)\n\tblock\nend", "def execute(block)\n block.call\nend", "def execute(block)\n block.call\nend", "def execute(block)\n block.call\nend", "def execute(block)\n block.call\nend", "def execute(block)\n block.call\nend", "def execute(block)\n block.call\nend", "def execute(block)\n block.call\nend", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def without_auditing(&block)\n self.class.without_auditing(&block)\n end", "def with_deleted\n self.unscoped do\n yield\n end\n end", "def block!\n self.update_attribute(:status, BLOCKED)\n end", "def without_auditing(&block)\n auditing_was_enabled = auditing_enabled\n disable_auditing\n block.call\n ensure\n enable_auditing if auditing_was_enabled\n end", "def leave\n Leases.current = nil\n Apartment::Tenant.switch!\n end", "def reset\n\t\t@block_type = nil\n\tend", "def transaction(&block)\n raise InvalidDbError if @stale\n\n return transaction_in_staging(true, &block) if self.staging?\n\n begin\n transaction_in_staging(false, &block)\n ensure\n self.unstage\n end\n end", "def transaction(&block)\n @@semaphore.synchronize{\n block.call\n }\n end", "def without_locking(&block)\n self.class.without_locking(&block)\n end", "def execute(&block)\n block.call\n end", "def execute(&block)\n block.call\n end", "def _other(*args, &block)\n Apartment::Tenant.process(other_customer.tenant_name) do\n block.call(*args)\n end\n end", "def with_context(&block)\n Fiber.current.hammer_context = self\n block.call\n Fiber.current.hammer_context = nil\n end", "def unauth\n #raise Apartment::TenantNotFound\n nil\n end", "def clean(&block)\n if block\n @clean = block\n else\n @clean\n end\n end", "def unfreeze(&block); end", "def suspend_account\n if pending_deletion_since\n # Overwrite the value sent by the client with our server time\n self.pending_deletion_since = DateTime.now\n self.suspended_account = true\n regenerate_authentication_token\n end\n end", "def execute\n yield self if block_given?\n end", "def log_out_tenant\n \t\tsession.delete(:tenant_id)\n \t\t@current_tenant = nil\n \tend", "def teardown(&block)\n self.teardown_blocks << block\n end", "def without_locking(&block)\n current = ActiveRecord::Base.lock_optimistically\n ActiveRecord::Base.lock_optimistically = false if current\n begin\n block.call\n ensure\n ActiveRecord::Base.lock_optimistically = true if current\n end\n end", "def scope(&block)\n Videojuicer.enter_scope local_config\n block_out = block.call(Videojuicer.current_scope)\n Videojuicer.exit_scope\n return block_out\n end", "def execute(&block)\n block.call\n puts \"End of block\"\nend", "def remove_for_block(block)\n tx_hashes = []\n\n block.tx.each{|tx|\n tx_hashes << tx.hash\n # remove any now conflicted txs from the memory pool --\n # these are txs which spend outputs spent by txs in this new block. why would this happen?\n # maybe a tx in the block wasn't relayed to us but an associated double-spend was.\n self.remove_conflicts(tx)\n }\n\n # TODO: should probably transfer timestamps and other information\n Toshi::Models::UnconfirmedTransaction.remove_for_block(tx_hashes)\n Toshi::Models::UnconfirmedRawTransaction.where(hsh: tx_hashes).delete\n\n # make sure the transactions are on the tip pool (if they previously existed.)\n Toshi::Models::Transaction.where(hsh: tx_hashes)\n .update(pool: Toshi::Models::Transaction::TIP_POOL)\n end", "def unscoped\n if block_given?\n without_default_scope do\n with_scope(nil) do\n yield(self)\n end\n end\n else\n queryable.unscoped\n end\n end", "def execute(block)\n model = @wrapper.object\n block.call model\n end", "def persist_block(blk)\n raise \"Not implemented\"\n end", "def run_block\n @_block_content = nil\n unless block.blank?\n @_block_content = if view.parent.present?\n capture(view, &block)\n else\n ## We've been called directly from a controller.\n yield(view)\n end\n end\n end", "def transaction_in_staging(nested, &block)\n t = Transaction.new(self.staging, nested, &block)\n t.actor = self.actor\n t.perform\n end", "def execute_in_protected_mode(&block)\n run_as_user do\n shield.with_protected_mode(&block)\n end\n end", "def destroy\n @block.destroy\n\n head :no_content\n end", "def delete_blocked\n end", "def execute_block(block)\n case\n when block.is_a?(Symbol)\n send(block)\n when block.respond_to?(:call) && (block.arity == 1 || block.arity == -1)\n block.call(self)\n else\n block\n end \n end", "def runblock\r\n\t\t\t@b.call\r\n\t\tend", "def runblock\r\n\t\t\t@b.call\r\n\t\tend", "def transaction(&block)\n yield\n end", "def transaction(&block)\n yield\n end", "def transaction(&blk)\n tap(&blk)\n end", "def set_current_user\n AuthorizationData.current_user = current_user\n yield\n ensure\n AuthorizationData.current_user = nil\n end", "def run(&block)\n @running_template = block\n end", "def set_current_tenant_id\n Tenant.current_id = self.id\n end", "def remove_block\n block = params[:block].to_s.underscore\n @user = User.current\n # remove block in all groups\n layout = @user.pref[:my_page_layout] || {}\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n redirect_to my_page_layout_path\n end", "def remove_block\n block = params[:block].to_s.underscore\n @user = User.current\n # remove block in all groups\n layout = @user.pref[:my_page_layout] || {}\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\n @user.pref[:my_page_layout] = layout\n @user.pref.save\n redirect_to my_page_layout_path\n end", "def execute(&block)\n # block\n block.call\nend", "def record_block\n @block = true\n end", "def run_nonblock(&block)\n @timeout = 0\n run &block\n end", "def deactivate\n transaction do\n if update(active: false)\n case_assignments.update_all(active: false)\n supervisor_volunteer&.update(is_active: false)\n end\n end\n self\n end", "def call_block\n @_block.call(self) if @_block\n end", "def suspend_workspace(workspace)\n @context.workspace, back_workspace = workspace, @context.workspace\n begin\n yield back_workspace\n ensure\n @context.workspace = back_workspace\n end\n end", "def block\n @grpc.block_all_filter = true\n self\n end" ]
[ "0.6456303", "0.64423615", "0.6166946", "0.5938257", "0.58941853", "0.58114016", "0.57852954", "0.5697681", "0.5680729", "0.5643279", "0.5631496", "0.5615195", "0.55845416", "0.557084", "0.5536898", "0.55174583", "0.54833204", "0.5469118", "0.54576856", "0.5455664", "0.5452394", "0.5439234", "0.5435959", "0.5430776", "0.54214716", "0.54086953", "0.5394829", "0.5387291", "0.53792256", "0.5376501", "0.5365295", "0.53556824", "0.5337311", "0.5330764", "0.5330764", "0.53287774", "0.53216165", "0.53215575", "0.53215575", "0.53215575", "0.53146714", "0.53146714", "0.5312315", "0.5312315", "0.5312315", "0.5312315", "0.5312315", "0.5312315", "0.5312315", "0.53112394", "0.53112394", "0.5300251", "0.52933806", "0.5282167", "0.5270382", "0.52657455", "0.52652174", "0.5252989", "0.52522844", "0.52481353", "0.52481353", "0.52480197", "0.52457744", "0.5229353", "0.5229073", "0.5227368", "0.52259433", "0.5220467", "0.5205171", "0.5199104", "0.5185188", "0.51829433", "0.51743096", "0.5171084", "0.51579773", "0.51516193", "0.51478875", "0.514466", "0.5139962", "0.5115252", "0.51143914", "0.5110634", "0.510778", "0.5100763", "0.5100763", "0.5095085", "0.5095085", "0.5094622", "0.50937504", "0.509068", "0.50872964", "0.5086352", "0.5086352", "0.5082569", "0.5074898", "0.50664955", "0.5066244", "0.50591874", "0.5058576", "0.5055357" ]
0.7533424
0
The HTTP response code from the API request
def initialize(reason, response_code, response_body) super(reason) @response_code = response_code @response_body = response_body end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def code\n @http_response.code.to_i\n end", "def status_code\n @response.status\n end", "def status_code\n response_value(:code)\n end", "def response_code\n @response.code\n end", "def code\n response&.code\n end", "def code\n @response.code\n end", "def code\n @response.code.to_i\n end", "def code\n @response.code.to_i\n end", "def code\n @raw_response.code\n end", "def response_status\n @response[:status]\n end", "def response_code; end", "def response_code; end", "def response_code; end", "def response_code; end", "def response_code\n @log.debug \"Retreiving HTTP Code for website '#{@url}'\"\n\n begin\n result = Net::HTTP.get_response(@fqdn, @path).code\n @log.debug \"Received HTTP Code #{result} for website '#{@url}'\"\n rescue SocketError\n @log.error \"Communication problem with '#{@fqdn}'--possibly a DNS error. Cannot check status!\"\n result = \"200\"\n end\n\n return result\n end", "def http_status\n self[:status_code]\n end", "def get_http_response_code\n raise 'To be implemented in child classes'\n end", "def status_code\n data.status_code\n end", "def code\n self.response_code # .to_s\n end", "def getStatusCode\n @_statusCode\n end", "def status\n response.status\n end", "def status\n response.status\n end", "def status_code\n wrapper.status_code.to_i\n end", "def http_err_code\n http_codes[@http_err]\n end", "def status\n response.status\n end", "def http_code\n '000'\n end", "def code\n @code ||= @net_http_res.code.to_i\n end", "def status_code\n @parser.status_code\n end", "def status_code\n return manual_status_code if manual_status_code\n return 422 if errors.present?\n return 200 if result\n return 400\n end", "def http_response_code(status = nil)\n if status\n @status = status\n else\n @status\n end\n end", "def status_code\n STATUS_CODE\n end", "def status_code; end", "def status\n self.operation.response.statusCode\n end", "def get_response_status\n @response_status\n end", "def ok_status_code\n _undefined\n end", "def get_response_status(response)\n case response\n when Net::HTTPSuccess\n :ok\n when Net::HTTPRedirection\n :multiple_choices\n when Net::HTTPNotFound\n :not_found\n when Net::HTTPClientError\n :bad_request\n when Net::HTTPServerError\n :internal_server_error\n else\n :bad_request\n end\n end", "def status_code\n @data[:status_code].to_i\n end", "def response_status\n fetch_response.status\n end", "def to_i\n @status_code\n end", "def client_error_status_code\n _undefined\n end", "def status\n http_client.status\n end", "def http_status\n self.class.http_status\n end", "def http_status\n self.class.http_status\n end", "def extract_error_code response\n return unless response\n return unless response['data'] && response['data'].class == Hash\n return unless response['data']['errorCode']\n\n response['data']['errorCode'].to_i\n end", "def status_code\n @status_code || errors.empty? ? 200 : 422\n end", "def http_request_code(url, type, payload = {}.to_json, header = nil)\n response = http_request_generic(url, type, payload, header)\n response.code\n end", "def status(code)\n response.status = code\n end", "def server_error_status_code\n _undefined\n end", "def compute_response_code_to_return(j, response)\n # default to the restClient value\n rc = response.code\n if Hash.try_convert(j)\n # if the whole thing in an error response then pull out the contents\n # of the error response.\n if j.has_key?('ErrorResponse')\n j=j['ErrorResponse']\n end\n # if there is a nested response code then use that.\n if j.has_key?('responseCode')\n rc = j['responseCode']\n end\n end\n logger.debug \"#{self.class.to_s}:#{__method__}:#{__LINE__}: use response code: [#{rc}]\"\n rc\n end", "def status_code\n self.status.to_i\n end", "def status\n @status ||= raw_response['responseHeader']['status']\n end", "def status\n @response && @response.status\n end", "def code_symbol\n HTTP_STATUS_CODES[status]\n end", "def error_code\n @request['error']['code'].to_i\n end", "def response_to_status(response)\n response ? :success : :error\n end", "def ok?\n\n if @http_raw_response.kind_of? Net::HTTPNoContent\n #if there is no content expected, use HTTP code\n 204 == @http_status_code\n else\n # otherwise use API status\n @http_raw_response.kind_of? Net::HTTPOK and 0 == @api_status.to_i\n end\n end", "def response_code\n if @response.code.to_i != 404 && is_fake_404?\n return \"#{@response.code.to_s} Possible fake 404\"\n else\n return @response.code.to_s\n end\n end", "def cvv2_resp_code\n params['x_cvv2_resp_code']\n end", "def status_code\n params[:code] || 500\n end", "def status_code\n params[:code] || 500\n end", "def http_status_line(code = 200)\n \"#{HTTP_VERSION} #{code} #{Shelf::Utils::HTTP_STATUS_CODES[code]}\"\n end", "def cvv2_resp_code\n params['x_cvv2_resp_code']\n end", "def response_status(kind)\n response.headers['status'] = kind.to_s\n end", "def response\n @search = RestClient.get @url\n @status_code = @search.code\n return output\n end", "def get_http_status line\n is_http_status?(line) ? line.to_i : nil\n end", "def http_status exception\n http_status = nil\n if defined?(ActionDispatch::ExceptionWrapper) &&\n ActionDispatch::ExceptionWrapper.respond_to?(\n :status_code_for_exception\n )\n http_status =\n ActionDispatch::ExceptionWrapper.status_code_for_exception(\n exception.class.name\n )\n end\n\n http_status\n end", "def check_response\n unless (res = get).valid?\n raise BadResponse, \"#{res.code} #{res['Code'].first}\"\n end\n\n res\n end", "def validate_response(response) # :nodoc:\n code = response.code.to_i\n raise HttpError, \"#{code} #{response.msg}\" if code < 200 || code > 299\n end", "def status(code)\n @response.status = code\n end", "def status_code; 422; end", "def status_code; 422; end", "def status_code; 422; end", "def status_code; 422; end", "def status\n last_response.status\nend", "def derived_status_code\n\t\t# If there's a non-empty entity body, or the content length has been set explicitly\n\t\t# to something non-zero, assume the response is OK\n\t\tif self.body.size.nonzero? ||\n\t\t (self.header.content_length && self.header.content_length.nonzero?)\n\t\t\treturn HTTP::OK\n\n\t\t# otherwise set it to 204\n\t\telse\n\t\t\treturn HTTP::NO_CONTENT\n\t\tend\n\tend", "def challenge_response(challenge_code)\n {\n :body => challenge_code,\n :status => 200\n }\n end", "def status code=nil\n @response.status = code if code\n @response.status\n end", "def response_status\n fetch_or_cache.status\n end", "def index\n head params[:response_status]\n end", "def is200\n (Net::HTTPSuccess === response)\n end", "def analyse_http_code(response_code)\n case response_code\n when 1 then\n # Failure to use the proxy\n return false\n when 400 .. 403 then\n # Proxy asks for authentication\n return false\n when 407 then\n # Proxy asks for authentication\n return false\n when 444 then\n return response_code\n else\n # If we get a valid return code, we add it to the final list\n return response_code\n end\n end", "def status_code\n DivaServicesApi::Algorithm.by_id(self.id, self) if @status_code == nil\n @status_code\n end", "def image_http_status(uri)\r\n puts \"Requesting Image: #{uri}\"\r\n http = Net::HTTP.new(uri.host, uri.port)\r\n response = http.head(uri.path)\r\n return response.code\r\n rescue\r\n return \"500\"\r\n end", "def ok?\n @result.code.to_i != 200\n end", "def http_response\n return @http_response\n end", "def is_http_status? code\n (200..206).to_a.concat((300..307).to_a).concat((400..417).to_a) \\\n .concat((500..505).to_a).include? code.to_i\n end", "def get_http_status exception\n http_status = nil\n if defined?(ActionDispatch::ExceptionWrapper) &&\n ActionDispatch::ExceptionWrapper.respond_to?(\n :status_code_for_exception\n )\n http_status =\n ActionDispatch::ExceptionWrapper.status_code_for_exception(\n exception.class.name\n )\n end\n\n http_status\n end", "def status\n HTTParty.get(base_request_uri)\n end", "def secondary_response_code\r\n params['src']\r\n end", "def assert_response(expected)\n response.code.to_i.should == Rack::Utils.status_code(expected)\nend", "def status\n head :ok\n end", "def status\n head :ok\n end", "def status_code_for_exception(exception)\n Egregious.status_code_for_exception(exception)\n end", "def get_response()\n if has_errors?\n return get_error_response()\n end\n @values[\"RESPONSE\"]\n end", "def status\n @json_body['status']\n end", "def http_success?(code)\n http_status?(:success, code)\n end", "def get_integer\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/response/integer'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url\n )\n _response = execute_request(_request)\n\n # Validate response against endpoint and global error codes.\n return nil if _response.status_code == 404\n validate_response(_response)\n\n # Return appropriate response type.\n _response.raw_body.to_i\n end", "def validate_http_response! resp\n\t\tif resp['content-length']\n\t\t\tassert_equal resp['content-length'].to_i, resp.body.to_s.bytesize,\n\t\t\t\t\"Content-length mis-match in reply!\"\n\t\tend\n\n\t\tc = resp.code.to_i\n\n\t\tcase c\n\t\twhen 100, 101, 305, 402, 407, 500..505\n\t\t\tassert false,\n\t\t\t\t\"Nacreon is not supposed to return HTTP status code #{c}.\"\n\t\twhen 200, 202, 203, 300, 400, 403, 404, 406, 408..411, 414..417\n\t\t\t# There's not a lot that is both required and verifiable for these\n\t\t\t# statuses.\n\t\twhen 201\n\t\t\tassert_has_header resp, 'location'\n\t\twhen 204\n\t\t\tassert_empty_body resp\n\t\twhen 205\n\t\t\tassert_empty_body resp\n\t\twhen 206\n\t\t\tassert_has_header resp, 'content-range'\n\t\t\tassert_has_header resp, 'date'\n\t\twhen 301, 302, 307\n\t\t\t# Technically not *required* by the spec, but I feel pretty\n\t\t\t# good about ensuring that these responses have a Location.\n\t\t\tassert_has_header resp, 'location'\n\t\twhen 304\n\t\t\tassert_empty_body resp\n\t\twhen 401\n\t\t\tassert_has_header resp, 'www-authenticate'\n\t\twhen 405\n\t\t\tassert_has_header resp, 'allow'\n\t\telse\n\t\t\tassert false, \"Nacreon returned invalid HTTP/1.1 status code #{c}!\"\n\t\tend\n\tend", "def status\n params['ret_status']\n end", "def status_code(status_symbol = :ok)\n Rack::Utils::SYMBOL_TO_STATUS_CODE[status_symbol]\n end", "def success_code\n @success_code\n end" ]
[ "0.85397816", "0.8427251", "0.83017254", "0.8298403", "0.80762947", "0.8063064", "0.7990457", "0.7990457", "0.7946691", "0.7862803", "0.7841888", "0.7841888", "0.7841888", "0.7841888", "0.78373325", "0.7779508", "0.77710736", "0.77131903", "0.76733774", "0.7647536", "0.76079315", "0.76079315", "0.7587144", "0.7557881", "0.7494173", "0.7493154", "0.74771255", "0.74502265", "0.74465334", "0.74322927", "0.73898375", "0.7386998", "0.73364913", "0.7335325", "0.7228695", "0.7219013", "0.71916133", "0.7182277", "0.7179818", "0.71277106", "0.70506436", "0.70376927", "0.70376927", "0.703708", "0.7034956", "0.7025788", "0.6949954", "0.6887988", "0.68687624", "0.6864672", "0.6862379", "0.68489045", "0.67427456", "0.67367804", "0.6733795", "0.67275983", "0.67001206", "0.66986156", "0.6671954", "0.6671954", "0.6669893", "0.66562665", "0.6648995", "0.6640842", "0.66227096", "0.6602694", "0.65939426", "0.65897834", "0.6581075", "0.65727526", "0.65727526", "0.65727526", "0.65727526", "0.6566554", "0.65659297", "0.6558789", "0.6553031", "0.65481937", "0.6542216", "0.6516423", "0.6514869", "0.64805984", "0.6477695", "0.64735097", "0.64564455", "0.64497817", "0.6447001", "0.64456725", "0.6412649", "0.64009917", "0.63989055", "0.63989055", "0.6380347", "0.6362478", "0.63615566", "0.63493675", "0.6330362", "0.63149065", "0.6309184", "0.63049453", "0.6304712" ]
0.0
-1
Return long name if present, otherwise short name
def default_name [long_name, short_name].reject(&:empty?).first end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def short_name\n @short_name ||= name.to_s.split('').shift\n end", "def long_name\n if @description\n @name + ' ' + @description\n else\n @name\n end\n end", "def short_name\n if abbreviation.nil? then\n return name\n else\n return abbreviation\n end\n end", "def canonical_long_name\n if respond_to?(:verbose_name)\n verbose_name\n elsif respond_to?(:short_name)\n name\n elsif respond_to?(:description)\n description\n else\n ''\n end\n end", "def short_name\n short.to_s.sub(/^(-.).*$/, \"\\\\1\")\n end", "def short_name\r\n return \"#{first_name[0].chr}. #{last_name}\"\r\n end", "def shortname\n @shortname.nil? ? @name : @shortname\n end", "def short_name\n full_name = \"\"\n if name.present?\n full_name = name\n else\n full_name = \"#{self.first_name ? self.first_name.downcase.capitalize : \"\"} #{self.last_name ? \"#{self.last_name.first.upcase}.\" : \"\"}\"\n end\n\n full_name\n end", "def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend", "def short_name\n \"#{first_name} #{last_name[0, 1]}\"\n end", "def shortname\n attributes['shortName']\n end", "def smart_name\n return '' if short_name.blank? && long_name.blank?\n\n (short_name.blank? ? long_name.strip : short_name.strip)\n end", "def short_name\n puts \"Jai shree mahakal\"\n end", "def long_name\n long.to_s.sub(/^(--.+?)(\\s+|\\=|\\[).*$/, \"\\\\1\")\n end", "def short_name\n short = name[0..30]\n if name.length > 30\n short += '...'\n end\n short\n end", "def short_name\n name.size > 35 ? \"#{name[0..35]}...\" : name\n end", "def to_s\n short || name[0]\n end", "def shortname\n name.downcase.gsub(/[^a-z]/, \"-\")\n end", "def canonical_short_name\n if respond_to?(:short_name)\n short_name\n elsif respond_to?(:name)\n name\n elsif respond_to?(:title)\n title\n end\n end", "def full_name\n name\n end", "def get_full_name\n \"#{name} (#{description})\"\n end", "def get_full_name\n description\n end", "def long_name\n name = ''\n if @name.to_s =~ /_/\n @name.to_s.split('_').each do |str|\n name << str.to_s.capitalize\n end\n else\n name = @name.to_s.capitalize\n end\n namespace = @namespace.to_s.split('::').map { |str| str.capitalize }\n \"#{namespace.join('::')}::#{name}\"\n end", "def rest_name\n short_name.downcase\n end", "def full_name\n '(unknown)'\n end", "def my_short_name\n @my_short_name ||= self.class.name.split(\"_\").last\n end", "def full_name\n if original_name.blank? || name.blank?\n original_name || name\n else\n \"#{original_name} - #{name}\"\n end\n end", "def get_short_name\n sname = description.split(/trofeo|meeting/i)\n if sname.length > 1\n # Remove spaces, split in tokens, delete empty tokens and take just the first 3, joined together:\n (sname[1].strip.split(/\\s|\\,/).delete_if { |item| item == '' })[0..2].join(' ')\n else\n # Just use the name if it wasn't \"splittable\":\n sname[0]\n end\n end", "def shortName\n self.short_name\n end", "def long_name\n [number, title].join(' ')\n end", "def long_name\n [number, title].join(' ')\n end", "def shortname\n name.downcase.gsub(/[^a-z]/, \"\")\n end", "def full_name\n get_attribute(Yoti::Attribute::FULL_NAME)\n end", "def to_s\n longname\n end", "def name\n short_code\n end", "def full_name\n self.name ? \"#{self.name.split(' ')[0..-2].join(' ')}, #{self.name.split(' ')[-1]}\" : ''\n end", "def full_name\n name\n end", "def get_full_name\n description.to_s\n end", "def name(type=:short)\n if type == :short && !nickname.blank?\n nickname\n elsif type == :short && displayName\n first, last = displayName.split\n \"#{first} #{last[0]}\"\n elsif type == :full && displayName\n displayName\n else\n umbcusername\n end\n end", "def to_s\n short_name\n end", "def long_name\n self.get_column(LONG_NAME_FIELD)\n end", "def full_name()\n @name.to_s\n end", "def get_full_name\n # [Steve, 20140725] Too long/repetitive: \"#{description} #{header_year} - #{get_federation_type}\"\n description\n end", "def full_name\n [prefix, name, suffix].join(\"\")\n end", "def full_name\n return \"#{make.name} #{name}\"\n end", "def display_name\n\t\tself.short_name\n\tend", "def get_full_name\n self.description.to_s\n end", "def full_name\n # TODO: update method -> \"${name}, ${last_name}\"\n name\n end", "def short_name\n self.abbrv.to_s.empty? ? self.name : self.abbrv\n end", "def get_full_name\n \"#{self.name} (desc.: #{self.description})\"\n end", "def shortName\n name = @dir_ent['name'][0, 8].strip\n ext = @dir_ent['name'][8, 3].strip\n name += \".\" + ext if ext != \"\"\n return name\n end", "def full_name\n @full_name ||= calculate_full_name\n end", "def short_name \r\n name.gsub(/([A-Z])[^A-Z]+/, '\\1')\r\n end", "def full_name\n\t\ts = title\n\t\ts = \"#{artist.name} - #{s}\" if artist\n\t\treturn s\n\tend", "def full_name\n \"#{name} #{first_last_name} #{second_last_name}\"\n end", "def full_name\n if self.suffix.present?\n \"#{self.first_name} #{self.last_name}, #{self.suffix}\"\n else\n \"#{self.first_name} #{self.last_name}\"\n end\n end", "def display_name\n full_name.join(\" \")\n end", "def full_name\n self.name\n end", "def full_name\n self.name\n end", "def full_name\n name_tuple.full_name\n end", "def show_full_name\n name\n end", "def simple_name\n full_name.last\n end", "def full_name\n @full_name ||= \"#{parent_name}#{pretty_name}\"\n end", "def full_name\n \"#{ owner }/#{ name }\" if owner && name\n end", "def full_name\n f_name + \" \" + l_name \n end", "def shortname\n\n # Get all servers, that share the same firstname\n doppelgangers = Server.where(firstname: firstname).where.not(id: id).to_a\n return firstname unless doppelgangers.size > 0\n\n # Generate an abbreviation of the lastname until there is noone who shares\n # the same start.\n last = ''\n lastname.each_char do |c|\n last += c\n doppelgangers = doppelgangers.select{ |d| d.lastname.starts_with?(last) }\n break unless doppelgangers.size > 0\n end\n\n # Only apply a dot if the lastname was actually shortend.\n last == lastname ? \"#{firstname} #{lastname}\" : \"#{firstname} #{last}.\"\n end", "def full_name\n \"#{nombre} #{apellidos}\"\n end", "def human_from_name; end", "def suggested_short_name(language=nil)\n (language && @short_name.find { |name| name.language == language }) || @short_name\n end", "def conform_name_to_shortname(name = nil)\n name ||= self.name\n name.to_s.downcase.strip.gsub(/[^a-z0-9]+/, \"-\").gsub(/^-|-$/, \"\")\n end", "def conform_name_to_shortname(name = nil)\n name ||= self.name\n name.to_s.downcase.strip.gsub(/[^a-z0-9]+/, \"-\").gsub(/^-|-$/, \"\")\n end", "def full_name\n get_full_name\n end", "def longName\n return nil if @lfn_ents == nil\n name = \"\"\n @lfn_ents.reverse.each {|ent| name += getLongNameFromEntry(ent)}\n return name\n end", "def format_name\n put_together_name(:full)\n end", "def short_name\n self.get_column(\"Entry_ID/Short_Name\")\n end", "def get_full_name\n self.name.to_s\n end", "def full_name\n return @full_name if @full_name\n if primitive_is_complex? name\n full_name = primitives[name]['name']\n debug \"Using full name '#{full_name}' for complex primitive '#{name}'\"\n @full_name = full_name\n else\n @full_name = name\n end\n end", "def label\n key.sub('fullname', 'full name').capitalize\n end", "def full_name\n if @prefix != \"\"\n File.join(@prefix, @name)\n else\n @name\n end\n end", "def conform_name_to_shortname(name = nil)\n name ||= self.name\n name.to_s.downcase.lstrip.rstrip.gsub(/[^a-z0-9]+/, '-').gsub(/^-|-$/,'')\n end", "def conform_name_to_shortname(name = nil)\n name ||= self.name\n name.to_s.downcase.lstrip.rstrip.gsub(/[^a-z0-9]+/, '-').gsub(/^-|-$/,'')\n end", "def get_full_name\n title\n end", "def switch_name\n (long.first || short.first).sub(/\\A-+(?:\\[no-\\])?/, '')\n end", "def short_place_name\n # Drop the last word, it is always the legal description.\n words = place_name.split\n words.slice!(-1) if words.size > 1\n words.join(' ')\n end", "def name\n \"#{number}: #{short_name}\"\n end", "def short_name\n if segments.empty?\n ''\n elsif segments.length == 1\n segments[0]\n else\n segments[1..-1].join(SEPARATOR)\n end\n end", "def full_name\n @full_name ||= \"#{@parent ? @parent.full_name : '(unknown)'}#{pretty_name}\"\n end", "def name\n full_name\n end", "def full_name\n \"#{@name}-#{@version}\"\n end", "def full_name\n \tif !self.first_name.nil? && !self.last_name.nil?\n\t\t\"#{self.first_name.titleize} #{self.last_name.titleize}\"\n\telsif !self.oauth_user_name.nil?\n\t\tself.oauth_user_name\n\telse\n\tend\n end", "def get_full_name()\n self.name.to_s\n end", "def get_full_name()\n self.name.to_s\n end", "def name\n # If you activate lib/String.rb enable the next line\n # spec.full_name.or_else(login_name)\n spec.full_name\n end", "def full_name\n \t\t\"#{nombre} #{apellido}\"\n\tend", "def long_string\n \"#{name}\"\n end", "def long_name\n \"#{ancestors_name} #{name}\"\n end", "def full_name()\n name + ' ' + last_name\n end", "def small_name\n \"#{first_name.to_s.titleize} #{last_name.to_s.first.upcase}.\"\n end", "def fullname\n '%s @ %s-%s' % [name.titleize, realm.titleize, region.upcase]\n end", "def short_name\n self.name.demodulize\n end" ]
[ "0.8192987", "0.81694853", "0.8148014", "0.80879205", "0.80730504", "0.7966315", "0.78832483", "0.78677773", "0.7752153", "0.7751644", "0.7712652", "0.771214", "0.7684387", "0.7666926", "0.76540005", "0.76325667", "0.76071835", "0.7587982", "0.7561847", "0.7558614", "0.7535754", "0.75265384", "0.75045425", "0.7482403", "0.7464944", "0.74619853", "0.74538696", "0.7443935", "0.74291646", "0.74180114", "0.74180114", "0.74107414", "0.7406462", "0.7401997", "0.7369531", "0.7365909", "0.73647", "0.73586154", "0.7351508", "0.73488235", "0.7340003", "0.7339896", "0.7274293", "0.72732294", "0.72729194", "0.7272829", "0.726001", "0.7240813", "0.7224626", "0.7222369", "0.72033215", "0.7202141", "0.7172742", "0.7166324", "0.71475637", "0.71453404", "0.71365184", "0.7130304", "0.7130304", "0.7130002", "0.71233064", "0.7096135", "0.70762354", "0.70621717", "0.7054152", "0.7047731", "0.70473343", "0.7037454", "0.7032193", "0.70303494", "0.70303494", "0.7028292", "0.7026646", "0.7023822", "0.70176446", "0.7006711", "0.7005202", "0.70005065", "0.7000439", "0.69909406", "0.69909406", "0.698766", "0.6985542", "0.6982509", "0.697823", "0.69770986", "0.697313", "0.69728935", "0.6967754", "0.6962452", "0.69417083", "0.69417083", "0.6936666", "0.6932443", "0.69286597", "0.6920303", "0.69196963", "0.69076914", "0.6905153", "0.6889646" ]
0.79724157
5
Extract short flag name
def short_name short.to_s.sub(/^(-.).*$/, "\\1") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def short_flag_syntax\n @short_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :short }\n end", "def shortname\n attributes['shortName']\n end", "def get_flag_name(flag)\n if flag.start_with?(\"--no-\")\n flag[5..-1]\n elsif flag.start_with?(\"--\")\n flag[2..-1]\n else\n raise \"Assertion error: we're here by mistake\"\n end\nend", "def extract_flag(p, flag)\n breakdown = flag.split(\"*\")\n if flag.match(/^---.*/)\n parse_error! p, \"Flags must be prefixed with two hyphens (-); #{flag} has more than that.\"\n end\n\n if breakdown.length > 2\n parse_error! p, \"The flag #{flag} can have only one *. * is used to indicate the short flag name.\"\n end\n prefix, suffix = breakdown\n if suffix\n if suffix.length == 0\n parse_error! p, \"The flag #{flag} has a short-name indicator (*) at the end of the flag. This special character should be placed before the letter you wish to use as the short name for the flag.\"\n end\n short = suffix.slice(0)\n suffix = suffix.slice(1..-1)\n flag = \"#{prefix}#{short}#{suffix}\"\n else\n short = nil\n end\n # TODO validate all caps, plus optional surrounding matched [ ] around arg\n flag_arg = p.advance_token == :EOL ? nil : p.current_token\n if (p.peek_token != :EOL)\n parse_error! p, \"#{flag} can take at most one argument, but more than one is provided.\"\n end\n description = parse_command_definition_description(p.parser_from_children)\n flag = CommandFlag.new(flag, flag_arg, short, description)\n end", "def switch_name\n (long.first || short.first).sub(/\\A-+(?:\\[no-\\])?/, '')\n end", "def option_parser_short_name\n [ short_prefix, short_name ].join('')\n end", "def short_name\n @short_name ||= name.to_s.split('').shift\n end", "def short_name\n if abbreviation.nil? then\n return name\n else\n return abbreviation\n end\n end", "def to_s\n short || name[0]\n end", "def name\n short_code\n end", "def long_name\n long.to_s.sub(/^(--.+?)(\\s+|\\=|\\[).*$/, \"\\\\1\")\n end", "def full_name(bitname = :_reg, _options = {})\n bitname, options = :_reg, bitname if bitname.is_a?(Hash)\n desc = description(bitname).first\n # Capture something like this:\n # ** This is the full name ** - This bit blah blah\n if desc && desc =~ /\\s*\\*\\*\\s*([^\\*.]*)\\s*\\*\\*/\n Regexp.last_match[1].strip\n end\n end", "def short_name\n self.abbrv.to_s.empty? ? self.name : self.abbrv\n end", "def short_for_optparse\n (arg and long.nil?) ? (\"%s %s\" % [short, arg]) : short\n end", "def short\n @short\n end", "def format_flag(flag)\n if flag.length == 1\n \" -#{flag}\"\n else\n \" --#{flag.to_s.tr('_', '-')}\"\n end\n end", "def to_s\n short_name\n end", "def shortName\n self.short_name\n end", "def get_short_name\n @state_org_id.to_s + \" LEA\"\n end", "def opt_in_flag\n member_supplementry_histories.first.opt_in_flag.strip rescue \"\"\n end", "def short_name( fn )\n #puts \"Calculate short name for #{fn}\\n\"\n return fn if ARCH != 'w32'\n fn.gsub!( /\\//, \"\\\\\" )\n buffer = ' ' * 260\n length = ShortPName.call( fn, buffer, buffer.size )\n fn = buffer.slice(0..length-1) if length > 0\n fn.gsub!( /\\\\/, '/' )\n return fn\nend", "def shortname\n @shortname.nil? ? @name : @shortname\n end", "def get_short\n get(2).unpack('s')\n end", "def get_short_name\n sname = description.split(/trofeo|meeting/i)\n if sname.length > 1\n # Remove spaces, split in tokens, delete empty tokens and take just the first 3, joined together:\n (sname[1].strip.split(/\\s|\\,/).delete_if { |item| item == '' })[0..2].join(' ')\n else\n # Just use the name if it wasn't \"splittable\":\n sname[0]\n end\n end", "def my_short_name\n @my_short_name ||= self.class.name.split(\"_\").last\n end", "def short_name\n self.get_column(\"Entry_ID/Short_Name\")\n end", "def describe_flags(flags,format)\n d = ''\n flags.keys.each { |f|\n if f=='c' then\n if format=='tex' then f=\"$\\\\int$\" end\n if format=='plain' then f=\"(calculus)\" end\n if format=='html' then f=\"&int;\" end\n end\n if f=='s' && format=='tex' then f=\"${}_\\\\textup{s}$\" end\n d=d+f unless f=='o'\n }\n return d\nend", "def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend", "def short_flag_exist?(flag)\n flags.select { |f| f.short == flag }.any?\n end", "def shortdesc\n @obj['shortdesc']\n end", "def shortname\n name.downcase.gsub(/[^a-z]/, \"-\")\n end", "def shortName\n name = @dir_ent['name'][0, 8].strip\n ext = @dir_ent['name'][8, 3].strip\n name += \".\" + ext if ext != \"\"\n return name\n end", "def canonical_short_name\n if respond_to?(:short_name)\n short_name\n elsif respond_to?(:name)\n name\n elsif respond_to?(:title)\n title\n end\n end", "def get_short_name\n \"(#{get_scheduled_date}, #{event_order}) #{event_type.i18n_short} #{get_category_type_code} #{gender_type.i18n_short}\"\n end", "def short_name \r\n name.gsub(/([A-Z])[^A-Z]+/, '\\1')\r\n end", "def short_name\n puts \"Jai shree mahakal\"\n end", "def short_name\n short = name[0..30]\n if name.length > 30\n short += '...'\n end\n short\n end", "def xlate_flags()\n flags = []\n flags.push('More') if (flag_more?)\n flags.push('Start') if (flag_start?)\n flags.push('Stop') if (flag_stop?)\n flags.push('Watchdog') if (flag_watchdog?)\n return(\"#{flags.join(',')}\") if (flags.length != 0)\n return(\"None\")\n end", "def short_name\n @context.name\n end", "def flag_name_and_value\n \"#{self.name}-#{self.value}\"\n end", "def short_state_str\n SHORT_MARKETPLACEAPP_STATES[state_str]\n end", "def flags(path)\n info = file_info(path)[1]\n return \"\" if info.nil?\n info\n end", "def short_state_str\n SHORT_VN_STATES[state_str]\n end", "def shortdesc\n @data['shortdesc']\n end", "def shortname\n name.downcase.gsub(/[^a-z]/, \"\")\n end", "def name()\n return Vocab::optimize_modes_strings[@v_index][0]\n end", "def rest_name\n short_name.downcase\n end", "def short_name(str)\n res = str.scan(/\\w+/).map { |w| w[0,1] }.join(\"\")\n res.empty? ? \"a\" : res\n end", "def flag_to_string(flag)\n if flag.is_a?(Hash)\n flag.map do |key, value|\n \"#{flag_to_string(key)} #{value}\"\n end\n else\n str = flag.to_s\n str = \"--#{str}\" unless str.start_with?('--')\n str\n end\n end", "def cardinal_abbreviation; end", "def normalize_switch raw_switch_arg\n (@shorts[raw_switch_arg] || raw_switch_arg).tr(\"_\", \"-\")\n end", "def summary\n return desc.to_s.inspect unless desc.empty?\n flags.map(&:display_name).inspect\n end", "def team_name_with_flag(flag_size: 32, flag_position: 'left')\n flag = teamflag(flag_size)\n case flag_position\n when 'left'\n raw \"#{flag} #{@team.name}\"\n when 'right'\n raw \"#{@team.name} #{flag}\"\n else\n raise \"Wrong flag_position #{flag_position}\"\n end\n end", "def key\n key = config[:key] || flags.last.sub(/\\A--?/, '')\n key = key.tr '-', '_' if underscore_flags?\n key.to_sym\n end", "def expanded_name; end", "def get_make_var flag\n m = match Regexp.new(\"^#{flag}[ \\\\t]*=[ \\\\t]*(.*)$\")\n return m[1] if m\n return nil\n end", "def get_make_var flag\n m = match Regexp.new(\"^#{flag}[ \\\\t]*=[ \\\\t]*(.*)$\")\n return m[1] if m\n return nil\n end", "def short_name\n name.size > 35 ? \"#{name[0..35]}...\" : name\n end", "def convert_short_name\n self.short_name = self.short_name.parameterize\n true # So the save doesn't give up?\n end", "def rcwef_short(name)\n char = name.chars.first.downcase\n case char\n when 'r', 'c'\n LOW\n when 'w'\n MEDIUM\n when 'e', 'f'\n HIGH\n else\n LOW\n end\n end", "def flags\n [long, short].compact\n end", "def short_name\n self.name.demodulize\n end", "def spec_short_name\n return self.spec.to_s.sub(\"#{ModMap.specs}::\", '')\n end", "def short_name\n if segments.empty?\n ''\n elsif segments.length == 1\n segments[0]\n else\n segments[1..-1].join(SEPARATOR)\n end\n end", "def dashed_flag_for setting_name, flag_name=nil\n return unless Settings[setting_name]\n flag_name ||= setting_name\n (Settings[setting_name] == true ? \"--#{flag_name.to_s.gsub(/_/,\"-\")}\" : \"--#{flag_name.to_s.gsub(/_/,\"-\")}=#{Settings[setting_name]}\" )\n end", "def expanded_name\n @expanded_name ||= tools_identifier.to_s\n end", "def feature_flag_for(flag_name)\n opt = get_flag_option(flag_name)\n opt.present? ? opt.value : FeatureFlag.find_by(name: flag_name)&.default_value\n end", "def use_short_names\n opts = get_options\n opts['uselongnames']=false\n save_file(opts)\n nil\n end", "def flag(short_name, long_name, description, &block)\n\t\t\treturn define_value(short_name, long_name, description, true, false, block)\n\t\tend", "def short_name_mapping\n @@short_name_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [v[\"short\"], k] }]\n end", "def short_state_str\n SHORT_HOST_STATES[state_str]\n end", "def short\n rid\n end", "def name\n \"#{number}: #{short_name}\"\n end", "def detailed_name\n \"#{label} ( #{name}_V#{version} )\"\n end", "def suggested_short_name(language=nil)\n (language && @short_name.find { |name| name.language == language }) || @short_name\n end", "def long_flag_syntax\n @long_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :long }\n end", "def dashed_flag_for setting_name, flag_name=nil\n return unless self[setting_name]\n flag_name ||= setting_name\n (self[setting_name] == true ? \"--#{flag_name.to_s.gsub(/_/,\"-\")}\" : \"--#{flag_name.to_s.gsub(/_/,\"-\")}=#{self[setting_name]}\" )\n end", "def short_description\n object.description[0..40] if object.description.present?\n end", "def short; end", "def canonical_long_name\n if respond_to?(:verbose_name)\n verbose_name\n elsif respond_to?(:short_name)\n name\n elsif respond_to?(:description)\n description\n else\n ''\n end\n end", "def short_description\n if respond_to?(:short_desc)\n short_desc\n else\n tag.to_s\n end\n end", "def short_title(title)\n return \"\" unless title.present?\n case title\n when \"IM\" then \"m\"\n when \"WIM\" then \"wm\"\n else title.sub(/M$/, \"\").downcase\n end\n end", "def shortname\n\t\treturn self.class.shortname\n\tend", "def flags\n match(/Flags\\s+:\\s+(.+)$/).split rescue []\n end", "def flags\n match(/Flags\\s+:\\s+(.+)$/).split rescue []\n end", "def form_flagstring(f, fall)\n\t\tflagSelectAll = (!fall.nil? && fall.to_s.downcase == \"all\")\n\t\tif(flagSelectAll || f.nil? || f.empty?)\n\t\t\tflagStr = \"all\"\n\t\telse\n\t\t\tflagStr = f.join(\"|\")\n\t\tend\n\n\t\treturn flagStr\n\tend", "def display_name\n\t\tself.short_name\n\tend", "def flag_color(flag)\n if flag.name == \"important\" # important\n \"bl_bookmarks__item--flag__important ion-record\"\n elsif flag.name == \"very important\" # very important\n \"bl_bookmarks__item--flag__very-important ion-record\"\n elsif flag.name == \"normal\" # normal\n \"bl_bookmarks__item--flag__normal ion-record\"\n end\n end", "def lame_flag_map\n { '--tt': :title,\n '--ta': :artist,\n '--tl': :album,\n '--ty': :year,\n '--tn': :t_num,\n '--tg': :genre }\n end", "def get_training_mode_type_name(verbose_level = :short)\n return '' unless training_mode_type\n\n if verbose_level.to_sym == :short\n training_mode_type.i18n_short\n else\n training_mode_type.i18n_alternate\n end\n end", "def name\n source.longname\n end", "def half_wind_abbreviation; end", "def short_name\n Category.short_name name\n end", "def get_option(option_name)\n\t\toption = nil\n\t\t# Could use ternary conditional expressions here (bool ? true_value : false_value) but chose not to for readability\n\t\tif use_short_option?(option_name)\n\t\t\tdebug_log \"Short version has been flagged for option: #{option}\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"-b\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\telse\n\t\t\tdebug_log \"Short version not flagged for option: #{option}. Using long version.\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"--badge\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\tend\n\n\t\treturn option\n\n\tend", "def getOptionsBanner\r\n return '[--name <MixName>]*'\r\n end", "def flag\n flags.join(\", \")\n end", "def flag_for(tag)\n return @flags.detect { |flag| flag.tag == tag}\n end", "def short=(value)\n raise ArgumentError, _(\"Short names can only be one character.\") if value.to_s.length != 1\n @short = value.to_s\n end", "def short_name\r\n return \"#{first_name[0].chr}. #{last_name}\"\r\n end", "def default_name\n [long_name, short_name].reject(&:empty?).first\n end" ]
[ "0.70970756", "0.6883467", "0.68212366", "0.66350996", "0.65941924", "0.6583177", "0.6568417", "0.6537411", "0.64376515", "0.63963157", "0.63786507", "0.63360435", "0.6285403", "0.61831075", "0.6121038", "0.61187553", "0.6074511", "0.6068014", "0.60516274", "0.60179263", "0.5994391", "0.5993506", "0.5988007", "0.5985291", "0.59748566", "0.597374", "0.59545636", "0.59438264", "0.5940896", "0.5940865", "0.5935688", "0.5902648", "0.58973235", "0.5896344", "0.58787334", "0.58783257", "0.5876834", "0.5864826", "0.58296597", "0.5804116", "0.5771369", "0.5759045", "0.57188916", "0.5714766", "0.57054317", "0.57041574", "0.5677782", "0.56755704", "0.56601006", "0.5645633", "0.5644848", "0.56422555", "0.56391937", "0.5630832", "0.5621534", "0.5617568", "0.5617568", "0.56014216", "0.56005955", "0.5596023", "0.5593471", "0.5587243", "0.5580686", "0.5568604", "0.5538317", "0.5530697", "0.5524079", "0.5521444", "0.551647", "0.5516272", "0.5506549", "0.5504263", "0.5503912", "0.5497616", "0.54833937", "0.5480983", "0.5478344", "0.5472966", "0.54663754", "0.5457222", "0.54567057", "0.5456491", "0.54558516", "0.54521596", "0.54521596", "0.5448779", "0.5444338", "0.54303503", "0.5422784", "0.5415102", "0.5406059", "0.5391621", "0.5388131", "0.5383156", "0.53820336", "0.53741676", "0.5370671", "0.53659606", "0.53599745", "0.5344666" ]
0.6882232
2
Extract long flag name
def long_name long.to_s.sub(/^(--.+?)(\s+|\=|\[).*$/, "\\1") end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def long_flag_syntax\n @long_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :long }\n end", "def get_flag_name(flag)\n if flag.start_with?(\"--no-\")\n flag[5..-1]\n elsif flag.start_with?(\"--\")\n flag[2..-1]\n else\n raise \"Assertion error: we're here by mistake\"\n end\nend", "def long_opt_symbol(args); end", "def long_name\n self.get_column(LONG_NAME_FIELD)\n end", "def long_for_optparse\n (arg and not(long.nil?)) ? (\"%s %s\" % [long, arg]) : long\n end", "def longName\n return nil if @lfn_ents == nil\n name = \"\"\n @lfn_ents.reverse.each {|ent| name += getLongNameFromEntry(ent)}\n return name\n end", "def extract_flag(p, flag)\n breakdown = flag.split(\"*\")\n if flag.match(/^---.*/)\n parse_error! p, \"Flags must be prefixed with two hyphens (-); #{flag} has more than that.\"\n end\n\n if breakdown.length > 2\n parse_error! p, \"The flag #{flag} can have only one *. * is used to indicate the short flag name.\"\n end\n prefix, suffix = breakdown\n if suffix\n if suffix.length == 0\n parse_error! p, \"The flag #{flag} has a short-name indicator (*) at the end of the flag. This special character should be placed before the letter you wish to use as the short name for the flag.\"\n end\n short = suffix.slice(0)\n suffix = suffix.slice(1..-1)\n flag = \"#{prefix}#{short}#{suffix}\"\n else\n short = nil\n end\n # TODO validate all caps, plus optional surrounding matched [ ] around arg\n flag_arg = p.advance_token == :EOL ? nil : p.current_token\n if (p.peek_token != :EOL)\n parse_error! p, \"#{flag} can take at most one argument, but more than one is provided.\"\n end\n description = parse_command_definition_description(p.parser_from_children)\n flag = CommandFlag.new(flag, flag_arg, short, description)\n end", "def long_str # :nodoc:\n long ? Utils.prefix_long(long, '[no-]') : ''\n end", "def switch_name\n (long.first || short.first).sub(/\\A-+(?:\\[no-\\])?/, '')\n end", "def short_flag_syntax\n @short_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :short }\n end", "def long_name\n [number, title].join(' ')\n end", "def long_name\n [number, title].join(' ')\n end", "def getLongNameFromEntry(ent)\n pre_name = \"\"; hashNames = %w(name name2 name3)\n hashNames.each {|name|\n n = ent[\"#{name}\"]\n\n # Regexp.new options used below:\n # nil (default options: not case insensitive, extended, multiline, etc.)\n # 'n' - No encoding on the regexp\n regex = Regexp.new('\\377', nil, 'n')\n pre_name += n.gsub(regex, \"\").UnicodeToUtf8.gsub(/\\000/, \"\")\n }\n return pre_name\n end", "def long_name\n if @description\n @name + ' ' + @description\n else\n @name\n end\n end", "def to_s\n longname\n end", "def format_flag(flag)\n if flag.length == 1\n \" -#{flag}\"\n else\n \" --#{flag.to_s.tr('_', '-')}\"\n end\n end", "def xlate_flags()\n flags = []\n flags.push('More') if (flag_more?)\n flags.push('Start') if (flag_start?)\n flags.push('Stop') if (flag_stop?)\n flags.push('Watchdog') if (flag_watchdog?)\n return(\"#{flags.join(',')}\") if (flags.length != 0)\n return(\"None\")\n end", "def lame_flag_map\n { '--tt': :title,\n '--ta': :artist,\n '--tl': :album,\n '--ty': :year,\n '--tn': :t_num,\n '--tg': :genre }\n end", "def get_short_name\n @state_org_id.to_s + \" LEA\"\n end", "def short_for_optparse\n (arg and long.nil?) ? (\"%s %s\" % [short, arg]) : short\n end", "def full_name(bitname = :_reg, _options = {})\n bitname, options = :_reg, bitname if bitname.is_a?(Hash)\n desc = description(bitname).first\n # Capture something like this:\n # ** This is the full name ** - This bit blah blah\n if desc && desc =~ /\\s*\\*\\*\\s*([^\\*.]*)\\s*\\*\\*/\n Regexp.last_match[1].strip\n end\n end", "def short_name\n short.to_s.sub(/^(-.).*$/, \"\\\\1\")\n end", "def long_string\n \"#{name}\"\n end", "def longdesc\n @obj['longdesc']\n end", "def canonical_long_name\n if respond_to?(:verbose_name)\n verbose_name\n elsif respond_to?(:short_name)\n name\n elsif respond_to?(:description)\n description\n else\n ''\n end\n end", "def combined_name_too_long_label\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.span.id(\"/valNameLengthLast$/\"), format_method(__method__))\n end", "def team_name_with_flag(flag_size: 32, flag_position: 'left')\n flag = teamflag(flag_size)\n case flag_position\n when 'left'\n raw \"#{flag} #{@team.name}\"\n when 'right'\n raw \"#{@team.name} #{flag}\"\n else\n raise \"Wrong flag_position #{flag_position}\"\n end\n end", "def use_long_names\n opts = get_options\n opts['uselongnames']=true\n save_file(opts)\n nil\n end", "def describe_flags(flags,format)\n d = ''\n flags.keys.each { |f|\n if f=='c' then\n if format=='tex' then f=\"$\\\\int$\" end\n if format=='plain' then f=\"(calculus)\" end\n if format=='html' then f=\"&int;\" end\n end\n if f=='s' && format=='tex' then f=\"${}_\\\\textup{s}$\" end\n d=d+f unless f=='o'\n }\n return d\nend", "def flags\n [long, short].compact\n end", "def longdesc\n @data['longdesc']\n end", "def option_parser_short_name\n [ short_prefix, short_name ].join('')\n end", "def opt_in_flag\n member_supplementry_histories.first.opt_in_flag.strip rescue \"\"\n end", "def flag(short_name, long_name, description, &block)\n\t\t\treturn define_value(short_name, long_name, description, true, false, block)\n\t\tend", "def flags(path)\n info = file_info(path)[1]\n return \"\" if info.nil?\n info\n end", "def flags\n match(/Flags\\s+:\\s+(.+)$/).split rescue []\n end", "def flags\n match(/Flags\\s+:\\s+(.+)$/).split rescue []\n end", "def flag_name_and_value\n \"#{self.name}-#{self.value}\"\n end", "def make_flag(options)\n\tflagString=\" \"\n\tif(options.list != nil)\n\t\tflagString+=\" -l\"\n\tend\n\tif(options.all != nil)\n\t\tflagString+= \" -a\"\n\tend\n\treturn flagString\nend", "def flags\n [long, negative_long, short].compact\n end", "def long_name\n name = ''\n if @name.to_s =~ /_/\n @name.to_s.split('_').each do |str|\n name << str.to_s.capitalize\n end\n else\n name = @name.to_s.capitalize\n end\n namespace = @namespace.to_s.split('::').map { |str| str.capitalize }\n \"#{namespace.join('::')}::#{name}\"\n end", "def flag\n flags.join(\", \")\n end", "def flag_color(flag)\n if flag.name == \"important\" # important\n \"bl_bookmarks__item--flag__important ion-record\"\n elsif flag.name == \"very important\" # very important\n \"bl_bookmarks__item--flag__very-important ion-record\"\n elsif flag.name == \"normal\" # normal\n \"bl_bookmarks__item--flag__normal ion-record\"\n end\n end", "def test_long_text()\n\t pg_lyr = create_poly_layer(@pg_ds)\n\t\tcreate_crazy_key\n \n \t\tpg_lyr.set_attribute_filter( \"PRFEDEA = 'CrazyKey'\" )\n feat_read = pg_lyr.get_next_feature()\n\n assert_not_nil(feat_read, 'creating crazy feature failed!' )\n\n short_name = feat_read.get_field('shortname') \n assert_equal('Crazy\"\\'L', short_name,\n\t\t\t\t\t\t\t \"Value not properly escaped or truncated: #{short_name}\")\n\tend", "def shortname\n attributes['shortName']\n end", "def name\n short_code\n end", "def get_short\n get(2).unpack('s')\n end", "def key\n key = config[:key] || flags.last.sub(/\\A--?/, '')\n key = key.tr '-', '_' if underscore_flags?\n key.to_sym\n end", "def should_use_long_names?\n opts = get_options\n opts['uselongnames']\n end", "def long_key\n {'EXP'=>'Experimental Assay','MODEL'=>'Modelling Analysis'}[key]\n end", "def get_parm_named(long_form)\n return @parm_names[long_form]\n end", "def long_name\n \"#{ancestors_name} #{name}\"\n end", "def matching_flag_strings\n @flags.map do |_flag, flag_syntax, negative|\n negative ? flag_syntax.negative_flag : flag_syntax.positive_flag\n end\n end", "def form_flagstring(f, fall)\n\t\tflagSelectAll = (!fall.nil? && fall.to_s.downcase == \"all\")\n\t\tif(flagSelectAll || f.nil? || f.empty?)\n\t\t\tflagStr = \"all\"\n\t\telse\n\t\t\tflagStr = f.join(\"|\")\n\t\tend\n\n\t\treturn flagStr\n\tend", "def flag_to_string(flag)\n if flag.is_a?(Hash)\n flag.map do |key, value|\n \"#{flag_to_string(key)} #{value}\"\n end\n else\n str = flag.to_s\n str = \"--#{str}\" unless str.start_with?('--')\n str\n end\n end", "def get_make_var flag\n m = match Regexp.new(\"^#{flag}[ \\\\t]*=[ \\\\t]*(.*)$\")\n return m[1] if m\n return nil\n end", "def get_make_var flag\n m = match Regexp.new(\"^#{flag}[ \\\\t]*=[ \\\\t]*(.*)$\")\n return m[1] if m\n return nil\n end", "def expanded_name\n @expanded_name ||= tools_identifier.to_s\n end", "def short_name\n short = name[0..30]\n if name.length > 30\n short += '...'\n end\n short\n end", "def long_help\n execute_string(\"-longhelp\")\n end", "def name\n source.longname\n end", "def long_name?(seed)\n ((seed.first) & 0x40) != 0\n end", "def name()\n return Vocab::optimize_modes_strings[@v_index][0]\n end", "def longest_string\n walker.push(revision)\n shas = walker.map(&:oid)\n Shamazing.string_from_array(shas)\n end", "def short_flag_exist?(flag)\n flags.select { |f| f.short == flag }.any?\n end", "def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend", "def get_flag_option(flag_name)\n feature_flag_options.find_by(name: flag_name, feature_flaggable_type: self.class.name, feature_flaggable_id: id)\n end", "def get_option(option_name)\n\t\toption = nil\n\t\t# Could use ternary conditional expressions here (bool ? true_value : false_value) but chose not to for readability\n\t\tif use_short_option?(option_name)\n\t\t\tdebug_log \"Short version has been flagged for option: #{option}\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"-b\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\telse\n\t\t\tdebug_log \"Short version not flagged for option: #{option}. Using long version.\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"--badge\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\tend\n\n\t\treturn option\n\n\tend", "def two_word_name; end", "def var_name()\n if self.id.start_with?(/\\Ah?l_/i)\n return self.id.downcase\n else\n return \"l_#{self.id.downcase}\"\n end\n end", "def name_record_long(type, ext_ref) #:nodoc:\n record = 0x0018 # Record identifier\n length = 0x002a # Number of bytes to follow\n\n grbit = 0x0020 # Option flags\n chkey = 0x00 # Keyboard shortcut\n cch = 0x01 # Length of text name\n cce = 0x001a # Length of text definition\n unknown01 = 0x0000 #\n ixals = @worksheet.index + 1 # Sheet index\n unknown02 = 0x00 #\n cch_cust_menu = 0x00 # Length of cust menu text\n cch_description = 0x00 # Length of description text\n cch_helptopic = 0x00 # Length of help topic text\n cch_statustext = 0x00 # Length of status bar text\n rgch = type # Built-in name type\n\n unknown03 = 0x29\n unknown04 = 0x0017\n unknown05 = 0x3b\n\n header = [record, length].pack(\"vv\")\n data = [grbit].pack(\"v\")\n data += [chkey].pack(\"C\")\n data += [cch].pack(\"C\")\n data += [cce].pack(\"v\")\n data += [unknown01].pack(\"v\")\n data += [ixals].pack(\"v\")\n data += [unknown02].pack(\"C\")\n data += [cch_cust_menu].pack(\"C\")\n data += [cch_description].pack(\"C\")\n data += [cch_helptopic].pack(\"C\")\n data += [cch_statustext].pack(\"C\")\n data += [rgch].pack(\"C\")\n\n # Column definition\n data += [unknown03].pack(\"C\")\n data += [unknown04].pack(\"v\")\n data += [unknown05].pack(\"C\")\n data += [ext_ref].pack(\"v\")\n data += [0x0000].pack(\"v\")\n data += [0xffff].pack(\"v\")\n data += [@col_min].pack(\"v\")\n data += [@col_max].pack(\"v\")\n\n # Row definition\n data += [unknown05].pack(\"C\")\n data += [ext_ref].pack(\"v\")\n data += [@row_min].pack(\"v\")\n data += [@row_max].pack(\"v\")\n data += [0x00].pack(\"v\")\n data += [0xff].pack(\"v\")\n # End of data\n data += [0x10].pack(\"C\")\n\n [header, data]\n end", "def get_short_name\n sname = description.split(/trofeo|meeting/i)\n if sname.length > 1\n # Remove spaces, split in tokens, delete empty tokens and take just the first 3, joined together:\n (sname[1].strip.split(/\\s|\\,/).delete_if { |item| item == '' })[0..2].join(' ')\n else\n # Just use the name if it wasn't \"splittable\":\n sname[0]\n end\n end", "def gen_name\n \n \"markerOption_#{@@count}\"\n end", "def flag(name,aliases,desc,long_desc,default_value,arg_name,must_match,type)\n invocations = ([name] + Array(aliases)).map { |_| add_dashes(_) }.join('|')\n usage = \"#{invocations} #{arg_name || 'arg'}\"\n @io.puts \"#{@nest}=== #{usage}\"\n @io.puts\n @io.puts String(desc).strip\n @io.puts\n @io.puts \"[Default Value] #{default_value || 'None'}\"\n @io.puts \"[Must Match] #{must_match.to_s}\" unless must_match.nil?\n @io.puts String(long_desc).strip\n @io.puts\n end", "def expanded_name; end", "def long_appearance\n # How Med does it:\n # description\n # glance\n # eq\n # inventory\n \"{!{FG#{description}\\n\\n{FY{#{short_name} is in excellent condition.\"\n end", "def short_name\n @short_name ||= name.to_s.split('').shift\n end", "def to_s\n short || name[0]\n end", "def short_name\n self.get_column(\"Entry_ID/Short_Name\")\n end", "def short_name( fn )\n #puts \"Calculate short name for #{fn}\\n\"\n return fn if ARCH != 'w32'\n fn.gsub!( /\\//, \"\\\\\" )\n buffer = ' ' * 260\n length = ShortPName.call( fn, buffer, buffer.size )\n fn = buffer.slice(0..length-1) if length > 0\n fn.gsub!( /\\\\/, '/' )\n return fn\nend", "def description\n \"lane #{self.lane} name #{self.clean_name}\"\n end", "def project_identifier(p, length=26)\n truncate([p.shortname, p.description].join(\" - \"), :length => length)\n end", "def short_name\n name.size > 35 ? \"#{name[0..35]}...\" : name\n end", "def name\n return mode_desc\n end", "def short_name\n if abbreviation.nil? then\n return name\n else\n return abbreviation\n end\n end", "def report_flags\n self.has_links? ? ret = \"L\" : ret = \"l\"\n self.has_jlinks? ? ret += \"J\" : ret += \"j\"\n self.has_form? ? ret += \"F\" : ret += \"f\"\n self.has_comments? ? ret += \"C\" : ret += \"c\"\n return ret\n end", "def flag(name,aliases,desc,long_desc,default_value,arg_name,must_match,type)\n abstract!\n end", "def gene_id\n description.andand.match(/ GN=(\\w+) ?/)[1]\n end", "def long_description\n @ole.LongDescription\n end", "def flag_for(tag)\n return @flags.detect { |flag| flag.tag == tag}\n end", "def parse_flags(msg)\n msg.scan(/-(\\w+)\\s*([^-]+)?/)\n .uniq{ |e| e[0] }\n .map{ |k, v| [k, v.nil? ? nil : v.squish] }\n .to_h\n .symbolize_keys\nend", "def cardinal_abbreviation; end", "def feature_flag_for(flag_name)\n opt = get_flag_option(flag_name)\n opt.present? ? opt.value : FeatureFlag.find_by(name: flag_name)&.default_value\n end", "def generate_cli_flags\n @flags.map{|pair| pair.join(' ')}.join(' ').gsub(' true','')\n end", "def detailed_name\n \"#{label} ( #{name}_V#{version} )\"\n end", "def flag(name, aliases, desc, long_desc, default_value, arg_name, must_match, _type)\n invocations = ([name] + Array(aliases)).map { |_| \"`\" + add_dashes(_) + \"`\" }.join(' | ')\n usage = \"#{invocations} #{arg_name || 'arg'}\"\n @io.puts header(usage, 2)\n @io.puts\n @io.puts String(desc).strip\n @io.puts \"\\n*Default Value:* `#{default_value || 'None'}`\\n\" unless default_value.nil?\n @io.puts \"\\n*Must Match:* `#{must_match.to_s}`\\n\" unless must_match.nil?\n cmd_desc = String(long_desc).strip\n @io.puts \"> #{cmd_desc}\\n\" unless cmd_desc.length == 0\n @io.puts\n end", "def show_elf_flags\n\t\t\t\tputs \" Flags: #{@elf_flags.to_h}\"\n\t\tend", "def three_word_name; end", "def switches\n [short, long].map(&:to_s)\n end", "def rolf_desc\n name_descriptions(:peltigera_alt_desc)\n end" ]
[ "0.71888006", "0.6685242", "0.63991433", "0.63319576", "0.6254689", "0.62044317", "0.61581546", "0.6124005", "0.6112861", "0.6086082", "0.60566664", "0.60566664", "0.60408974", "0.602815", "0.5951273", "0.5927557", "0.5922415", "0.59057003", "0.58458316", "0.57825786", "0.57721525", "0.57645077", "0.57534456", "0.5746884", "0.5724365", "0.5724285", "0.57154715", "0.5677194", "0.5663791", "0.5629574", "0.56027555", "0.55828714", "0.555183", "0.554576", "0.55245394", "0.55201536", "0.55201536", "0.5518145", "0.55114233", "0.55036", "0.5493412", "0.5493213", "0.5492752", "0.54891586", "0.54755473", "0.54679066", "0.5453252", "0.54470843", "0.542642", "0.5422435", "0.5416547", "0.5400205", "0.5397619", "0.5395559", "0.53917706", "0.53650254", "0.53650254", "0.53642285", "0.53559107", "0.53382784", "0.5326828", "0.5322313", "0.53190136", "0.53057915", "0.52982783", "0.52912086", "0.52727634", "0.5267449", "0.52653277", "0.52615255", "0.5260646", "0.52536756", "0.5247608", "0.5241165", "0.5240278", "0.52366036", "0.52038634", "0.5203652", "0.5199693", "0.5199311", "0.51887286", "0.5177401", "0.51734376", "0.5172189", "0.5171106", "0.5167355", "0.51636374", "0.51617545", "0.5160704", "0.51599425", "0.5147959", "0.51406664", "0.5137617", "0.5127782", "0.511818", "0.5109848", "0.510455", "0.5100257", "0.50996226", "0.50915813" ]
0.7618007
0
Check if argument is required
def argument_required? !short.to_s.match(SHORT_ARGUMENT_REQUIRED_RE).nil? || !long.to_s.match(LONG_ARGUMENT_REQUIRED_RE).nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def has_missing_required_arg?\n !missing_required_arguments.empty?\n end", "def expects_argument?\n config[:argument] && config[:argument] != :optional\n end", "def arguments_valid?\n true # no required arguments\n end", "def expects_argument?\n true\n end", "def arg_required(*args)\n args.each{|obj| raise ArgumentError, \"Argument cannot be nil\" if obj.nil? }\n end", "def required\n !!parameter[:required]\n end", "def required_args_present?(metric, args)\n (@metrics[metric]['required'] - args.keys).empty?\n end", "def required?(name); end", "def arguments_valid?\n true \n # to do\n end", "def has_required?; end", "def required?\n true\n end", "def arguments_valid?\n true \n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if @arguments.length == 1 \n end", "def required *args\n @required = args.first if args.size > 0\n end", "def includes_arguments?\n !default_data.empty? || !flags.empty? ||\n !required_args.empty? || !optional_args.empty? ||\n !remaining_arg.nil? || flags_before_args_enforced?\n end", "def verify_required_param(param)\n raise WhmArgumentError.new(\"Missing required parameter: #{param}\") unless @options.has_key?(param) \n raise WhmArgumentError.new(\"Required parameter cannot be blank: #{param}\") if (@options[param].nil? || (@options[param].respond_to?(:empty?) && @options[param].empty?))\n end", "def arguments_valid?\n true\n end", "def valid_argument? name, type\n if name.nil? || name.empty? || name == type\n shell.say(\"ERROR: Invalid/missing argument.\") and false\n else\n true\n end\n end", "def arguments_valid?\n # Should be no remaining arguments\n true if @arguments.length == 0\n end", "def arguments_valid?\n true if @arguments.size >= 1 \n end", "def arguments_valid?\n # TODO - implement your real logic here\n true # if @arguments.length == 1\n end", "def named_arg_required(name, obj)\n named_arg_required('name', name) unless name.eql?('name')\n raise ArgumentError, \"Argument \\\"#{name}\\\" cannot be nil\" if obj.nil?\n end", "def arguments_valid?\n # TO DO - implement some real logic here\n true if @arguments.length == 1 \n end", "def check_requirement!(*args)\n args_length = args.length\n required_length = @required.length\n\n if args_length < required_length\n raise ArgumentError, \"Wrong number of arguments \" \\\n \"(#{args_length} for #{required_length}). \" \\\n \"Expected `#{@required.join(', ')}` as required arguments, \" \\\n \"but got `#{args.join(\", \")}`.\"\n end\n end", "def arguments_valid?\n true\n end", "def valid_args?(args={})\n valid = false\n arguments.each do |name, argument|\n if argument[:required]\n return false if args[name] == nil\n end\n valid = argument.valid_input?(args[name])\n end\n return valid\n end", "def ensure_param(arg)\n params[arg.to_sym].present?\n end", "def required?\n @required\n end", "def missing_required_arguments\n model.arguments.find_all do |arg|\n arg_sym = arg.name.to_sym\n if arguments.has_key?(arg_sym)\n TaskArguments.delayed_argument?(arguments.fetch(arg_sym))\n else\n arg.required?\n end\n end\n end", "def arguments_valid?\n ret = false\n ret = true unless (@options.action == nil)\n end", "def argument?; end", "def required?\n @required\n end", "def required?\n @required\n end", "def required?\n @required\n end", "def required?\n @required\n end", "def valid?(setup)\n setup.args.length >= required_args && (max_args == -1 || setup.args.length <= max_args)\n end", "def required?\n options[:required] == true\n end", "def arguments_valid?\n\t\t # TO DO - implement your real logic here\n\t\t true if @arguments.length == 1\n\t\tend", "def required?\n\t\t@required\n\tend", "def wrong_num_parameters?\n (ARGV.size != 1)\n end", "def arguments_valid?\n true if @arguments.size > 1\n end", "def required? #:nodoc:\n options[:required]\n end", "def required?\n @required\n end", "def arguments_given?\n !@arguments.empty?\n end", "def required_args\n @required_args || 0\n end", "def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend", "def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend", "def validate_args (args)\n\t# todo\nend", "def required?\n @required == true\n end", "def validate_arguments()\n usage unless ARGV.count > 0\nend", "def _pv_required(opts, key, is_required=true)\n if is_required\n if (opts.has_key?(key.to_s) && !opts[key.to_s].nil?) ||\n (opts.has_key?(key.to_sym) && !opts[key.to_sym].nil?)\n true\n else\n raise Exceptions::ValidationFailed, \"Required argument #{key} is missing!\"\n end\n end\n end", "def _validate_presence_of(*params)\n\t\tparams.each do |param|\n\t\t\traise ArgumentError, PRESENCE_REQUESTED if param.nil?\n\t\tend\n\tend", "def check_params; true; end", "def required?\n @required\n end", "def require_arg(args, name)\r\n unless args.key?(name) then\r\n raise ArgumentError.new(\"Missing argument #{name}.\")\r\n end\r\n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if @arguments.length == 2\n end", "def required?\n (required == true)\n end", "def arguments_valid?\n true if ['install','list','uninstall'].include?(@arguments[0])\n end", "def required?\n !optional?\n end", "def required?\n required.any?\n end", "def required_args\n args.select &:required\n end", "def valid_arguments?\n arguments_passed? && right_type?\n end", "def has_required?\n false\n end", "def validate_required(*required_parameters)\n if self[:ensure] == :present\n required_parameters.each do |req_param|\n raise ArgumentError, \"parameter '#{req_param}' is required\" if self[req_param].nil?\n end\n end\n end", "def validate_required(*required_parameters)\n if self[:ensure] == :present\n required_parameters.each do |req_param|\n raise ArgumentError, \"parameter '#{req_param}' is required\" if self[req_param].nil?\n end\n end\n end", "def validate_required(*required_parameters)\n if self[:ensure] == :present\n required_parameters.each do |req_param|\n raise ArgumentError, \"parameter '#{req_param}' is required\" if self[req_param].nil?\n end\n end\n end", "def ensure_params(*req)\n missing = []\n req.flatten.each do |param|\n if params[param].blank?\n missing << param.to_s\n end\n end\n if missing.empty?\n return false\n else\n msg = \"Following params are required but missing: \" + missing.join(\", \")\n render_api_error(11 , 400, 'params', msg)\n return true\n end\n end", "def required; end", "def required; end", "def required; end", "def setup_args_valid?(argsArr)\r\n if nil==argsArr[0] or argsArr[0]==\"\"\r\n return \"Bot token cannot be empty or nil.\"\r\n elsif nil==argsArr[1] or argsArr[1]==\"\"\r\n return \"Bot clientId cannot be empty or nil.\"\r\n elsif nil==argsArr[2]\r\n return \"Bot command prefix cannot be nil.\"\r\n end\r\n\r\n return nil\r\n end", "def optional?\n\t\t!required?\n\tend", "def test_arg_check_prospectors_valid\n ret = arg_check_prospectors '1'\n assert_equal ret, 0\n end", "def accepts_optional_argument?\n config[:optional_argument] || config[:argument] == :optional\n end", "def optional?\n !@required\n end", "def test_missing_argument_invalid_argument\n\t\tc = Check.new\n\t\trefute c.check_arguments([1,1,'s'])\n\tend", "def action_argument_required?\n !AVAILABLE_ACTIONS.empty?\n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if (1..2).include? @arguments.length \n end", "def arguments_passed?\n !!(ARGV[0] && ARGV[1] && ARGV[2])\n end", "def validate_params_present!\n raise ArgumentError, \"Please provide one or more of: #{ACCEPTED_PARAMS}\" if params.blank?\n end", "def check_arguments\n if (@ec2_user_id.nil? || @aws_access_key_id.nil? || @aws_secret_access_key.nil? || @host_role.nil? || ! ( @do_snapshot || @do_restore )) then\n raise ArgumentError, \"Missing command line parameter\"\n end\n end", "def validate_arguments\n if(!@options.parse || !@@sections.include?(@options.parse))\n @log.error \"select one of the following to parse: #{@@sections.join(\"|\")}\"\n exit!\n end\n \n if(!@options.download && !@options.file)\n @log.error \"Select either to download the file remotely or supply the given file\"\n exit!\n end\n \n if(!@options.output)\n @log.error \"supply an output directory with -o\"\n exit!\n end\n \n return true\n end", "def argument_optional?\n !short.to_s.match(SHORT_ARGUMENT_OPTIONAL_RE).nil? ||\n !long.to_s.match(LONG_ARGUMENT_OPTIONAL_RE).nil?\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n exit!\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n exit!\n end\n rescue LoadError => bam\n @log.error bam\n exit!\n end\n \n return true\n end", "def arguments_valid?\n # right now, there is no set of invalid arguments.\n # (can I really just say true here? I don't have to return something?)\n true unless (@options.set_status == true and @options.status == nil)\n end", "def check_arg()\n if ARGV.length > 1\n print \"ERROR: Too many command line args.\\n\"\n print \"USAGE: #{$PROGRAM_NAME} [--FixThemAll]\\n\"\n exit ERR_EXIT_ARGS2MANY\n end\n if ARGV.length == 1 && ARGV[0] != '--FixThemAll'\n print \"ERROR: Invalid argument on command line: '#{ARGV[0]}'\\n\"\n print \"USAGE: #{$PROGRAM_NAME} [--FixThemAll]\\n\"\n exit ERR_EXIT_ARGINVALID\n end\nend", "def check_required_params\n errors = required_params.map { |param, value| raise param_errors[param] if value.nil? }.compact\n raise errors.joins('; ') unless errors.empty?\n end", "def form_arguments_check(form, field_name)\n raise ArgumentError, 'Form is required.' if form.blank?\n raise ArgumentError, 'Field name is required.' if field_name.blank?\n raise ArgumentError, 'Object is not decorated.' \\\n unless form.object.is_a? ResourceDecorator\n end", "def arguments_valid?\n true if @commands.length > 0\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "def valid_arguments?\n begin\n if(@options.file)\n raise LoadError,\"The file you specified doesn't exist: #{@options.file}\" if File.exist?(@options.file) == false\n else\n @log.error \"Select a file using -f or --file FILE\"\n end\n \n if(@options.output)\n # not going to worry about this one.\n else\n @log.error \"No output was specified select using -o or --output\"\n end\n rescue LoadError => bam\n @log.error bam\n exit\n end\n \n return true\n end", "def validate(args = {})\n end", "def ensure_params(*args)\n return catch(:truthy) {\n args.each do |arg|\n throw(:truthy, false) unless ensure_param(arg)\n end\n\n throw(:truthy, true)\n }\n end", "def args?\n\t\treturn !@form.empty?\n\tend", "def check_2_arguments_present\n if (self.required_args.nil?)\n raise \"Plugin #{self.class} says it requires args but has none listed\"\n end\n \n self.required_args.each do |arg|\n return t('dispatcher.invalid_syntax', :command => self.help_topic) if self.send(\"#{arg}\").to_s.strip.length == 0\n end\n return nil\n end", "def arguments_valid?\n valid_args = true\n valid_args = false if @options.min > @options.max\n valid_args = false if @options.user && !@options.password\n valid_args = false if @options.password && !@options.user\n valid_args\n end", "def args?\n\t\treturn !self.fields.empty?\n\tend", "def required?()\n return @is_required\n end", "def required?\n @rule == :required\n end" ]
[ "0.85271156", "0.79506236", "0.7872491", "0.78527254", "0.7667729", "0.7623648", "0.76012856", "0.75835466", "0.75435334", "0.7456895", "0.74532825", "0.74223465", "0.73832244", "0.7344997", "0.73367465", "0.73338157", "0.7332169", "0.7302913", "0.73014456", "0.72946733", "0.72776324", "0.7268958", "0.72613436", "0.72542834", "0.72394484", "0.72260916", "0.71766514", "0.7152691", "0.7141032", "0.7136076", "0.7135065", "0.7128733", "0.7128733", "0.7128733", "0.7128733", "0.7125791", "0.7121107", "0.7104671", "0.7093067", "0.7091526", "0.70897216", "0.7081879", "0.7075926", "0.7070957", "0.706907", "0.7059025", "0.70588195", "0.7050389", "0.7049456", "0.7037104", "0.7036035", "0.70275915", "0.7024308", "0.6994298", "0.6991491", "0.6983479", "0.6979085", "0.6968548", "0.69594455", "0.6949592", "0.6941331", "0.693156", "0.6927045", "0.6891692", "0.6891194", "0.6891194", "0.6878705", "0.68747336", "0.68747336", "0.68747336", "0.68608254", "0.68539137", "0.68352497", "0.68221086", "0.68001723", "0.6798753", "0.67843854", "0.6783577", "0.6778988", "0.6777908", "0.676581", "0.67641854", "0.6746859", "0.673835", "0.6738315", "0.6733468", "0.6733467", "0.6733239", "0.67264354", "0.6720545", "0.6720545", "0.6720545", "0.6690983", "0.66747797", "0.66086686", "0.6608149", "0.6602396", "0.660122", "0.66004306", "0.6598706" ]
0.7659168
5
Check if argument is optional
def argument_optional? !short.to_s.match(SHORT_ARGUMENT_OPTIONAL_RE).nil? || !long.to_s.match(LONG_ARGUMENT_OPTIONAL_RE).nil? end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accepts_optional_argument?\n config[:optional_argument] || config[:argument] == :optional\n end", "def optional?\n !!options[:optional]\n end", "def optional?\n !@required\n end", "def optional?\n\t\t!required?\n\tend", "def optional?\n not required\n end", "def optional?\n @optional\n end", "def expects_argument?\n config[:argument] && config[:argument] != :optional\n end", "def has_missing_required_arg?\n !missing_required_arguments.empty?\n end", "def required?\n !optional?\n end", "def optional?\n @rule == :optional\n end", "def optional?\n required.empty? && required_keywords.empty?\n end", "def optional?\n instance_variable_defined?(\"@optional\") ? @optional : false\n end", "def includes_arguments?\n !default_data.empty? || !flags.empty? ||\n !required_args.empty? || !optional_args.empty? ||\n !remaining_arg.nil? || flags_before_args_enforced?\n end", "def optional?\n not (@required or @forbidden)\n end", "def required\n !!parameter[:required]\n end", "def is_command_line_arg_empty(arg)\n arg.nil? or arg.empty?\nend", "def argument_required?\n !short.to_s.match(SHORT_ARGUMENT_REQUIRED_RE).nil? ||\n !long.to_s.match(LONG_ARGUMENT_REQUIRED_RE).nil?\n end", "def arguments_valid?\n true # no required arguments\n end", "def optional; end", "def option?(param)\n param[0] == \"-\"\n end", "def missing_option=(_arg0); end", "def missing_option=(_arg0); end", "def missing_option=(_arg0); end", "def missing_option=(_arg0); end", "def missing_option=(_arg0); end", "def missing_option=(_arg0); end", "def optionality_implied?\n false\n end", "def build_optionals?(opt)\n opt.each do |attr, value|\n return true unless value.blank?\n end\n\n return false\n end", "def optional?\n return config[:optional]\n end", "def method_with_optional_param(param = foo)\nend", "def _optional\n @optional & [*@opts[:extra_fields]].map(&:to_sym)\n end", "def has_option?(arg)\n !!find_option(arg)\n end", "def optional?\n @default || (@default.nil? && @optional)\n end", "def has_multiparameter_defaults?(args)\n args.size > 1 && args.last.is_a?(Hash) && !args.last.has_key?(:field_type)\n end", "def arguments_valid?\n ret = false\n ret = true unless (@options.action == nil)\n end", "def has?(param)\n \tparam and param.length > 0\n end", "def expects_argument?\n true\n end", "def arguments_valid?\n # Should be no remaining arguments\n true if @arguments.length == 0\n end", "def arguments_given?\n !@arguments.empty?\n end", "def no_args_provided?\n @no_args_provided ||= no_args_provided\n end", "def optional\n @optional = true\n end", "def argument?; end", "def valid_or_optional?(value)\n value.nil? ? ! required? : yield\n end", "def example_optional(x: Integer?)\n x.to_s\nend", "def with_optional_clause?(spec)\n !spec.exclude_clause.nil? || !spec.include_clause.nil?\n end", "def wrong_num_parameters?\n (ARGV.size != 1)\n end", "def required_args_present?(metric, args)\n (@metrics[metric]['required'] - args.keys).empty?\n end", "def api_has_param?(key)\n @api[:optional].has_key?(key)\n end", "def missing_args?(opts)\n !(opts[:server] && opts[:username] && opts[:api_token] &&\n ENDPOINT.keys.include?(opts[:server].to_sym))\n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if @arguments.length == 1 \n end", "def no_options_in_arguments?\n ARGV.grep(/^-/).empty? # Match args that start with - (or --). Those are the options.\n end", "def optional(*params)\n @optional = params unless params.empty?\n @optional ||= []\n end", "def required?\n options[:required] == true\n end", "def valid_params?\n params.none? do |k,v|\n v == \"\"\n end\n end", "def arguments_valid?\n true if @arguments.size >= 1 \n end", "def valid_argument? name, type\n if name.nil? || name.empty? || name == type\n shell.say(\"ERROR: Invalid/missing argument.\") and false\n else\n true\n end\n end", "def is_parm?(long_form)\n return !@parm_names[long_form].nil?\n end", "def arguments_valid?\n # TO DO - implement some real logic here\n true if @arguments.length == 1 \n end", "def required\n @optional = false\n end", "def any_args?\n @any_args\n end", "def any_args?\n @any_args\n end", "def provides_arguments?\n false\n end", "def arguments_valid?\n # TODO - implement your real logic here\n true # if @arguments.length == 1\n end", "def expects_none?(options={})\n if [:count, :maximum, :minimum, :between].any? { |k| options.has_key? k }\n matches_count?(0,options)\n else\n false\n end\n end", "def given?(field)\n !field.empty?\nend", "def no_parameters?\n @parameters.nil? or @parameters.empty?\n end", "def test_option_required\n\n # All options are optional by default\n assert(!Option.new(nil, nil).required)\n assert(!Option.new(\"-h|--help\", nil).required)\n\n # All options may be required\n assert(Option.new(nil, nil, required:true).required)\n assert(Option.new(\"-h|--help\", nil, required:true).required)\n end", "def api_optional!(args, h = params)\n args = api_parameters_to_hash(args) if args.is_a?(Array)\n\n args.each_pair { |name, cnd|\n if cnd.is_a?(Hash)\n api_optional!(cnd, h[name])\n next\n end\n\n parse_api_parameter(name, cnd, :optional, h)\n }\n end", "def has_missing_params?(required_params)\n required_params.each do |param|\n return true if params[param].blank?\n end\n false\n end", "def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend", "def check_params *required\n required.each{|p|\n params[p].strip! if params[p] and params[p].is_a? String\n if !params[p] or (p.is_a? String and params[p].length == 0)\n return false\n end\n }\n true\nend", "def args?\n\t\treturn !self.fields.empty?\n\tend", "def option_missing(opt, argv)\n raise NoOptionError, opt\n end", "def ensure_param(arg)\n params[arg.to_sym].present?\n end", "def default?\n optarg_type? || kwoptarg_type?\n end", "def arguments_valid?\n true if @arguments.size > 1\n end", "def valid_args?(args={})\n valid = false\n arguments.each do |name, argument|\n if argument[:required]\n return false if args[name] == nil\n end\n valid = argument.valid_input?(args[name])\n end\n return valid\n end", "def required? #:nodoc:\n options[:required]\n end", "def args_defined?\n @args_def && @args_def.args.size > 0\n end", "def arguments_valid?\n # TO DO - implement your real logic here\n true if @arguments.length == 2\n end", "def optional_parameters\n must_be_defined_in_derived_class\n end", "def provided?(name)\n\t\t\t\tname = name.to_sym\n\t\t\t\t(@options[name] || {})[:value] != nil\n\t\t\tend", "def verify_required_param(param)\n raise WhmArgumentError.new(\"Missing required parameter: #{param}\") unless @options.has_key?(param) \n raise WhmArgumentError.new(\"Required parameter cannot be blank: #{param}\") if (@options[param].nil? || (@options[param].respond_to?(:empty?) && @options[param].empty?))\n end", "def has_required?; end", "def has_arg?(flag)\n\t\tfp = @flag_pairs.get_value(flag)\n\t\treturn fp != nil && (@args_a.include?(flag) || @args_a.include?(fp))\n\tend", "def arguments_valid?\n\t\t # TO DO - implement your real logic here\n\t\t true if @arguments.length == 1\n\t\tend", "def arguments_valid?\n true \n # to do\n end", "def arguments_valid?\n # right now, there is no set of invalid arguments.\n # (can I really just say true here? I don't have to return something?)\n true unless (@options.set_status == true and @options.status == nil)\n end", "def optionalParameters(a,b,*c)\n #some code\nend", "def validate_parameters?\n opts = OptionParser.new\n opts.parse!(@parameters) rescue return false\n @parameters.length >= 2\n end", "def validate_arguments\n if(!@options.parse || !@@sections.include?(@options.parse))\n @log.error \"select one of the following to parse: #{@@sections.join(\"|\")}\"\n exit!\n end\n \n if(!@options.download && !@options.file)\n @log.error \"Select either to download the file remotely or supply the given file\"\n exit!\n end\n \n if(!@options.output)\n @log.error \"supply an output directory with -o\"\n exit!\n end\n \n return true\n end", "def arguments_valid?\n true \n end", "def optionalize\n without_values(nil)\n end", "def has_splat_args?\n !!(args && @args[-1] && @args[-1][0][/^\\*/])\n end", "def may?(*args)\n true\n end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end", "def missing_option; end" ]
[ "0.83359367", "0.7920013", "0.7829294", "0.77914596", "0.7682934", "0.75784296", "0.75590235", "0.7533943", "0.72397125", "0.71797913", "0.7150766", "0.7116389", "0.6851712", "0.6771379", "0.6717355", "0.6704472", "0.6704144", "0.6657489", "0.6653102", "0.66073394", "0.66024595", "0.66024595", "0.66024595", "0.66024595", "0.66024595", "0.66024595", "0.65951705", "0.6561015", "0.6536002", "0.6533061", "0.65252715", "0.6509085", "0.65055126", "0.6489664", "0.6462143", "0.6457846", "0.645466", "0.64528084", "0.6427704", "0.6419936", "0.63890696", "0.63597447", "0.6358148", "0.6353779", "0.6353295", "0.6352033", "0.6330037", "0.6305769", "0.6291344", "0.62579006", "0.6248747", "0.6247954", "0.62389916", "0.6218371", "0.62134", "0.6201247", "0.6195468", "0.619123", "0.6159509", "0.61546266", "0.61546266", "0.61428136", "0.6137748", "0.61357486", "0.61342394", "0.61299056", "0.6123075", "0.6122473", "0.6112148", "0.6111044", "0.61107254", "0.6099371", "0.6093656", "0.60911393", "0.6081866", "0.6076404", "0.60714823", "0.60587585", "0.6058377", "0.6053363", "0.60532117", "0.6027264", "0.6026567", "0.6023841", "0.6002748", "0.59994066", "0.5999066", "0.5985915", "0.5981629", "0.59778064", "0.59775287", "0.5976662", "0.59741646", "0.59651345", "0.59648156", "0.5964755", "0.5964755", "0.5964755", "0.5964755", "0.5964755" ]
0.78452957
2
Compare this option short and long names
def <=>(other) left = long? ? long_name : short_name right = other.long? ? other.long_name : other.short_name left <=> right end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def should_use_long_names?\n opts = get_options\n opts['uselongnames']\n end", "def option_parser_short_name\n [ short_prefix, short_name ].join('')\n end", "def valid_option? opt_sym\n @options_with_short_keys.key? opt_sym\n end", "def test_named_option_long_quotes_equal\n ARGV.clear and ARGV << 'bar' << '--foobar=foo foo'\n cmdr = Commander.new(app:'test', version:'0.0.1')\n cmdr.add('bar', 'bar it up', nodes:[\n Option.new('-f|--foobar=FOOBAR', 'Set foo', type:String),\n ])\n out = Sys.capture{ cmdr.parse! }.stdout.split(\"\\n\").map{|x| x.strip_color}\n assert(out.size == 2 && out.include?(\"test_v0.0.1\"))\n assert_equal('foo foo', cmdr[:bar][:foobar])\n end", "def short_for_optparse\n (arg and long.nil?) ? (\"%s %s\" % [short, arg]) : short\n end", "def canonical_option_sym opt_sym\n @options_with_short_keys[opt_sym].name.to_sym\n end", "def optparse_args\n if short\n [\"--#{name}\", \"-#{short}\", desc, :REQUIRED]\n else\n [\"--#{name}\", desc, :REQUIRED]\n end\n end", "def long_opt_symbol(args); end", "def option_names\n standard_option_names\nend", "def names\n @opt_types.keys.map {|e| undasherize e }\n end", "def sh_opts_equal?( o1, o2 )\n SH_OPT_KEYS.each do |k|\n return false if o1[k] != o2[k]\n end\n true\n end", "def canonical_long_name\n if respond_to?(:verbose_name)\n verbose_name\n elsif respond_to?(:short_name)\n name\n elsif respond_to?(:description)\n description\n else\n ''\n end\n end", "def options\n ops = {}\n @options.each_value do |data|\n if data.given?\n if !data.short_name.nil?\n ops[data.short_name] = nil\n else\n ops[data.long_name] = nil\n end\n end\n end\n return ops.keys\n end", "def test_option_key_composed_of_short_long_hint\n\n # Mal-formed named options\n #---------------------------------------------------------------------------\n $stdout.stub(:write, nil){\n\n # No long hand given, long hand is required\n assert_raises(SystemExit){Option.new(\"-s\", nil)}\n assert_raises(SystemExit){Option.new(\"-s=COMPONENTS\", nil)}\n\n # HINT can not include equal symbol\n assert_raises(SystemExit){Option.new(\"--skip=FOO=BAR\", nil)}\n assert_raises(SystemExit){Option.new(\"-s|--skip=FOO=BAR\", nil)}\n\n # Long hand form is invalid\n assert_raises(SystemExit){Option.new(\"--skip|\", nil)}\n assert_raises(SystemExit){Option.new(\"-s|skip\", nil)}\n assert_raises(SystemExit){Option.new(\"-s|=HINT\", nil)}\n assert_raises(SystemExit){Option.new(\"-s|--skip|\", nil)}\n\n # Short hand form is invalid\n assert_raises(SystemExit){Option.new(\"--skip|-s\", nil)}\n assert_raises(SystemExit){Option.new(\"-s, --skip=FOO\", nil)}\n }\n\n # Well-formed named options\n #---------------------------------------------------------------------------\n # long hand only, simple name, flag\n opt = Option.new(\"--skip\", nil)\n assert_nil(opt.hint)\n assert_equal(\"--skip\", opt.key)\n assert_equal(\"--skip\", opt.long)\n assert_nil(opt.short)\n\n # long hand only with dash in name, flag\n opt = Option.new(\"--skip-foo\", nil)\n assert_nil(opt.hint)\n assert_equal(\"--skip-foo\", opt.key)\n assert_equal(\"--skip-foo\", opt.long)\n assert_nil(opt.short)\n\n # long hand only with incoming String value\n opt = Option.new(\"--skip=HINT\", nil, type:String)\n assert_equal(\"HINT\", opt.hint)\n assert_equal(\"--skip\", opt.long)\n assert_nil(opt.short)\n\n # short/long hand simple name, flag\n opt = Option.new(\"-s|--skip\", nil)\n assert_nil(opt.hint)\n assert_equal(\"-s|--skip\", opt.key)\n assert_equal(\"-s\", opt.short)\n assert_equal(\"--skip\", opt.long)\n\n # short/long hand with incoming String value\n opt = Option.new(\"-s|--skip=HINT\", nil, type:String)\n assert_equal(\"HINT\", opt.hint)\n assert_equal(\"-s|--skip=HINT\", opt.key)\n assert_equal(\"-s\", opt.short)\n assert_equal(\"--skip\", opt.long)\n end", "def long_name\n long.to_s.sub(/^(--.+?)(\\s+|\\=|\\[).*$/, \"\\\\1\")\n end", "def filter_options\n\t\t[\n\t\t\t['short_name', 'LENGTH(name) < 4', 'Short Name'],\n\t\t\t['medium_name', ['LENGTH(name) >= ? AND LENGTH(name) <= ?', 5, 10], 'Medium Name'],\n\t\t\t['long_name', lambda { |tag| tag.name.length > 10 }, 'Long Name']\n\t\t]\n\tend", "def _analyze(arg)\n is_long = false\n is_short = false\n name = nil\n\n if arg[0..1] == '--'\n is_long = true\n name = arg[2..-1]\n elsif arg[0] == '-'\n is_short = true\n name = arg[1..-1]\n end\n\n # arg is not a long/short option, add to arguments values\n unless is_long || is_short\n @argument_values.push arg\n return true\n end\n\n unless name.nil?\n # get the name of the option, short options use the first character\n option_name = if is_short\n name[0]\n else\n name\n end\n\n option, matched = @options.get_with_alias option_name\n\n # no option by this name in options\n return nil if option.nil?\n\n # see if the type if right, short or long\n if matched.is_long && !is_long\n return nil\n elsif matched.is_short && !is_short\n return nil\n end\n\n if is_long\n if option.is_value\n # is_value needs a next argument for its value\n return nil if _peek_next.nil?\n\n @matched_options[option.name] = _peek_next\n _skip_next\n else\n option_value! option\n end\n end\n\n if is_short\n if name.size == 1 && option.is_value\n # is_value needs a next argument for its value\n return nil if _peek_next.nil?\n\n @matched_options[option.name] = _peek_next\n _skip_next\n else\n # for every character (short option) increment the option value\n name.split('').each do |n|\n short_option = @options.get n\n return nil if short_option.nil?\n\n option_value! short_option\n end\n end\n end\n end\n\n true\n end", "def expect_usage_option(short_switch, long_switch, description)\n expected_switch = \"-#{Regexp.escape(short_switch)}, --#{Regexp.escape(long_switch)}[ ]+#{Regexp.escape(description)}\"\n expect_output(Regexp.new(expected_switch))\n end", "def matching_opts(arg, list, i)\n\t\t# Returns field of all exactly or abbreviated matching options.\n\t\tm = @option.values.select { |o| o.match?(arg, list, i) == :exact }\n\t\tif m.empty?\n\t\t\t@option.values.select { |o| o.match?(arg, list, i) == :abbrev }\n\t\telse\n\t\t\tm\n\t\tend \n\tend", "def compare_opts(opts1, opts2, skipped_opts = [])\n c1 = canonicalize_opts(opts1, skipped_opts)\n c2 = canonicalize_opts(opts2, skipped_opts)\n\n # Check that they're the same\n c1 == c2\n end", "def for_option_parser\n [short, long, return_type, description].flatten.reject{ |o| o.to_s.empty? }\n end", "def long_for_optparse\n (arg and not(long.nil?)) ? (\"%s %s\" % [long, arg]) : long\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def same_options?(opts)\n opts.hash == options.hash\n end", "def suggested_short_name(language=nil)\n (language && @short_name.find { |name| name.language == language }) || @short_name\n end", "def ==(option)\n name == option.name &&\n default == option.default &&\n comment == option.comment\n end", "def opt name, desc=\"\", opts={}\n raise ArgumentError, \"you already have an argument named '#{name}'\" if @specs.member? name\n\n ## fill in :type\n opts[:type] = \n case opts[:type]\n when :flag, :boolean, :bool; :flag\n when :int, :integer; :int\n when :string; :string\n when :double, :float; :float\n when Class\n case opts[:type].to_s # sigh... there must be a better way to do this\n when 'TrueClass', 'FalseClass'; :flag\n when 'String'; :string\n when 'Integer'; :int\n when 'Float'; :float\n else\n raise ArgumentError, \"unsupported argument type '#{opts[:type].class.name}'\"\n end\n when nil; nil\n else\n raise ArgumentError, \"unsupported argument type '#{opts[:type]}'\" unless TYPES.include?(opts[:type])\n end\n\n type_from_default =\n case opts[:default]\n when Integer; :int\n when Numeric; :float\n when TrueClass, FalseClass; :flag\n when String; :string\n when nil; nil\n else\n raise ArgumentError, \"unsupported argument type '#{opts[:default].class.name}'\"\n end\n\n raise ArgumentError, \":type specification and default type don't match\" if opts[:type] && type_from_default && opts[:type] != type_from_default\n\n opts[:type] = (opts[:type] || type_from_default || :flag)\n\n ## fill in :long\n opts[:long] = opts[:long] ? opts[:long].to_s : name.to_s.gsub(\"_\", \"-\")\n opts[:long] =\n case opts[:long]\n when /^--([^-].*)$/\n $1\n when /^[^-]/\n opts[:long]\n else\n raise ArgumentError, \"invalid long option name #{opts[:long].inspect}\"\n end\n raise ArgumentError, \"long option name #{opts[:long].inspect} is already taken; please specify a (different) :long\" if @long[opts[:long]]\n\n ## fill in :short\n opts[:short] = opts[:short].to_s if opts[:short] unless opts[:short] == :none\n opts[:short] =\n case opts[:short]\n when nil\n c = opts[:long].split(//).find { |c| c !~ INVALID_SHORT_ARG_REGEX && !@short.member?(c) }\n raise ArgumentError, \"can't generate a short option name for #{opts[:long].inspect}: out of unique characters\" unless c\n c\n when /^-(.)$/\n $1\n when /^.$/\n opts[:short]\n when :none\n nil\n else\n raise ArgumentError, \"invalid short option name '#{opts[:short].inspect}'\"\n end\n if opts[:short]\n raise ArgumentError, \"short option name #{opts[:short].inspect} is already taken; please specify a (different) :short\" if @short[opts[:short]]\n raise ArgumentError, \"a short option name can't be a number or a dash\" if opts[:short] =~ INVALID_SHORT_ARG_REGEX\n end\n\n ## fill in :default for flags\n opts[:default] = false if opts[:type] == :flag && opts[:default].nil?\n\n opts[:desc] ||= desc\n @long[opts[:long]] = name\n @short[opts[:short]] = name if opts[:short]\n @specs[name] = opts\n @order << [:opt, name]\n end", "def switches\n [short, long].map(&:to_s)\n end", "def get_option(part, field, english)\n namespace = Module.nesting[1]\n part = part.to_s\n namespace.const_get(\"#{part}Names\").const_get(field).each_pair do |option, name|\n return option if english.to_s.downcase == name.to_s.downcase\n end\n return namespace.const_get(\"#{part}Default\").const_get(field)\n end", "def getopt_args\n if short\n [[\"--#{name}\", \"-#{short}\", GetoptLong::REQUIRED_ARGUMENT]]\n else\n [[\"--#{name}\", GetoptLong::REQUIRED_ARGUMENT]]\n end\n end", "def get_option(option_name)\n\t\toption = nil\n\t\t# Could use ternary conditional expressions here (bool ? true_value : false_value) but chose not to for readability\n\t\tif use_short_option?(option_name)\n\t\t\tdebug_log \"Short version has been flagged for option: #{option}\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"-b\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\telse\n\t\t\tdebug_log \"Short version not flagged for option: #{option}. Using long version.\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"--badge\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\tend\n\n\t\treturn option\n\n\tend", "def should_alias_name?(options) #:nodoc:\n if options.has_key?(:alias_name) then\n options[:alias_name]\n else\n true\n end\n end", "def inspect\n \"#<Slop::Option [-#{short} | --#{long}\" +\n \"#{'=' if expects_argument?}#{'=?' if accepts_optional_argument?}]\" +\n \" (#{description}) #{config.inspect}\"\n end", "def options_are_labeled?\n @options.any? {|option| option.label }\n end", "def use_short_names\n opts = get_options\n opts['uselongnames']=false\n save_file(opts)\n nil\n end", "def vash_key_name(*args); 'option name'; end", "def valid_options\n self::OPTIONS.map(&:to_s).join(', ')\n end", "def vash_valid_key?(x); self.class.option_name?(x); end", "def short_flag_syntax\n @short_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :short }\n end", "def short_name\n self.abbrv.to_s.empty? ? self.name : self.abbrv\n end", "def test_stringflag_as_flag\n @p.opt :xyz, \"desc\", :type => :stringflag\n @p.opt :abc, \"desc\", :type => :flag\n opts = @p.parse %w(--xyz )\n assert_equal true, opts[:xyz_given]\n assert_equal true, opts[:xyz]\n assert_equal false, opts[:abc]\n opts = @p.parse %w(--xyz --abc)\n assert_equal true, opts[:xyz_given]\n assert_equal true, opts[:xyz]\n assert_equal true, opts[:abc]\n end", "def options_other opts, colors\n\t\t\t\topts.separator \"\"\n\t\t\t\topts.separator \"Other Options: \".colorize(colors[:green])\n\n\t\t\t\t#todo -h\n\t\t\t\topts.on('-h', '--help', 'displays this screen' ) do\n\t\t\t\t\tputs opts\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\t\t#todo -w\n\t\t\t\topts.on('-w', \"displays the name of the current list\") do\n\t\t\t\t\tputs \"Working list is #{Config[:working_list_name]}\"\n\t\t\t\t\texit\n\t\t\t\tend\n\t\t\tend", "def long_flag_syntax\n @long_flag_syntax ||= flag_syntax.find_all { |ss| ss.flag_style == :long }\n end", "def valid_option_by? option_by\n %w(text value index).include? option_by\nend", "def switch_name\n (long.first || short.first).sub(/\\A-+(?:\\[no-\\])?/, '')\n end", "def common_opts(opt)\n opt.on_tail(\"-h\", \"-?\", \"--help\", \"Show this help message.\") do\n puts opt\n exit\n end\n opt.on_tail(\"-v\", \"--version\", \"Show the version.\") do\n puts \"Taverna 2 Server Ruby Gem version: #{T2Server::Version::STRING}\"\n exit\n end\n end", "def valid_options\n [:label, :reader, :reader_options, :ingester, :ingester_options]\n end", "def default_name\n [long_name, short_name].reject(&:empty?).first\n end", "def equals(other)\n return false if not super(other)\n return self.opts == other.opts\n end", "def aliases\n @opt_aliases.keys.map {|e| undasherize e }\n end", "def use_long_names\n opts = get_options\n opts['uselongnames']=true\n save_file(opts)\n nil\n end", "def same_as?(l2)\r\n\t\tself.product.id == l2.product.id && self.option_values == l2.option_values\r\n\tend", "def option(name, short, long, desc, default = nil, &block)\n desc = desc + \" (default: #{default})\" if default\n # Save the option's default value and add the OptionParser logic\n @options[name] = default\n @parser.on(short, long, desc) do |v|\n @options[name] = (block_given? ? yield(v) : true)\n end\n # Widen the summary width if needed\n width = 2 + (short ? 4 : 0) + long.to_s.size\n @parser.summary_width = [@parser.summary_width, width].max\n end", "def option(name, description, &block)\n name = name.to_s\n block ||= lambda{|v| options[name.to_sym] = v }\n short, long = \"-#{name[0,1]}\", \"--#{name}\"\n op.on_head(name, description, &block)\n end", "def usage\n txt = [\"\\nOPTIONS:\\n\"]\n\n fmt.sort.each do |entry|\n fmtspec, val = entry\n opt = val[0] ? \" <opt> \" : \" \"\n txt << \" #{fmtspec.ljust(longest.length)}#{opt}#{val[1]}\"\n end\n\n txt << \"\"\n txt.join(\"\\n\")\n end", "def same_options?(opts)\n opts.length == 0 || opts.hash == options.hash\n end", "def shortenable?(command)\n @alias_hash.each_pair do |alias_, real|\n if used_subcommand?(command, real)\n return true if real.length > alias_.length\n end\n end\n false\n end", "def options_group?(param_name)\n option_tags.any? { |t| t.name == param_name }\n end", "def in_all_strings?(long_strings, short_string)\nend", "def print_options(format)\n help = execute(\"python #{@@executables[format]} --help\")\n # non-hyphenated long options to symbols\n help.gsub!(/(\\-\\-)([A-Za-z0-9]+)([=|\\s])/, ':\\2\\3')\n # hyphenated long options to quoted strings\n help.gsub!(/(\\-\\-)([\\w|\\-]+)(\\n)?[^$|^=|\\]]?/, '\\'\\2\\'\\3')\n # equal to hashrocket\n help.gsub!(/\\=/, ' => ')\n # hort options to symbols\n help.gsub!(/([^\\w])\\-(\\w)([^\\w])/, '\\1:\\2\\1')\n # short options with args get a hashrocket\n help.gsub!(/(:\\w) </, '\\1 => <')\n puts help\n end", "def one_edit_replace(short, long)\n found_difference = false\n\n (0..short.length-1).each do |i|\n if short[i] != long[i]\n if found_difference\n return false\n break\n end\n\n found_difference = true\n end\n end\n\n true\nend", "def same_as?(l2)\r\n\t\t\tself.product.id == l2.product.id && self.options == l2.options\r\n\t\tend", "def select_option_display\n display_value = self.name + \" [v.#{self.snapshot}]\"\n display_value += self.synopsis.present? ? \" (#{self.synopsis})\" : \"\"\n display_value\n end", "def test_options_parser\n input_short = '-oC:\\test -v -c pass'.split(\" \")\n input_long = '--output-path=C:\\test --verbose --copy-only pass'.split(\" \")\n\n [input_short, input_long].each do |input|\n options = parse_args(input)\n\n assert_equal('C:\\test', options[:output_folder])\n assert_true(options[:verbose])\n assert_true(options[:copy_only])\n assert_equal(['pass'], input)\n end\n end", "def options_overlap(opts)\n !(@opts.map{|k,v| k unless v.nil?}.compact & opts).empty?\n end", "def add_option_name(token)\n option_config = @action_config.option(token.name)\n old_config = @option_names.add?(option_config.name)\n raise Cliqr::Error::MultipleOptionValues, \"multiple values for option \\\"#{token.arg}\\\"\" \\\n if old_config.nil? && !option_config.multi_valued?\n @option_names.add(option_config.short) if option_config.short?\n @option_names\n end", "def show_options(options, name)\n cpt_espace = 30\n options.each do |x,y|\n if y[\"value\"].size > cpt_espace\n cpt_espace = y[\"value\"].size + 7\n end\n end\n\n puts \"\\nOptions for module #{name}:\\n\"\n puts \"#{\"name\".ljust(15)}#{\"Current setting\".ljust(cpt_espace)}#{\"Required\".ljust(15)}#{\"Description\"}\"\n puts \"#{\"-----------\".ljust(15)}#{\"------------------\".ljust(cpt_espace)}#{\"-----------\".ljust(15)}#{\"--------------\"}\\n\\n\"\n\n options.each do |x,y|\n puts \"#{x.ljust(15)}#{y[\"value\"].ljust(cpt_espace)}#{y[\"required\"].ljust(15)}#{y[\"desc\"]}\" \n end\n puts \"\\n\\n\"\nend", "def test_stringflag_as_string\n @p.opt :xyz, \"desc\", :type => :stringflag\n @p.opt :abc, \"desc\", :type => :flag\n opts = @p.parse %w(--xyz abcd)\n assert_equal true, opts[:xyz_given]\n assert_equal \"abcd\", opts[:xyz]\n assert_equal false, opts[:abc]\n opts = @p.parse %w(--xyz abcd --abc)\n assert_equal true, opts[:xyz_given]\n assert_equal \"abcd\", opts[:xyz]\n assert_equal true, opts[:abc]\n end", "def option_registered?(name)\n @entries.key?(name)\n end", "def list_option_by_name(field_name = nil, option_name = nil)\n list_options = list_options(field_name)\n return nil unless list_options\n list_options.find { |h| h[:display].to_snym == option_name.to_snym }\n end", "def has_options?(opts = {})\n opts.each do |key, value|\n this_value = self[key.to_sym]\n return false if (this_value != value)\n end\n return true\n end", "def initialize ( sname, lname, brief = '', param = false )\r\n raise TypeError, 'Incorrectly types for option constructor.' unless\r\n\tsname.instance_of? String and\r\n\tlname.instance_of? String and\r\n\tbrief.instance_of? String and\r\n\tsname.length == 1 and lname.length > 1\r\n\r\n @shortname = sname\r\n @longname = lname\r\n @brief = brief\r\n @value = nil\r\n @param = param\r\n end", "def common_options(opts); end", "def option_clitcpka\n if @name_index\n @conf.insert(@name_index + @conf.length, \" \" + \"option clitcpka \" + \"\\n\")\n else\n puts \"no #{@proxy_type} name assigned\"\n return false\n end\n end", "def aliases\n short ? [name, short] : [name]\n end", "def valid?\n errors, options = {}, {}\n @results = {:errors => errors, :options => options}\n \n remaining_args = args.dup\n valid_options.each do |long_name, details|\n short_name, default = *details\n key = long_name.gsub(/^--/, '').gsub('-', '_').to_sym\n index = remaining_args.index(long_name) ||\n remaining_args.index(short_name)\n if index\n remaining_args.delete_at index\n if self.class.option?(remaining_args[index])\n options[key] = true\n else\n options[key] = remaining_args.delete_at(index)\n end\n else\n options[key] = default\n end\n end\n remaining_args.each do |arg|\n arg_type = self.class.option?(arg) ? 'option' : 'argument'\n errors[arg] = \"is not a valid #{arg_type}\"\n end\n \n errors.empty?\n end", "def option_label\r\n\t\tname + ' (' + path + ')'\r\n\tend", "def option(flag)\n options.find do |o|\n o.flags.any? { |f| clean_key(f) == clean_key(flag) }\n end\n end", "def common_switch(name)\n case name\n when :quiet then [[\"-q\", \"--quiet\"], :quiet]\n when :verbose then [[\"-v\", \"--verbose\"], :verbose]\n when :debug then [[\"-d\", \"--debug\"], :debug]\n when :force then [[\"-f\", \"--force\"], :force]\n else name\n end\n end", "def include_short?\n @include_short\n end", "def class_name\r\n assert_exists\r\n option_class_name\r\n end", "def initialize(spec, has_value)\n # Parse spec string\n if(spec =~ /^[a-zA-Z0-9]$/)\n @short_name = spec\n elsif(spec =~ /^[a-zA-Z][\\w\\-]+$/)\n @long_name = spec\n elsif(spec =~ /^([a-zA-Z0-9]),([a-zA-Z][\\w\\-]+)$/)\n @short_name = $1\n @long_name = $2\n else\n raise \"Invalid option spec '#{spec}'\"\n end\n\n # Finish initialization\n @has_value = has_value\n end", "def options?\n\t\t\tif parameters = self.parameters\n\t\t\t\ttype, name = parameters.last\n\t\t\t\t\n\t\t\t\treturn type == :keyrest || type == :keyreq || type == :key\n\t\t\tend\n\t\tend", "def shortname\n attributes['shortName']\n end", "def options?(*args)\r\n val = false\r\n options.each do |key, value|\r\n next unless args.include?(key.to_sym)\r\n val = options[key].nil? ? true : options[key]\r\n break\r\n end\r\n val\r\n end", "def options_ok?\n end", "def option_type; end", "def argument_optional?\n !short.to_s.match(SHORT_ARGUMENT_OPTIONAL_RE).nil? ||\n !long.to_s.match(LONG_ARGUMENT_OPTIONAL_RE).nil?\n end", "def verify_options_hook; end", "def shortname?\n !@shortname.nil?\n end", "def appropriate_tool_name\n case name\n when \"Ore Vein\"\n \"Pickaxe\"\n when \"Seeds\"\n \"Plow\"\n when \"Wild Game\"\n \"Traps\"\n when \"Cattle\"\n \"Lasso\"\n end\n end", "def long_name\n if @description\n @name + ' ' + @description\n else\n @name\n end\n end" ]
[ "0.67539346", "0.66119564", "0.6464744", "0.6457991", "0.6432522", "0.6239315", "0.6055622", "0.60004145", "0.59815294", "0.5942508", "0.5941243", "0.59226096", "0.58708936", "0.58497006", "0.58060706", "0.5719492", "0.57154894", "0.5686374", "0.5681485", "0.5632944", "0.5629285", "0.5625711", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.55814016", "0.5546372", "0.55419606", "0.55165666", "0.55064225", "0.55006546", "0.54700834", "0.545874", "0.5454858", "0.54288584", "0.5421925", "0.5419317", "0.54129404", "0.54083884", "0.5380599", "0.53787154", "0.53644407", "0.5361116", "0.5353268", "0.5329921", "0.5325886", "0.53207666", "0.5318399", "0.5317713", "0.5316912", "0.53036624", "0.5295564", "0.5294302", "0.52820575", "0.5281671", "0.52790385", "0.5277474", "0.5258051", "0.52564913", "0.52468926", "0.52455246", "0.52280915", "0.52242726", "0.5223433", "0.522043", "0.5212473", "0.5210298", "0.5203364", "0.5200402", "0.51955974", "0.51926166", "0.5192129", "0.5172617", "0.5171664", "0.5164448", "0.51627374", "0.51548713", "0.5143824", "0.5129144", "0.5127558", "0.5115267", "0.50993645", "0.5095514", "0.50899416", "0.5077848", "0.5077349", "0.50689924", "0.50677425", "0.5066727", "0.50653344", "0.5064874", "0.5053397", "0.505332", "0.504733" ]
0.5218183
71
of the original list in reverse order do not modify the original list
def reverse(array) new_array = [] array.reverse_each do |element| new_array << element end new_array end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def reverse!(list)\n list.reverse!\n end", "def reverse_list list\n\tlist.reverse\nend", "def reverse!(list)\n reverse_list = Array.new(list)\n (reverse_list.size - 1).downto(0).each { |index| list[index] = reverse_list[index]}\n list\nend", "def reverse()\r\n self.reduce(List.new) { |new_list, item| new_list.cons(item) }\r\n end", "def reverse!(list)\n\n indx = list.size\n temp_arr = []\n list.each {|item| temp_arr << item}\n list.clear\n while indx > 0\n list << temp_arr[indx - 1] \n indx -= 1\n end\n\n list\nend", "def reverse!\n old_list = self\n new_list = List.new(self.last_node)\n previous_node = self.get_previous_node(self.last_node)\n old_list.remove(old_list.last_node)\n reverse_util(old_list, new_list, previous_node)\n end", "def reverse(list)\n list.reverse\nend", "def reverse!(list)\n list2 = []\n loop do\n break if list.empty?\n\n element = list.pop\n list2 << element\n end\n list.replace(list2)\nend", "def reverse!(list)\n \n temp_list = []\n list.size.times do |i|\n temp_list << list.pop\n end\n \n temp_list.each do |item|\n list << item\n end\n list\nend", "def reverse!(list)\n list_copy = list.dup\n counter = list.size\n list.map! do |elem|\n counter -= 1\n list_copy[counter]\n end\nend", "def reverse(list)\n output = []\n list.each {|itm| output.unshift(itm)}\n output\nend", "def reverse(list)\n source_list = list.dup\n new_arr = []\n count = list.size\n until count\n new_arr << source_list[count - 1]\n count -= 1\n end\n new_arr\nend", "def reverse!(list)\n index = list.length\n loop do\n break if index == 0\n list << list.delete_at(index -= 1)\n end\n list\nend", "def my_reverse\n out=[]\n each {|item| out.unshift(item)}\n\n out\n end", "def reverse\n LazyList.new { reduce(EmptyList) { |list, item| list.cons(item) }}\n end", "def reverse(list)\n reverse = list.map.with_index do |el, idx|\n idx == 0 ? idx = -1 : idx = (idx * -1) - 1\n list[idx]\n end\nend", "def reverse!(list)\n times_to_loop = (list.size / 2)\n times_to_loop.times do |num|\n list[0 + num], list[-1 + (-num)] = list[-1 + (-num)], list[0 + num]\n end\n list\nend", "def reverse(list)\n list.each_with_object([]) { |el, arr| arr.unshift(el) }\nend", "def reverse(list)\n new_list = []\n index = -1\n loop do\n break if new_list.size == list.size\n new_list << list[index]\n index -= 1\n end\n new_list\nend", "def reverse_list(list, previous=nil)\n\twhile list\t\n\t\toriginal_next_node = list.next_node\n\n\t\tlist.next_node = previous\n\t\tprevious = list\n \n\t\tlist = original_next_node\n\tend\n\n \t previous\n \t \nend", "def reverse!(list)\n bounce = []\n list.length.times {bounce.push(list.pop)}\n bounce.length.times {list.push(bounce.shift)}\n list\nend", "def reverse!\n a = return_list.reverse\n\n @head = Node.new(a.first, nil)\n \n a[1..-1].each do |i|\n add(i)\n end\n end", "def my_reverse\n reversed = []\n self.my_each {|el| reversed.unshift(el)}\n reversed\n end", "def reverse!(list)\n initial_length = list.length\n iterator = (list.length - 1)\n while iterator >= 0\n list << list[iterator]\n iterator -= 1\n end\n iterator2 = 0\n until iterator2 == initial_length\n list.delete_at(0)\n iterator2 += 1\n end\n p list\nend", "def mirror(list)\n list_copy = list.dup\n index_tracker = list.length - 1\n until index_tracker == 0\n list_copy << list[index_tracker]\n index_tracker -= 1\n end\n return list_copy\nend", "def reverse_list list\n new_array = []\n x = list.length - 1\n while x >= 0\n new_array.push(list[x])\n x -= 1\n end\n new_array\nend", "def reverse\n dup.reverse!\n end", "def reverse!(list)\n list = list.sort! { |a, b| list.index(b) <=> list.index(a) }\nend", "def reverse!(list)\n list.sort! { |a, b| b <=> a }\nend", "def reverse\n ->(xs) {\n length.(xs) <= 1 ? xs : concat.(reverse.(xs[1..-1]), [head.(xs)])\n }\n end", "def reverse!(array)\n copy = array.clone\n index = -1\n\n copy.each do |element|\n array[index] = element\n index -= 1\n end\n\n array\nend", "def reverse!\n\t\t@order *= -1\n\t\tresort\n\tend", "def reverse\r\n prev = nil\r\n cursor = @head\r\n while cursor do\r\n temp = cursor.next\r\n cursor.next = prev \r\n prev = cursor\r\n cursor = temp \r\n end\r\n @head = prev\r\n end", "def rev(list)\n list.sort! { |a, b| b <=> a }\nend", "def reverse_list(head)\n##start with the head\n\traise “no items in list” if head.nil?\n\tnode = head\n\n\traise “only items” if node.next.nil?\n\n\tchild = node.next\n\n\tuntil child.next.nil?\n\t\t#set the child’s element to be the prior element\n\t\t\tchild.next = node\n\t\t\t#walk down\n\t\t\tnode = node.next\n\tchild = node.next\n\tend\n\n\tchild.next = node\n\t\thead.next = nil\n\tend", "def reverse!\n low = 0\n high = self.__size - 1\n while low < high\n a = self.__at(low)\n b = self.__at(high)\n self.__at_put(high, a)\n self.__at_put(low, b)\n low = low + 1\n high = high - 1\n end\n self\n end", "def reverse!(list)\n counter = 0\n temp_map = []\n list.each do |element|\n temp_map << list[counter - 1]\n counter -= 1\n end\n counter = 0\n list.map! do |element|\n element = temp_map[counter]\n counter += 1\n element\n end\n list\nend", "def reverse(list)\n list.inject([]) { |arr, var| arr.unshift(var) }\nend", "def reverse\n self.dup.reverse!\n end", "def reverse!(arr)\n temp = arr.dup\n arr.map!.with_index(1) { |_, i| p temp[-i] }\nend", "def reverse\n reversed = BackupList.new\n self.reverse_each do |bck|\n reversed << bck\n end\n return reversed\n end", "def reverse!(arr)\n arr.each do |element|\n arr.delete(element)\n arr.unshift(element)\n end\nend", "def reverse_list_in_place(head)\n prev = nil\n current = head\n next_node = head.next_node\n\n until next_node.nil?\n current.next_node = prev\n\n prev = current\n current = next_node\n next_node = next_node.next_node\n end\n\n current\nend", "def reverse\n reversed = LinkedList.new \n each {|v| reversed.insert(0, v)}\n reversed\n end", "def reverse() end", "def reverse() end", "def reverse(array)\n array.each_with_object([]) do |item, result|\n result.prepend(item)\n end\nend", "def reverse!(arr)\n copy = []\n cp_index = arr.size-1\n (0...arr.size).each do |arr_index|\n copy[arr_index] = arr[cp_index]\n cp_index -= 1\n end\n copy.each_with_index do |el, index|\n arr[index] = el\n end\n arr\nend", "def reverse(array)\n result = []\n array.each do |item|\n result.prepend(item)\n end\n result\nend", "def reverse(arr)\n arr.each_with_object([]) { |item, arr| arr.prepend(item) }\nend", "def reverse_list_mutation(list, previous=nil)\n next_node = list.next_node\n list.next_node = previous\n\n if next_node\n reverse_list_mutation(next_node, list)\n else\n list\n end\nend", "def reverse\n cursor = @tail\n @head = cursor\n until !cursor.prev do\n\n temp = cursor.next\n cursor.next = cursor.prev\n cursor.prev = temp\n cursor = cursor.next\n \n end\n cursor.prev = cursor.next\n cursor.next = nil\n\n @tail = cursor \n \n end", "def reverse!(array)\n copy_array = array.dup\n array.map! { |_| copy_array.pop }\nend", "def reverse_linked_list(list)\n last_node = list.find_last_node\n current_index = list.index_of(last_node.data)\n loop do\n if current_index == 0\n list.find_node(current_index).next_node = nil\n break\n end\n list.find_node(current_index).next_node = list.find_node(current_index - 1)\n current_index -= 1\n end\n list.first_node = last_node\nend", "def reverse_list(list, previous_node=nil)\n \t\thead = list.next_node\n \t\treverse_list(list, head)\n return head\n end", "def reverse!(list)\n return list if list.size < 2\n\n first = 0\n last = -1\n\n loop do\n list[first], list[last] = list[last], list[first]\n first += 1\n last -= 1\n\n break if first == list.size / 2\n end\n\n list\nend", "def reverse!(arr)\n values = arr.dup\n arr.each.with_index do |_, index|\n arr[index] = values[-index - 1]\n end\nend", "def reverse_array(array)\n array.reverse!\n array\nend", "def reversed(xs)\n listLength = xs.length-1\n newList = []\n while(listLength>=0)\n newList.push(xs[listLength])\n listLength = listLength - 1\n\tend\n return newList\nend", "def reverse_list(list)\r\n # list = Stack.new\r\n\r\n while list\r\n # While list what? \r\n list = list.next_node\r\n end\r\nend", "def reverse_each(elective_array)\n elective_array.each do |i|\n i.reverse!\n end\n return elective_array\nend", "def reverse!(list)\n index_left = 0\n index_right = -1\n\n while index_left < list.length / 2\n list[index_left], list[index_right] = list[index_right], list[index_left]\n index_left += 1\n index_right -= 1\n end\n\n list\nend", "def reverse(arr)\n reversed_arr = []\n arr.each { |object| reversed_arr.unshift(object)}\n reversed_arr\nend", "def reverse_util(old_list, new_list, previous_node)\n if previous_node == nil\n return new_list\n end\n\n current_node = new_list.last_node\n next_node = old_list.last_node\n new_list.insert_after(current_node, next_node)\n old_list.remove(old_list.last_node)\n\n reverse_util(old_list, new_list, old_list.last_node)\n end", "def reverse_list(list, previous=nil)\n start = list.next_node\n list.next_node = previous\n if start\n reverse_list(start, list)\n else\n list\n end\n\nend", "def reverse(a)\n new = []\n (0...a.size).each { |i| new << a[a.size - i - 1] }\n new\nend", "def reverse!(array)\n array.each_index do |index|\n array.insert(index, array.pop)\n end\n array\nend", "def reverse!(arr)\n arr_orignal = arr.map{ |element| element }\n index = 0\n loop do\n break if index == arr.size\n arr[index] = arr_orignal[-(index+1)]\n index +=1\n end\n arr\nend", "def reverse(arr)\n new_arr = []\n arr.each do |element|\n new_arr.prepend(element)\n end\n new_arr\nend", "def reverse\n original_first = first\n pointer = @head\n until original_first == last\n new_last = last.prev\n new_first = last\n pointer.next = new_first\n new_first.prev = pointer\n\n @tail.prev = new_last\n new_last.next = @tail\n pointer = new_first\n end\n\n pointer.next = last\n last.prev = pointer\nend", "def reverse\n reverse_list = SinglyLinkedList.new\n node = @head\n while node\n reverse_list.prepend(node.value)\n node = node.next\n end\n reverse_list\n end", "def reverse_array(array)\n array.reverse!\nend", "def reverse_array(array)\n array.reverse!\nend", "def reverse_array(array_new)\n array_new.reverse \n end", "def reverse(array)\n reversed_array = []\n array.each { |item| reversed_array.unshift(item) }\n reversed_array\nend", "def reverse!(list)\n count = 0\n\n list.size.times do\n list.insert(count, list.pop)\n count += 1\n end\n\n list\nend", "def reversed_linked_list(list)\n @reversed_list = Stack.new\n while list\n reversed_list.push(list.value)\n list = list.next_node\n end\n reversed_list.data\n end", "def my_reverse\n new_arr = []\n i = self.length-1\n while i >= 0\n new_arr << self[i]\n i -= 1\n end\n new_arr\n end", "def reverse_list\n prev = nil\n current = head\n next_node = nil\n # Reversing the links iteratively\n # 8 -> 9 => 8 <- 9\n while current != nil\n next_node = current.next\n current.next = prev\n prev = current\n current = next_node\n end\n @head = prev\n end", "def reversal(array)\n array = array.map{|element| element} #creates a copy of array, remove to have same object_id's\n left_index = 0\n right_index = -1\n \n while left_index < array.size / 2\n array[left_index], array[right_index] = array[right_index], array[left_index]\n left_index += 1\n right_index -=1\n end\n\n array\nend", "def reverse; end", "def reverse; end", "def reverse!(old_array)\n new_array = []\n while old_array.length > 0\n new_array << old_array.pop\n end\n while new_array.length > 0\n old_array << new_array.shift\n end\n old_array\nend", "def reverse!(list)\n left_index, right_index = 0, -1\n \n while left_index < list.length / 2\n list[left_index], list[right_index] = list[right_index], list[left_index]\n \n left_index += 1\n right_index -= 1\n end\n list\nend", "def reverse\n current = @head\n previous = nil\n while current != nil\n temp = current.next # save state\n current.next = previous # update link\n\n # move to next\n previous = current\n current = temp\n end\n @head = previous\n end", "def using_reverse(array)\n array.reverse \nend", "def reverse_list(head)\n new_list = ListNode.new head.val\n current = head\n\n until current.next_node.nil?\n current = current.next_node\n new_node = ListNode.new current.val, new_list\n new_list = new_node\n end\n\n new_list\nend", "def using_reverse(array)\narray.reverse\nend", "def using_reverse(array)\narray.reverse\nend", "def my_reverse(arr)\n arr = arr.reverse\n\nend", "def reverse(arr)\n arr.each_with_object([]) {|x, new_arr| new_arr.prepend(x)}\nend", "def reverse\n current_node = @head\n prev_node = nil\n loop do\n next_node = current_node.next\n break if current_node.next.nil?\n current_node.next = prev_node\n prev_node = current_node\n current_node = next_node\n end\n @last = @head\n @head = prev_node\n end", "def my_reverse(arr)\n new_arr = []\n arr.each { |ele| new_arr.unshift(ele) }\n new_arr\nend", "def reverse_list(list, previous=nil)\r\n # do stuff\r\n if list\r\n next_node = list.next_node\r\n list.next_node = previous\r\n if next_node\r\n reverse_list(next_node, list)\r\n else\r\n return list\r\n end\r\n end\r\nend", "def reverse_arr(arr)\n return_arr = []\n arr.each do |item|\n return_arr.unshift(item)\n end \n return_arr\nend", "def reverse_array(i)\r\n i.reverse!\r\nend", "def reverse_2(array)\n array.each_with_object([]) { |e, a| a.prepend(e) }\nend", "def reverse(arr)\n reverse_arr = []\n arr.each { |element| reverse_arr.unshift(element) }\n reverse_arr\nend", "def reverse(head)\n\n return head\nend", "def using_reverse(array)\n reversed_array=array.reverse\nend" ]
[ "0.8285506", "0.8222739", "0.8113968", "0.80991423", "0.78875625", "0.7864538", "0.78348476", "0.7805046", "0.7793179", "0.7765299", "0.77573353", "0.7709423", "0.7572536", "0.75637084", "0.753941", "0.75337875", "0.7507064", "0.74747056", "0.73799783", "0.73757946", "0.73632634", "0.7331289", "0.72694147", "0.72522295", "0.72339046", "0.7225519", "0.7221641", "0.72021484", "0.71731156", "0.7142513", "0.70780504", "0.70596254", "0.70563984", "0.70433986", "0.704281", "0.7031704", "0.70299286", "0.7023061", "0.70208615", "0.7017541", "0.70090437", "0.70038724", "0.70003146", "0.69861984", "0.697894", "0.697894", "0.6977514", "0.69577307", "0.6955378", "0.69413114", "0.69249964", "0.69192255", "0.690693", "0.68967444", "0.68857306", "0.6885036", "0.68758076", "0.6849666", "0.684211", "0.683741", "0.6830487", "0.6827765", "0.6816735", "0.681605", "0.6811888", "0.68114686", "0.68051773", "0.6802668", "0.68020433", "0.6787431", "0.67672426", "0.67621136", "0.67621136", "0.6761672", "0.67609864", "0.67537856", "0.67486876", "0.67455524", "0.6743149", "0.6725744", "0.67229986", "0.67229986", "0.6720883", "0.67198247", "0.67155105", "0.6707639", "0.6698682", "0.6669882", "0.6669882", "0.6668216", "0.6667854", "0.6652949", "0.66440797", "0.664229", "0.664162", "0.66311437", "0.6630688", "0.6630121", "0.6624926", "0.66233325" ]
0.66922224
87
GET /rental_cars GET /rental_cars.json
def index @rental_cars = RentalCar.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @cars = Car.all\n render json: @cars\n end", "def index\n authenticate_request!\n @cars = Car.all\n\n render json: @cars\n end", "def index\n @cars = Car.all\n\n render json: @cars\n end", "def index\n @rentals = @car.rentals.all\n end", "def user_cars\n @cars = Car.where(user_id: params[:id])\n @bookings = Booking.select(:car_id).where(renter_id: params[:id])\n render json: @cars\n end", "def get_cars\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n relatable_category_ids << params[:car_calculator][:model]\n result = CarApp.calculated_session.related_objects_from_relatable_categories(\"car\", relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end", "def show\n @cars = Car.where(dealership_id: params[:id])\n render json: { dealership: @dealership, cars: @cars }\n \n end", "def show\n authenticate_request!\n @car = Car.find(params[:id])\n render json: @car, status: 200\n end", "def index\n @rented_cars = RentedCar.paginate(page: params[:page], per_page: 12)\n end", "def index\n @cars = Car.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def show\n @cars = Car.sort_by(dealership_id: params[:id])\n render json: { cars: @cars }\n \n end", "def show\n render json: @car\n end", "def index\n @cars = Car.all\n\t@cars = Car.paginate(:page => params[:page], :per_page => 5)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def index\n @cars = Car.all\n #@cars = Car.where({:seller_id => session[:seller_id]}).all\n #@seller = Seller.find(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def show\n @car = Car.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def show\n @car = Car.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def show\n @car = Car.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def get_part_by_car\n @cars = PartsController::PartService.get_part_by_car(params[:param]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "def get_part_by_car_category\n @cars = PartsController::PartService.get_part_by_car_category(params[:paran_car], params[:paran_category]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def show\n @myrentals = Rental.where(car_id: @car)\n authorize @car\n end", "def index\n @car = Car.find(params[:car_id])\n @lien_procedures = @car.lien_procedures\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lien_procedures }\n end\n end", "def show\n @carpool = Carpool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carpool }\n end\n end", "def index\n @car_infos = CarInfo.all\n end", "def index\r\n @cars = Car.page params[:page]\r\n end", "def index\n @railcars = Railcar.all\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "def index\n @car_items = CarItem.all\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def show\n @car_option = CarOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {car_option: @car_option} }\n end\n end", "def select_rented_car(rented_car_id)\n @rental_data.cars.find { |car| car.id == rented_car_id }\n end", "def index\n @vehicles = Vehicle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "def set_rental_car\n @rental_car = RentalCar.find(params[:id])\n end", "def index\n\t\t@cars = Car.search( params[:search] ).paginate(:page => params[:page], :per_page => 4)\n\tend", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def index\n @car = Car.find(params[:car_id])\n @assets = @car.assets\n\n respond_to do |format|\n format.xml {render xml: @assets}\n format.json {render json: @assets}\n end\n end", "def show\n @car = Car.find(params[:id])\n\t#@stores = Store.near(@customer.address, 10, :order => :distance, :units => :km)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def show\n render json: @vehicle\n end", "def index\n get_cars\n @cars = Car.all\n @cars = @cars.order(:id)\n car_array = []\n @cars.each do |car|\n car_array << car\n end\n gon.cars = car_array # Using gon to make the car's data accessible to JavaScript for mapping purposes\n end", "def index\n @backoffice_cars = Backoffice::Car.all\n end", "def show\n @caricullum = Caricullum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caricullum }\n end\n end", "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "def index\n @rentals = Rental.get_all\n end", "def create\n @rental_car = RentalCar.new(rental_car_params)\n\n respond_to do |format|\n if @rental_car.save\n format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully created.' }\n format.json { render :index, status: :created, location: @rental_car }\n else\n format.html { render :new }\n format.json { render json: @rental_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @car = Car.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car }\n\t \n end\n end", "def show\n @car = Car.find(params[:id])\n end", "def show\n @car = Car.find(params[:id])\n end", "def new\n @car = Car.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car }\n end\n end", "def index\n @q = CarType.search(params[:q])\n @car_types = @q.result(distinct: true).page(params[:page])\n\n respond_with(@car_types)\n end", "def index\n @vehicles = Vehicle.all\n if @vehicles.present?\n \trender json: { vehicles: @vehicles, status: :ok }\n else\n render json: { :status => \"204\", :message => \"There is not vehicles\" }, status: :no_content\n end\n end", "def index\n @web_car_galleries = WebCarGallery.all\n\n render json: @web_car_galleries\n end", "def index\n @cars = Car.all.sort_by(&:likes_count).reverse.map\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def show\n @carrito_item = CarritoItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carrito_item }\n end\n end", "def show\n #@rental = @car.rentals.build[:id]\n #@car=Car.find(params[:id])\n\n end", "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "def index\n @carros = Carro.all\n end", "def index\n @load_vehicle = LoadVehicle.all\n respond_to do |format|\n format.json { render json: @load_vehicle }\n end\n end", "def index\n @car_parks = CarPark.all\n end", "def index\n @cars = current_user.cars\n #@cars = Car.all\n end", "def index\n @rentable_items = RentableItem.all\n render json: @rentable_items\n end", "def show\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\n end", "def show\n # @car = Car.find(params[:id])\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def show\n @car = Car.find(params[:car_id])\n @lien_procedure = @car.lien_procedures.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lien_procedure }\n end\n end", "def listRestaurants\n _restaurants = Restaurant.all\n render json: _restaurants\n end", "def find_car\n\t\t\t@car = Car.find(params[:car_id])\n\t\tend", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def fetch_car\n @car = current_user.cars.find(params[:car_id])\n end", "def index\n @curriculum_vitaes = findable_curriculum_vitaes.all\n respond_to do |format|\n format.html {}\n format.json { render json: @curriculum_vitaes }\n end\n end", "def index\n @cars = Car.all.order(\"created_at DESC\").paginate(:page => params[:page], \n :per_page => 9)\n end", "def index\n @carros = @patio.carros.all\n end", "def index\n @showcars = Showcar.all\n end", "def index\n @trycars = Trycar.all\n end", "def index\n @car3s = Car3.all\n end", "def index\n @car_specific_specs = CarSpecificSpec.all\n end", "def fetch_books(term)\n response = RestClient.get(\"https://www.googleapis.com/books/v1/volumes?q=#{term}\")\n\n JSON.parse(response.body)\nend", "def show\n render json: @rentable_item\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def index\n @storecars = Storecar.all\n\n respond_with @storecars\n end", "def index\n @car_categories = CarCategory.all\n end", "def show\n @car_body_style = CarBodyStyle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car_body_style }\n end\n end", "def list_carriers_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CarriersApi.list_carriers ...'\n end\n # resource path\n local_var_path = '/v1/carriers'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'GetCarriersResponseBody' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CarriersApi#list_carriers\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n add_breadcrumb \"all\", nil, \"glyphicon-list\"\n\n #@vehicles = Vehicle.all\n @vehicles = current_user.account.vehicles || []\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "def index\n #@space_vehicles = SpaceVehicle.all\n @space_vehicles = current_user.space_vehicles\n\n @being_shared_vehicles = current_user.shared_vehicles_by_others\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @space_vehicles }\n end\n end", "def index\n @careers = Career.all\n json_response(@careers)\n end", "def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end", "def index\n @car_shows = CarShow.all\n end", "def cards\n @celebrity = Celebrity.find(params[:id])\n @cards = @celebrity.cards\n render json: @cards\n end", "def index\n @rentals = Rental.all\n end", "def index\n @rentals = Rental.all\n end", "def index\n @rentals = Rental.all\n end", "def show\r\n @car_image = CarImage.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @car_image }\r\n end\r\n end" ]
[ "0.74109036", "0.7402507", "0.7400949", "0.7326956", "0.7298413", "0.71065223", "0.70806044", "0.70684093", "0.70223176", "0.70073855", "0.6965768", "0.69315463", "0.6925553", "0.68995017", "0.686544", "0.686544", "0.686544", "0.68596566", "0.6783068", "0.6765357", "0.6675924", "0.65127367", "0.65127367", "0.65127367", "0.65127367", "0.65127367", "0.65127367", "0.64760375", "0.6474585", "0.6433678", "0.6400465", "0.6398173", "0.63611037", "0.63132477", "0.6293786", "0.6289197", "0.62823546", "0.6242215", "0.6240863", "0.6239783", "0.6236861", "0.62290084", "0.6211622", "0.62069446", "0.619924", "0.6198247", "0.61955106", "0.6182848", "0.6175347", "0.6173409", "0.61672306", "0.61573637", "0.61400163", "0.6138691", "0.6138691", "0.6138015", "0.6135682", "0.6131478", "0.61231846", "0.6116944", "0.6102314", "0.6083177", "0.6079303", "0.6071703", "0.60694647", "0.60623497", "0.6040676", "0.6036987", "0.603582", "0.60256773", "0.6015298", "0.59996873", "0.59930414", "0.5992318", "0.5988402", "0.5986562", "0.5986536", "0.59757245", "0.59740657", "0.5952629", "0.59518445", "0.5941579", "0.59323204", "0.5920435", "0.5919965", "0.59130454", "0.59098184", "0.5908261", "0.59055245", "0.59016514", "0.59006304", "0.5895544", "0.589407", "0.5893829", "0.5888951", "0.5887705", "0.5878746", "0.5878746", "0.5878746", "0.58723766" ]
0.7289383
5
GET /rental_cars/1 GET /rental_cars/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n authenticate_request!\n @car = Car.find(params[:id])\n render json: @car, status: 200\n end", "def index\n @cars = Car.all\n render json: @cars\n end", "def index\n @cars = Car.all\n\n render json: @cars\n end", "def show\n @cars = Car.where(dealership_id: params[:id])\n render json: { dealership: @dealership, cars: @cars }\n \n end", "def show\n @car = Car.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def show\n @car = Car.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def show\n @car = Car.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def index\n authenticate_request!\n @cars = Car.all\n\n render json: @cars\n end", "def index\n @rentals = @car.rentals.all\n end", "def index\n @rental_cars = RentalCar.all\n end", "def user_cars\n @cars = Car.where(user_id: params[:id])\n @bookings = Booking.select(:car_id).where(renter_id: params[:id])\n render json: @cars\n end", "def show\n @cars = Car.sort_by(dealership_id: params[:id])\n render json: { cars: @cars }\n \n end", "def show\n render json: @car\n end", "def get_part_by_car\n @cars = PartsController::PartService.get_part_by_car(params[:param]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "def index\n @cars = Car.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def get_part_by_car_category\n @cars = PartsController::PartService.get_part_by_car_category(params[:paran_car], params[:paran_category]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "def index\n @cars = Car.all\n #@cars = Car.where({:seller_id => session[:seller_id]}).all\n #@seller = Seller.find(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def index\n @cars = Car.all\n\t@cars = Car.paginate(:page => params[:page], :per_page => 5)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cars }\n end\n end", "def show\n @carpool = Carpool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carpool }\n end\n end", "def get_cars\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n relatable_category_ids << params[:car_calculator][:model]\n result = CarApp.calculated_session.related_objects_from_relatable_categories(\"car\", relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end", "def index\n @rented_cars = RentedCar.paginate(page: params[:page], per_page: 12)\n end", "def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end", "def show\n @car_option = CarOption.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {car_option: @car_option} }\n end\n end", "def get_carriers\n @transporter = Transporter.find(params[:id])\n\n render json: @transporter.carriers\n end", "def show\n @caricullum = Caricullum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caricullum }\n end\n end", "def set_rental_car\n @rental_car = RentalCar.find(params[:id])\n end", "def show\n @car = Car.find(params[:id])\n end", "def show\n @car = Car.find(params[:id])\n end", "def index\n @car = Car.find(params[:car_id])\n @lien_procedures = @car.lien_procedures\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lien_procedures }\n end\n end", "def select_rented_car(rented_car_id)\n @rental_data.cars.find { |car| car.id == rented_car_id }\n end", "def show\n @carrito_item = CarritoItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carrito_item }\n end\n end", "def show\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle }\n end\n end", "def new\n @car = Car.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car }\n end\n end", "def show\n #@rental = @car.rentals.build[:id]\n #@car=Car.find(params[:id])\n\n end", "def new\n @car = Car.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car }\n\t \n end\n end", "def show\n # @car = Car.find(params[:id])\n end", "def show\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent }\n end\n end", "def show\n @myrentals = Rental.where(car_id: @car)\n authorize @car\n end", "def find_car\n\t\t\t@car = Car.find(params[:car_id])\n\t\tend", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def index\n @cars = Car.all\n end", "def show\n render json: @vehicle\n end", "def show\n @car = Car.find(params[:car_id])\n @lien_procedure = @car.lien_procedures.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lien_procedure }\n end\n end", "def index\r\n @cars = Car.page params[:page]\r\n end", "def index\n @car_infos = CarInfo.all\n end", "def fetch_car\n @car = current_user.cars.find(params[:car_id])\n end", "def index\n info = Aws.get_recipes_from_db\n render :json => info\n end", "def show\r\n @car_image = CarImage.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @car_image }\r\n end\r\n end", "def show\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprentice }\n end\n end", "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end", "def index\n @rents = Rent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rents }\n end\n end", "def show\n @car = Car.find(params[:id])\n\t#@stores = Store.near(@customer.address, 10, :order => :distance, :units => :km)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def index\n @car_items = CarItem.all\n end", "def index\n @railcars = Railcar.all\n end", "def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend", "def show\n @car_configuration = CarConfiguration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car_configuration }\n end\n end", "def index\n @vehicles = Vehicle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vehicles }\n end\n end", "def show\n @roadcrime = Roadcrime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @roadcrime }\n end\n end", "def show\n @caracteristica_cartum = CaracteristicaCartum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caracteristica_cartum }\n end\n end", "def index\n @car = Car.find(params[:car_id])\n @assets = @car.assets\n\n respond_to do |format|\n format.xml {render xml: @assets}\n format.json {render json: @assets}\n end\n end", "def create\n @rental_car = RentalCar.new(rental_car_params)\n\n respond_to do |format|\n if @rental_car.save\n format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully created.' }\n format.json { render :index, status: :created, location: @rental_car }\n else\n format.html { render :new }\n format.json { render json: @rental_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @trucks = Truck.all\n\n render json: @trucks\n end", "def car \n\t \t@car ||= Car.where(id: params[:id]).first\n\t end", "def show\n recipe = Recipe.find(params[:id])\n # recipes = Recipe.find_by(params[:id])\n # render json: recipe\n render json: recipe\n end", "def show\n\t\t@carro = Carro.find(params[:id])\n\tend", "def show\n @car_body_style = CarBodyStyle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car_body_style }\n end\n end", "def index\n if params[:user_id]\n @rents = find_user.rents\n render json: @rents\n elsif params[:book_id]\n @rents = find_book.rents\n render json: @rents\n else\n @rents = Rent.all\n render json: @rents\n end\n end", "def show\n vehicle=Vehicle.where(uid: params[:id]).first\n render :json => {\"vehicle\"=>vehicle }\n end", "def show\n @title=\"事故车-详细信息\"\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @car }\n end\n end", "def index\n @load_vehicle = LoadVehicle.all\n respond_to do |format|\n format.json { render json: @load_vehicle }\n end\n end", "def index\n @vehicles = Vehicle.all\n if @vehicles.present?\n \trender json: { vehicles: @vehicles, status: :ok }\n else\n render json: { :status => \"204\", :message => \"There is not vehicles\" }, status: :no_content\n end\n end", "def index\n @cars1s = Cars1.all\n end", "def show\n render json:@web_display_car_image\n end", "def index\n @recipes = Recipe.all\n render json: @recipes\n end", "def new\n @car_option = CarOption.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car_option }\n end\n end", "def show\n render json: @rentable_item\n end", "def show\n @car_interior_color = CarInteriorColor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {car_interior_color: @car_interior_color} }\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vehicle_type }\n end\n end", "def index\n @rentals = Rental.get_all\n end", "def show\n @trucking = Trucking.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trucking }\n end\n end", "def show\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clue }\n end\n end", "def show\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clue }\n end\n end", "def show\n @rental = Rental.get_by_id(params[:id])\n end", "def new\n @carpool = Carpool.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @carpool }\n end\n end", "def index\n @car2s = Car2.all\n end", "def show\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crust }\n end\n end", "def find_car\n @car = current_user.cars.find(params[:car_id])\n end", "def find_car\n @car = current_user.cars.find(params[:car_id])\n end", "def index\n recipes = Recipe.all\n render status: :ok, json: recipes\n end", "def show\n render json: @recipe\n end", "def show\n @my_car = MyCar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @my_car }\n end\n end", "def show\n @carbontaxrefund = Carbontaxrefund.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carbontaxrefund }\n end\n end", "def index\n @backoffice_cars = Backoffice::Car.all\n end", "def index\n @carros = Carro.all\n end", "def show\n @commodity = Commodity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commodity }\n end\n end", "def show\n @commodity = Commodity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commodity }\n end\n end", "def show\n\n recipe = Recipe.find(params[:id])\n render :json => recipe.to_json\n\n end" ]
[ "0.7375206", "0.723797", "0.72270614", "0.71540564", "0.71336126", "0.71336126", "0.71336126", "0.70862", "0.7041193", "0.7024044", "0.6993586", "0.69771904", "0.6961181", "0.69234025", "0.6884185", "0.67593974", "0.6746952", "0.6727694", "0.6677513", "0.66536444", "0.66424644", "0.66119164", "0.65860105", "0.6541788", "0.65289533", "0.65273935", "0.6511159", "0.6511159", "0.65045094", "0.6476354", "0.6438111", "0.6424238", "0.6409783", "0.64071494", "0.63821614", "0.63639045", "0.6359059", "0.63392544", "0.63266087", "0.6317249", "0.6317249", "0.6317249", "0.6317249", "0.6317249", "0.6317249", "0.63106966", "0.62738794", "0.62679946", "0.626381", "0.62592214", "0.62566864", "0.62564445", "0.6253098", "0.62344253", "0.6210338", "0.6198517", "0.61858857", "0.618077", "0.61712474", "0.6170806", "0.6170402", "0.61689156", "0.61594796", "0.61574566", "0.61408305", "0.61365426", "0.61300725", "0.6122285", "0.61009806", "0.61007196", "0.6090707", "0.60890645", "0.60470474", "0.60420847", "0.6036619", "0.6024574", "0.6006084", "0.5998403", "0.599104", "0.59828913", "0.5982355", "0.5970213", "0.5969678", "0.59656584", "0.59654754", "0.59654754", "0.5963075", "0.5945193", "0.59409946", "0.59379613", "0.5934714", "0.5934714", "0.59202886", "0.591971", "0.591966", "0.59147877", "0.59092784", "0.59069467", "0.5906006", "0.5906006", "0.5905499" ]
0.0
-1
POST /rental_cars POST /rental_cars.json
def create @rental_car = RentalCar.new(rental_car_params) respond_to do |format| if @rental_car.save format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully created.' } format.json { render :index, status: :created, location: @rental_car } else format.html { render :new } format.json { render json: @rental_car.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @car = Car.new(car_params)\n\n if @car.save\n render json: @car, status: :created, location: @car\n else\n render json: @car.errors, status: :bad_request\n end\n end", "def create\n @car = Car.new(car_params)\n respond_to do |format|\n if @car.save\n format.html { redirect_to cars_path, notice: 'Car (' + @car.name + ') was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(params[:car])\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render json: @car, status: :created, location: @car }\n else\n format.html { render action: \"new\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render action: 'show', status: :created, location: @car }\n else\n format.html { render action: 'new' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render action: 'show', status: :created, location: @car }\n else\n format.html { render action: 'new' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n \n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Samochód został utworzony.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @car = Car.new(car_params)\r\n\r\n respond_to do |format|\r\n if @car.save\r\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\r\n format.json { render :show, status: :created, location: @car }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @car.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @railcar = Railcar.new(railcar_params)\n\n respond_to do |format|\n if @railcar.save\n format.html { redirect_to @railcar, notice: 'Railcar was successfully created.' }\n format.json { render :show, status: :created, location: @railcar }\n else\n format.html { render :new }\n format.json { render json: @railcar.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @race_car = RaceCar.new(race_car_params)\n\n respond_to do |format|\n if @race_car.save\n format.html { redirect_to @race_car, notice: 'Race car was successfully created.' }\n format.json { render :show, status: :created, location: @race_car }\n else\n format.html { render :new }\n format.json { render json: @race_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n if @person\n @car.people << @person\n format.html { redirect_to @person, notice: \"#{@person.name} got a new car!\" }\n format.json { render :show, status: :created, location: @person }\n else\n format.html { redirect_to @car, notice: 'Car created!' }\n format.json { render :show, status: :created, location: @car }\n end\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n authenticate_request!\n\n @car = Car.new(car_params)\n\n if @car.save\n render json: @car, status: :created, location: api_user_path(@car)\n else\n render json: @car.errors, status: :unprocessable_entity\n end\n end", "def create\n @car = Car.new(car_params)\n @car.id = Car.count\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def rental_car_params\n params.require(:rental_car).permit(:brand, :model, :additional_information)\n end", "def create\n @car = Car.new(params[:car])\n @car.seller_id = @current_seller.id\t\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render json: @car, status: :created, location: @car }\n else\n format.html { render action: \"new\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\r\n params.require(:car).permit(:car_number_plate, :origin_price, :status, :rental_price, :rent_status, :car_model_id,\r\n :quantity_of_seat_id)\r\n end", "def create\n @backoffice_car = Backoffice::Car.new(backoffice_car_params)\n\n respond_to do |format|\n if @backoffice_car.save\n format.html { redirect_to @backoffice_car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @backoffice_car }\n else\n format.html { render :new }\n format.json { render json: @backoffice_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @carro = Carro.new(carro_params)\n\n respond_to do |format|\n if @carro.save\n format.html { redirect_to @carro, notice: 'Carro was successfully created.' }\n format.json { render :show, status: :created, location: @carro }\n else\n format.html { render :new }\n format.json { render json: @carro.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:license, :manufac, :model, :rent_rate, :style, :location, :status)\n end", "def create\n @car_park = CarPark.new(car_park_params)\n\n respond_to do |format|\n if @car_park.save\n #@car_park\n format.html { redirect_to \"/car_parks/new\", notice: 'Car park was successfully created.' }\n #format.json { render :show, status: :created, location: @car_park }\n else\n format.html { render :new }\n format.json { render json: @car_park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car_park = CarPark.new(car_park_params)\n\n respond_to do |format|\n if @car_park.save\n format.html { redirect_to @car_park, notice: 'Car park was successfully created.' }\n format.json { render :show, status: :created, location: @car_park }\n else\n format.html { render :new }\n format.json { render json: @car_park.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t\t\tcurrent_driver.create_car(car_params)\n\t\t\tend", "def create\n @rented_car = RentedCar.new(rented_car_params)\n @rented_car.car_id = $car.id\n @rented_car.user_id = current_user.id\n @car = Car.find($car.id)\n\n # save also in total rents\n @total_rents = TotalRental.new\n @total_rents.car_id = $car.id\n @total_rents.user_id = current_user.id\n @total_rents.credit_card_no = @rented_car.credit_card_no\n @total_rents.cvc = @rented_car.cvc\n @total_rents.credit_expired_date = @rented_car.credit_expired_date\n @total_rents.rent_from_date = @rented_car.rent_from_date\n @total_rents.rent_to_date = @rented_car.rent_to_date\n @total_rents.save\n\n if @rented_car.save\n redirect_to @car\n else\n render 'new'\n end\n\n\n end", "def create\n @vehicle = Vehicle.new(vehicle_params)\n if @vehicle.save\n render json: { status: 'Vehicle created successfully', vehicle: @vehicle }, status: :created\n else\n render json: { errors: @vehicle.errors.full_messages }, status: :bad_request\n end\n end", "def create\n @car = Car.new(car_params)\n if @car.save\n flash[:success] = \"New car added!\"\n redirect_to @car\n else\n render :new\n end\n end", "def user_cars\n @cars = Car.where(user_id: params[:id])\n @bookings = Booking.select(:car_id).where(renter_id: params[:id])\n render json: @cars\n end", "def create\n @trycar = Trycar.new(trycar_params)\n respond_to do |format|\n if @trycar.save\n session[:car_id] = nil\n format.html { redirect_to @car, notice: 'Trycar was successfully created.' }\n format.json { render :show, status: :created, location: @Car }\n else\n format.html { render :new }\n format.json { render json: @Car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:name, :legal_num, :call_num, :mileage, :car_base, :car_photo, :radio_auto_quantity, :radio_portable_quantity, :armor_quantity, :baton_quantity, :helmet_quantity, :pistol_quantity, :machine_gun_quantity)\n end", "def create\n @car = current_user.cars.build(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: \"Car was successfully created.\" }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:make, :model, :year, :car_type, :color, :body_type, :engine_type, \n :transmission, :audio_input, :bluetooth, :heated_seats, :sun_roof, :rearview_camera, :gps, \n :air_conditioner, :electric_doors, :electric_seats, :condition, :video, :description, :latitude, \n :longitude, :price, :address, :city, :state, :driven_wheels, :vehichle_size, :fuel_type, \n :antilock_brake_system, avatars: [])\n end", "def create\n car = Car.find(params[:car_id])\n @car_item = @lease.car_items.build(car: car)\n redirect_to edit_car_item_path(car)\n \n # respond_to do |format|\n # if @car_item.save\n # format.html { redirect_to edit_car_item_path(car), notice: 'Car item was successfully created.' }\n # format.json { render action: 'show', status: :created, location: @car_item }\n # else\n # format.html { render action: 'new' }\n # format.json { render json: @car_item.errors, status: :unprocessable_entity }\n # end\n # end\n end", "def create\r\n @car = Car.new(car_params)\r\n p car_params\r\n respond_to do |format|\r\n if @car.save\r\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\r\n else\r\n format.html { render :new }\r\n end\r\n end\r\n end", "def create\n @car = current_user.cars.new(car_params)\n #@car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:location, :model, :manufacturer, :style, :status, :user_id,:license_number,:rental_rate)\n end", "def create\n @car = Car.new(car_params)\n\n if @car.save\n redirect_to @car, notice: 'Car was successfully created.'\n else\n render :new\n end\n end", "def create\n @car_info = CarInfo.new(car_info_params)\n\n respond_to do |format|\n if @car_info.save\n format.html { redirect_to @car_info, notice: 'Car info was successfully created.' }\n format.json { render :show, status: :created, location: @car_info }\n else\n format.html { render :new }\n format.json { render json: @car_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @cars = Car.all\n render json: @cars\n end", "def create\n @car = Car.new(car_params)\n\n respond_to do |format|\n if @car.save\n params[:photos]['image'].each do |p|\n @photo = @car.photos.create!(:image => p, :car_id => @car.id)\n end\n format.html { redirect_to @car, notice: 'Car was successfully added.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def rented_car_params\n params.require(:rented_car).permit(:credit_card_no, :cvc, :credit_expired_date, :rent_from_date, :rent_to_date)\n end", "def create\n @order_car = OrderCar.new(order_car_params)\n\n respond_to do |format|\n if @order_car.save\n format.html { redirect_to @order_car, notice: 'Order car was successfully created.' }\n format.json { render :show, status: :created, location: @order_car }\n else\n format.html { render :new }\n format.json { render json: @order_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:make_id, :description, :model_id, :year, :price, :carType, :transmission, :interior, :miles, :drive, :exterior, :epa, :vin, :image, :published, :featured, :reduced, :pending, :sold )\n end", "def set_rental_car\n @rental_car = RentalCar.find(params[:id])\n end", "def new\n @car = Car.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car }\n\t \n end\n end", "def car_params\n if(params.has_key?(:car))\n params.require(:car).permit(:make, :model, :year, :color, :vin, :licence, :picture_url, :picture_url_cache,\n :vehicle_type, :body_class, :doors, :gross_vehicle_weight_rating, :transmission_style, :engine_number_of_cylinders, :engine_power, :fuel_type)\n end\n\n end", "def index\n @cars = Car.all\n\n render json: @cars\n end", "def create\n @car_request = CarRequest.new(car_request_params)\n respond_to do |format|\n if @car_request.save\n format.html { redirect_to car_requests_url }\n format.json { render :show, status: :created, location: @car_request }\n else\n format.html { redirect_to new_car_search, notice: 'car request failed'}\n format.json { render json: @car_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @carrefour = Carrefour.new(carrefour_params)\n\n respond_to do |format|\n if @carrefour.save\n format.html { redirect_to @carrefour, notice: 'Carrefour was successfully created.' }\n format.json { render :show, status: :created, location: @carrefour }\n else\n format.html { render :new }\n format.json { render json: @carrefour.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n rental = sporting_goods.rentals.new(rental_params)\n rental.user_id = current_user.id\n if rental.save\n render json: rental, status: 200\n else\n render json: rental, status: 400\n end\n end", "def car_params\n params.require(:car).permit(:image, :make, :year, :model, :body_type, :number_plate, :condition, :price, :location_id, :status)\n end", "def create\n # @car = Car.new(car_params)\n @car.user_id = current_user.id\n \n respond_to do |format|\n if @car.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @rentals = @car.rentals.all\n end", "def create\n @car = Car.new(params[:car])\n @car.publisher_id = current_user.id\n @car.evaluator_id = User.evaluator.id\n if @car.save\n flash_t :success\n redirect_to case_car_url(@car)\n else\n title_t :new\n render :action => :new_car_accident\n end\n end", "def create\n @car = Car.find(params[:car_id])\n @bid = @car.bids.create(bid_params)\n @bid.user = current_user\n\n respond_to do |format|\n if @car.save\n format.html { redirect_to cars_path notice: 'Car was successfully created.'}\n format.json { head :no_content }\n else\n format.html { render action: 'new' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:name, :make, :model, :engine, :exterior, :interior, :delivery_kms, :stock_num, :msrp, :additional_fees, :base_price, :status, :image_url, :price_over)\n end", "def car_params\n params.require(:car).permit(:licensePlateNumber, :manufacturer, :model, :hourlyRentalRate, :style, :location, :status) \n end", "def new\n @car = Car.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @car }\n end\n end", "def car_params\n params.require(:car).permit(:model, :owner, :plate_no, :bay_id)\n end", "def create\n @car = Car.find(params[:car_id])\n @driver = @car.drivers.create(params[:driver])\n redirect_to car_path(@car)\n end", "def create\n @vehicle = get_vehicle_from_params\n\n respond_to do |format|\n if @vehicle.save!\n @vehicle.accounts << current_user.account\n format.html { redirect_to root_path, notice: 'Vehicle was successfully created.' }\n format.json { render @vehicle.id}#json: @vehicle, status: :created, location: @vehicle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @rental_cars = RentalCar.all\n end", "def car_params\n params.require(:car).permit(:carMake, :carModel, :zipCode, :radius)\n end", "def create\n @car = Car.new(car_params)\n @car.plate_number = params[:car][:plate_number].upcase\n @car.user_id = current_user.id\n @car.ip_address = request.remote_ip\n\n respond_to do |format|\n if @car.save\n current_user.car_id = @car.id\n current_user.save\n format.html { redirect_to @car, notice: 'Car was successfully created.' }\n format.json { render :show, status: :created, location: @car }\n else\n format.html { render :new }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:name, :year, :image, :price)\n end", "def create\n @car_item = Car::Item.new(car_item_params)\n\n respond_to do |format|\n if @car_item.save\n format.html { redirect_to @car_item, notice: 'Item was successfully created.' }\n format.json { render :show, status: :created, location: @car_item }\n else\n format.html { render :new }\n format.json { render json: @car_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:license, :manufacturer, :model, :rate, :style, :location, :status)\n end", "def create\n \n @carrito = Carrito.new(carrito_params)\n \n respond_to do |format|\n if @carrito.save\n format.html { redirect_to @carrito, notice: 'Carrito was successfully created.' }\n format.json { render :show, status: :created, location: @carrito }\n else\n format.html { render :new }\n format.json { render json: @carrito.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:model, :style, :licencePlateNum, :location, :status, :manufacturer, :hourlyRentalRate)\n end", "def create\n @car3 = Car3.new(car3_params)\n\n respond_to do |format|\n if @car3.save\n format.html { redirect_to @car3, notice: 'Car3 was successfully created.' }\n format.json { render :show, status: :created, location: @car3 }\n else\n format.html { render :new }\n format.json { render json: @car3.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:model, :manufacturer, :license, :rate, :location, :style, :status)\n end", "def car_params\n params.require(:car).permit(:car_make, :car_model, :car_version, :car_year, :car_city, :car_mileage, :car_price, :car_trans, :car_desc, :car_type, :car_approval, :user_id, photos_attributes: [:id, :image, :car_id])\n end", "def create\n @carro = @patio.carros.new(carro_params)\n\n respond_to do |format|\n if @carro.save\n format.html { redirect_to [@unidade, @patio, @carro], notice: 'Carro was successfully created.' }\n format.json { render :show, status: :created, location: [@unidade, @patio, @carro] }\n else\n format.html { render :new }\n format.json { render json: @carro.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:name, :description)\n end", "def create\n @truck = Truck.new(truck_params)\n @marcas = @truck.get_marcas() \n @modelos = @truck.get_modelos()\n \n\n respond_to do |format|\n if @truck.save\n format.html { redirect_to @truck, notice: 'Truck was successfully created.' }\n format.json { render :show, status: :created, location: @truck }\n else\n format.html { render :new }\n format.json { render json: @truck.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:available, :cover_photo, :car_id, :make, :module, :overall, :price_daily, :price_hourly, :price_weekly, :region, :street, :year)\n end", "def create\n @car = Car.new(car_params)\n if @car.save\n bay = Bay.find(car_params['bay_id'])\n bay.cars << @car\n bay.update(is_available: false) if (bay.size == 'single' && bay.bays_cars.where(left_at: nil).size == 1) || ((bay.size == 'double' && bay.bays_cars.where(left_at: nil).size == 2))\n bay.bays_cars.find_by(car_id: @car.id).update(parked_at: Time.now)\n flash[:notice] = 'Car was successfully parked.'\n redirect_to :controller => 'bays'\n else\n render :new\n end\n end", "def create\n @carproduct = Carproduct.new(carproduct_params)\n\n respond_to do |format|\n if @carproduct.save\n format.html { redirect_to @carproduct, notice: 'Carproduct was successfully created.' }\n format.json { render :show, status: :created, location: @carproduct }\n else\n format.html { render :new }\n format.json { render json: @carproduct.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @carpool = Carpool.new(params[:carpool])\n\n respond_to do |format|\n if @carpool.save\n format.html { redirect_to @carpool, notice: 'Carpool was successfully created.' }\n format.json { render json: @carpool, status: :created, location: @carpool }\n else\n format.html { render action: \"new\" }\n format.json { render json: @carpool.errors, status: :unprocessable_entity }\n end\n end\n end", "def trycar_params\n params.require(:trycar).permit(:name, :old, :address, :phone, :driver_license, :car_id, :fee_trial)\n end", "def create\n @car_specific_spec = CarSpecificSpec.new(car_specific_spec_params)\n\n respond_to do |format|\n if @car_specific_spec.save\n format.html { redirect_to @car_specific_spec, notice: 'Car specific spec was successfully created.' }\n format.json { render :show, status: :created, location: @car_specific_spec }\n else\n format.html { render :new }\n format.json { render json: @car_specific_spec.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car2 = Car2.new(car2_params)\n\n respond_to do |format|\n if @car2.save\n format.html { redirect_to @car2, notice: 'Car2 was successfully created.' }\n format.json { render :show, status: :created, location: @car2 }\n else\n format.html { render :new }\n format.json { render json: @car2.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:model, :year, :chassis, :description)\n end", "def get_cars\n relatable_category_ids = params[:car_calculator][:relatable_category_ids]\n relatable_category_ids << params[:car_calculator][:model]\n result = CarApp.calculated_session.related_objects_from_relatable_categories(\"car\", relatable_category_ids) \n final_result = []\n result = (result || []).each_pair do |key, value| \n final_result << {:name => value, :value => key}\n end\n render :json => {:options => final_result}.to_json\n end", "def create\n @rent = Rent.new(rent_params)\n\n respond_to do |format|\n if @rent.save\n format.html { redirect_to @rent, notice: 'Rent was successfully created.' }\n format.json { render :show, status: :created, location: @rent }\n else\n format.html { render :new }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @car_order = CarOrder.new(car_order_params)\n\n respond_to do |format|\n if @car_order.save\n format.html { redirect_to @car_order, notice: 'Car order was successfully created.' }\n format.json { render :show, status: :created, location: @car_order }\n else\n format.html { render :new }\n format.json { render json: @car_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def renting_params\n params.require(:renting).permit(:expense, :income, :total, :payment_date, :car_id, :renter_id)\n end", "def create\n @car_model = CarModel.new(params[:car_model])\n\n respond_to do |format|\n if @car_model.save\n @search = CarModel.search(params[:search])\n @car_models = @search.page params[:page]\n format.html { redirect_to @car_model, notice: '车辆品牌新建成功' }\n format.json { render json: @car_model, status: :created, location: @car_model }\n else\n format.html { render action: \"new\" }\n format.json { render json: @car_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @vehicle = Vehicle.new()\n\n \n # Populate the basic information from the form\n @vehicle.make = params[:vehicle][:make]\n @vehicle.model = params[:vehicle][:model]\n @vehicle.miles = params[:vehicle][:miles]\n @vehicle.colour = params[:vehicle][:colour]\n @vehicle.image = params[:vehicle][:image]\n @vehicle.owners = params[:vehicle][:owners]\n @vehicle.reg = params[:vehicle][:reg]\n @vehicle.price = params[:vehicle][:price]\n @vehicle.description = params[:vehicle][:description]\n \n myCar = BasicModelCar.new(@vehicle.make, @vehicle.model, @vehicle.miles, @vehicle.colour, @vehicle.image, @vehicle.owners, @vehicle.reg, @vehicle.price, @vehicle.description)\n crashLogger = CrashLogger.instance\n # Add some additional features to our new car\n # the statements could be written inline: params[:newcar][:fireExt].to_s.length > 0 ? myCar = FireExtinguisher.new(myCar) : null\n if params[:vehicle][:NCT].to_s.length > 0 then\n myCar = NCT.new(myCar)\n end\n if params[:vehicle][:Taxed].to_s.length > 0 then\n myCar = Taxed.new(myCar)\n end\n if params[:vehicle][:ExtendedWarranty].to_s.length > 0 then\n myCar = ExtendedWarranty.new(myCar)\n end\n if params[:vehicle][:Crashed].to_s.length > 0 then\n crashLogger.logCrash(@vehicle.reg.to_s)\n end\n \n ##Populate the cost and description information\n @vehicle.price = myCar.getPrice\n @vehicle.description = myCar.getDescription\n\n respond_to do |format|\n if @vehicle.save\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully created.' }\n format.json { render json: @vehicle, status: :created, location: @vehicle }\n else\n format.html { render action: \"new\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def car_params\n params.require(:car).permit(:make, :model, :vehicleType, :capacity, :baggingCapacity, :rentPrice, :img)\n end", "def car_params\n params.require(:car).permit(:model, :make, :color, :mileage, :is_for_sale)\n end", "def car_params\r\n params.require(:car).permit(:vinnumber, :year, :make, :model, :titlestatus_id, :keystatus_id, :order_id)\r\n end", "def get_part_by_car_category\n @cars = PartsController::PartService.get_part_by_car_category(params[:paran_car], params[:paran_category]);\n respond_to do |format|\n format.json { render json: @cars }\n end \n end", "def car_params\n params.require(:car).permit(:name, :base_price, :battery_capacity, :range, :brand, :dc_charging, :ac_charging, :plug_type, :consumption, :rental_battery, :top_speed, :continuous_speed, :acceleration, :seats, :frunk_space, :trunk_space, :frunk_space_big, :weight, :battery_voltage, :camper_mode, :interiour_sounds, :exteriour_sounds, :drive_axle, :max_power, :max_regen, :battery_temp_control, :battery_cell_type, :battery_chemistry, :motor_type, :charging_network, :towing_capacity, :app_access)\n end", "def create\n @caricullum = Caricullum.new(params[:caricullum])\n\n respond_to do |format|\n if @caricullum.save\n format.html { redirect_to @caricullum, notice: 'Caricullum was successfully created.' }\n format.json { render json: @caricullum, status: :created, location: @caricullum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @caricullum.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.72345227", "0.69063675", "0.6847033", "0.68284893", "0.68284893", "0.68284893", "0.68284893", "0.68284893", "0.68284893", "0.68284893", "0.68178475", "0.67889917", "0.67889917", "0.6740238", "0.67308533", "0.6710483", "0.6614746", "0.660719", "0.653375", "0.64877975", "0.64450926", "0.6441303", "0.6437762", "0.64034873", "0.63842815", "0.6380105", "0.63567924", "0.63417524", "0.633643", "0.6320972", "0.62868375", "0.62834454", "0.62812966", "0.62784296", "0.6266995", "0.626468", "0.6251534", "0.62242323", "0.6214336", "0.6214288", "0.6192822", "0.61751723", "0.61616725", "0.6161635", "0.61606896", "0.6155158", "0.6154658", "0.6153358", "0.6137668", "0.61352146", "0.6130365", "0.6128371", "0.6128277", "0.6120163", "0.6114708", "0.6113109", "0.6105902", "0.6101986", "0.609916", "0.6094997", "0.60934937", "0.60931826", "0.60880345", "0.6077673", "0.6076073", "0.60716456", "0.60644156", "0.60573375", "0.60541254", "0.6031424", "0.6029734", "0.6024978", "0.6019618", "0.6017219", "0.6013479", "0.6012397", "0.60062355", "0.60056823", "0.5994644", "0.5993556", "0.5989634", "0.59893125", "0.597687", "0.59752584", "0.595866", "0.5947409", "0.5944483", "0.59435886", "0.5939514", "0.5927953", "0.59230375", "0.5911443", "0.5903292", "0.5899894", "0.589942", "0.5896101", "0.5895827", "0.5895064", "0.5892358", "0.58837575" ]
0.7420582
0
PATCH/PUT /rental_cars/1 PATCH/PUT /rental_cars/1.json
def update respond_to do |format| if @rental_car.update(rental_car_params) format.html { redirect_to rental_cars_path, notice: 'Rental car was successfully updated.' } format.json { render :index, status: :ok, location: @rental_car } else format.html { render :edit } format.json { render json: @rental_car.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @car = Car.find(params[:id])\n\n if @car.update(car_params)\n head :no_content\n else\n render json: @car.errors, status: :unprocessable_entity\n end\n end", "def update\n authenticate_request!\n\n @car = Car.find(params[:id])\n\n if @car.update(car_params)\n head :no_content\n else\n render json: @car.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @car_specific_spec.update(car_specific_spec_params)\n format.html { redirect_to @car_specific_spec, notice: 'Car specific spec was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_specific_spec }\n else\n format.html { render :edit }\n format.json { render json: @car_specific_spec.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @car = Car.find(params[:id])\n\n respond_to do |format|\n if @car.update_attributes(params[:car])\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @car = Car.find(params[:id])\n\n respond_to do |format|\n if @car.update_attributes(params[:car])\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #@car = Car.find(params[:id])\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car (' + @car.name + ') was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car updated!' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: \"Car was successfully updated.\" }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # @car = Car.update(order_params)\n \n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @rental.update(rental_params)\n format.html do\n redirect_to car_rentals_path(@car)\n flash[:success] = 'Booking was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @rental }\n else\n format.html { render :edit }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n @car = Car.find(params[:id])\n if @car.update(car_params)\n format.html {\n flash[:success] = 'Update the car information successfully!'\n redirect_to cars_path\n }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html {\n flash[:danger] = 'Failed to update the car information!'\n redirect_to edit_car_path\n }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle }\n put_request\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @car.update(car_params)\r\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @car }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @car.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @car_model = CarModel.find(params[:id])\n\n respond_to do |format|\n if @car_model.update_attributes(params[:car_model])\n format.html { redirect_to @car_model, notice: 'Car model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n format.html { redirect_to @car, notice: 'Dane samochodu zostały zaktualizowane.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @car1 = current_user.cars1.find(params[:id]) \n respond_to do |format|\n if @cars1.update(cars1_params)\n format.html { redirect_to @cars1, notice: 'Cars1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @cars1 }\n else\n format.html { render :edit }\n format.json { render json: @cars1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @car = Car.find(params[:id])\n respond_to do |format|\n if @car.update_attributes(params[:car])\n format.html { redirect_to edit_case_car_url, notice=> '更新车辆信息成功!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @race_car.update(race_car_params)\n format.html { redirect_to @race_car, notice: 'Race car was successfully updated.' }\n format.json { render :show, status: :ok, location: @race_car }\n else\n format.html { render :edit }\n format.json { render json: @race_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @railcar.update(railcar_params)\n format.html { redirect_to @railcar, notice: 'Railcar was successfully updated.' }\n format.json { render :show, status: :ok, location: @railcar }\n else\n format.html { render :edit }\n format.json { render json: @railcar.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n current_user.car_id = @car.id\n current_user.save\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car_item.update(car_item_params)\n format.html { redirect_to @car_item, notice: 'Car item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @car_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "def update\n respond_to do |format|\n if @backoffice_car.update(backoffice_car_params)\n format.html { redirect_to @backoffice_car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @backoffice_car }\n else\n format.html { render :edit }\n format.json { render json: @backoffice_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @carro.update(carro_params)\n format.html { redirect_to @carro, notice: 'Carro was successfully updated.' }\n format.json { render :show, status: :ok, location: @carro }\n else\n format.html { render :edit }\n format.json { render json: @carro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car_info.update(car_info_params)\n format.html { redirect_to @car_info, notice: 'Car info was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_info }\n else\n format.html { render :edit }\n format.json { render json: @car_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @vehicle.update(vehicle_params)\n render json: { status: 'Vehicle was successfully updated', vehicle: @vehicle }, status: :ok\n else\n render json: { errors: @vehicle.errors.full_messages }, status: :bad_request\n end\n end", "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "def update\n @car_option = CarOption.find(params[:id])\n\n respond_to do |format|\n if @car_option.update_attributes(params[:car_option])\n format.html { redirect_to @car_option, notice: 'Car option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car_option.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n reservation = Reservation.find(params[:id])\n respond_to do |format|\n if reservation.update(car_params)\n format.html { render :show,:locals => {:reservation => reservation}, notice: 'Reservation was successfully created.' }\n format.json { render :show,:locals => {:reservation => reservation}, status: :ok, location: reservation }\n else\n format.html { render :edit,:locals => {:reservation => reservation} }\n format.json { render json: reservation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @carpool = Carpool.find(params[:id])\n\n respond_to do |format|\n if @carpool.update_attributes(params[:carpool])\n format.html { redirect_to @carpool, notice: 'Carpool was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @carpool.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cars_part.update(cars_part_params)\n format.html { redirect_to @cars_part, notice: 'Cars part was successfully updated.' }\n format.json { render :show, status: :ok, location: @cars_part }\n else\n format.html { render :edit }\n format.json { render json: @cars_part.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #@car = Car.find(params[:id])\n @seller = Seller.find(params[:seller_id])\n @car = @seller.cars.find(params[:id])\n if @car.update_attributes(params[:car])\n flash[:notice] = \"Car advert successfully updated!\"\n redirect_to seller_url(@car.seller_id)\n else\n render :action => 'edit'\n end\n #respond_to do |format|\n # if @car.update_attributes(params[:car])\n # format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n # format.json { head :ok }\n #else\n # format.html { render action: \"edit\" }\n #format.json { render json: @car.errors, status: :unprocessable_entity }\n #end\n #end\n end", "def update\n respond_to do |format|\n if @order_car.update(order_car_params)\n format.html { redirect_to @order_car, notice: 'Order car was successfully updated.' }\n format.json { render :show, status: :ok, location: @order_car }\n else\n format.html { render :edit }\n format.json { render json: @order_car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n if @vehicle.update_attributes(params[:vehicle])\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @vehicle = Vehicle.find(params[:id])\n\n respond_to do |format|\n if @vehicle.update_attributes(params[:vehicle])\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @my_car = MyCar.find(params[:id])\n\n respond_to do |format|\n if @my_car.update_attributes(params[:my_car])\n format.html { redirect_to(@my_car, :notice => 'My car was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @my_car.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @car = Car.find(params[:car_id])\n @lien_procedure = @car.lien_procedures.find(params[:id])\n\n respond_to do |format|\n if @lien_procedure.update_attributes(params[:lien_procedure])\n format.html { redirect_to @car, notice: 'Lien procedure was updated successfully.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lien_procedure.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n time = parse_time params[:rental].delete(:date), params[:rental].delete(:time)\n params[:rental][:time] = time if time\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n customer_id = params[:customer][:id]\n render json: { errors: [\"Customer with id #{customer_id} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n respond_to do |format|\n if @car_item.update(car_item_params)\n format.html { redirect_to @car_item, notice: 'Item was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_item }\n else\n format.html { render :edit }\n format.json { render json: @car_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car3.update(car3_params)\n format.html { redirect_to @car3, notice: 'Car3 was successfully updated.' }\n format.json { render :show, status: :ok, location: @car3 }\n else\n format.html { render :edit }\n format.json { render json: @car3.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_rental_car\n @rental_car = RentalCar.find(params[:id])\n end", "def update\n\n\n creditCardNo = $rented_car.credit_card_no\n cvc = $rented_car.cvc\n cardExpiredDate = $rented_car.credit_expired_date\n rentFromDate = $rented_car.rent_from_date\n rentToDate = $rented_car.rent_to_date\n car_id = $rented_car.car_id\n user_id = $rented_car.user_id\n\n @rented_car = RentedCar.new(rented_car_params)\n RentedCar.find($rented_car.id).destroy\n\n # update also in total rents\n @total_rents = TotalRental.new\n TotalRental.find($rented_car.id).destroy\n @total_rents.car_id = car_id\n @total_rents.user_id = user_id\n @total_rents.credit_card_no = @rented_car.credit_card_no\n @total_rents.cvc = @rented_car.cvc\n @total_rents.credit_expired_date = @rented_car.credit_expired_date\n @total_rents.rent_from_date = @rented_car.rent_from_date\n @total_rents.rent_to_date = @rented_car.rent_to_date\n @total_rents.save\n\n\n # @rented_car.credit_card_no = creditCardNo\n # @rented_car.cvc = cvc\n # @rented_car.credit_expired_date = cardExpiredDate\n # @rented_car.rent_from_date = rentFromDate\n # @rented_car.rent_to_date = rentToDate\n @rented_car.car_id = car_id\n @rented_car.user_id = user_id\n\n\n logger.info \"@rented car: #{@rented_car}\"\n logger.info \"global car: #{$rented_car}\"\n\n if @rented_car.save\n redirect_to rent_car_path\n else\n render 'edit'\n end\n end", "def update\n respond_to do |format|\n if @vehicle_model.update(vehicle_model_params)\n format.html { redirect_to @vehicle_brand, notice: 'Vehicle model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rental = Rental.find_by_id params[:rental][:id]\n store = Store.find_by_location params[:rental].delete(:location)\n params[:rental][:time] = parse_time(params[:rental].delete(:date), params[:rental].delete(:time))\n params[:rental][:store_id] = store.try(:id)\n if @rental.nil?\n render json: { errors: [\"Customer with id #{params[:customer][:id]} could not be found\"] }, status: 403\n elsif @rental.update_attributes params[:rental]\n render json: @rental\n else\n render json: { errors: @rental.errors.full_messages }, status: 422\n end\n # @new_quantities = params[:rental].delete(:quantities)\n # if @new_quantities && @rental\n # @rental.rental_bikes.destroy_all\n # build_rental_bikes(@new_quantities) if @rental\n # end\n # render json: @rental.to_json if @rental.try(:save)\n end", "def update\n respond_to do |format|\n if @car2.update(car2_params)\n format.html { redirect_to @car2, notice: 'Car2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @car2 }\n else\n format.html { render :edit }\n format.json { render json: @car2.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @car.update(car_params)\r\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\r\n else\r\n format.html { render :edit }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @car_park.update(car_park_params)\n format.html { redirect_to @car_park, notice: 'Car park was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_park }\n else\n format.html { render :edit }\n format.json { render json: @car_park.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car_park.update(car_park_params)\n format.html { redirect_to @car_park, notice: 'Car park was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_park }\n else\n format.html { render :edit }\n format.json { render json: @car_park.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n authorize @car\n if @car.update(car_params)\n redirect_to car_path(@car)\n else\n render :edit\n end\n end", "def update\n respond_to do |format|\n old_location = Location.find(@car.location_id)\n if @car.update(car_params)\n new_location = Location.find(@car.location_id)\n \n old_location.status = \"Available\"\n old_location.save\n \n new_location.status = \"Unavailable\"\n new_location.save\n \n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car_feature.update(car_feature_params)\n format.html { redirect_to @car_feature, notice: 'Car feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_feature }\n else\n format.html { render :edit }\n format.json { render json: @car_feature.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car_order.update(car_order_params)\n format.html { redirect_to @car_order, notice: 'Car order was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_order }\n else\n format.html { render :edit }\n format.json { render json: @car_order.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @carry.update(carry_params)\n format.html { redirect_to @carry, notice: 'Carry was successfully updated.' }\n format.json { render :show, status: :ok, location: @carry }\n else\n format.html { render :edit }\n format.json { render json: @carry.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @carproduct.update(carproduct_params)\n format.html { redirect_to @carproduct, notice: 'Carproduct was successfully updated.' }\n format.json { render :show, status: :ok, location: @carproduct }\n else\n format.html { render :edit }\n format.json { render json: @carproduct.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle }\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle }\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to @vehicle, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle }\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle_army.update(vehicle_army_params)\n format.html { redirect_to @vehicle_army, notice: (t 'vehicle_armies.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_army.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n @car = Car.find(params[:id])\n if @car.update_attributes(car_params)\n flash[:sucess] = \"Car info updated.\"\n redirect_to @car\n else\n render :edit\n end\n end", "def update\n respond_to do |format|\n if @rent.update(rent_params)\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @carpool.update(carpool_params)\n format.html { redirect_to @carpool, notice: 'Carpool was successfully updated.' }\n format.json { render :show, status: :ok, location: @carpool }\n else\n format.html { render :edit }\n format.json { render json: @carpool.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @caricullum = Caricullum.find(params[:id])\n\n respond_to do |format|\n if @caricullum.update_attributes(params[:caricullum])\n format.html { redirect_to @caricullum, notice: 'Caricullum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @caricullum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rent = Rent.find(params[:id])\n\n respond_to do |format|\n if @rent.update_attributes(params[:rent])\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @rental = Rental.find(params[:id])\n rental_data = params[:rental]\n photo_ids = rental_data.delete :photo_ids\n\n respond_to do |format|\n if @rental.update_attributes(rental_data)\n update_photos_with_rental_id photo_ids, @rental\n\n format.html { redirect_to @rental, notice: 'Rental was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @cari.update(cari_params)\n format.html { redirect_to @cari, notice: 'Cari was successfully updated.' }\n format.json { render :show, status: :ok, location: @cari }\n else\n format.html { render :edit }\n format.json { render json: @cari.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @car = Car.find(params[:id])\n @dealer = @car.dealer\n \n if (@dealer.id != current_user.dealer_id && current_user.id != @dealer.user_id && !current_user.admin)\n redirect_to dealers_path, notice: 'You do not have permission to modify Car!' and return\n end\n \n respond_to do |format|\n if @car.update_attributes(params[:car])\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @apprentice = Apprentice.find(params[:id])\n\n respond_to do |format|\n if @apprentice.update_attributes(params[:apprentice])\n format.html { redirect_to @apprentice, notice: 'Apprentice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apprentice.errors, status: :unprocessable_entity }\n end\n end\n end", "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 # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @car.update(car_params)\n unless params[:photos].blank?\n params[:photos]['image'].each do |p|\n @photo = @car.photos.create!(:image => p, :car_id => @car.id)\n end\n end\n format.html { redirect_to @car, notice: 'Car was successfully updated.' }\n format.json { render :show, status: :ok, location: @car }\n else\n format.html { render :edit }\n format.json { render json: @car.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @car_model.update(car_model_params)\r\n format.html { redirect_to @car_model, notice: 'Car model was successfully updated.' }\r\n else\r\n format.html { render :edit }\r\n end\r\n end\r\n end", "def update\n respond_to do |format|\n if @vehicle_info.update(vehicle_info_params)\n format.html { redirect_to @vehicle_info, notice: 'Vehicle info was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehicle_info }\n else\n format.html { render :edit }\n format.json { render json: @vehicle_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@car = Car.find( params[:id] )\n\t\tif @car.update_attributes( car_params )\n\t\t\tredirect_to car_path( params[:id] )\n\t\tend\n\tend", "def update\n @sub_car = SubCar.find(params[:id])\n\n respond_to do |format|\n if @sub_car.update_attributes(params[:sub_car])\n format.html { redirect_to(@sub_car, :notice => 'Sub car was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sub_car.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @review = Review.find(params[:id])\n @review.update(review_params)\n render json: @review\n end", "def update\n respond_to do |format|\n if @rent.update(rent_params)\n format.html { redirect_to @rent, notice: 'Rent was successfully updated.' }\n format.json { render :show, status: :ok, location: @rent }\n else\n format.html { render :edit }\n format.json { render json: @rent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @car = Car.find(params[:id])\n\n if @car.update_attributes(params[:car])\n redirect_to @car, notice: 'Ihr Auto wurde erfolgreich aktualisiert.'\n else\n render action: \"edit\"\n end\n end", "def update\n respond_to do |format|\n if @rental.update(rental_params)\n format.html { redirect_to @rental, notice: \"Rental was successfully updated.\" }\n format.json { render :show, status: :ok, location: @rental }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @rental.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @car_manufacturer.update(car_manufacturer_params)\n format.html { redirect_to @car_manufacturer, notice: 'Car manufacturer was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_manufacturer }\n else\n format.html { render :edit }\n format.json { render json: @car_manufacturer.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @carrefour.update(carrefour_params)\n format.html { redirect_to @carrefour, notice: 'Carrefour was successfully updated.' }\n format.json { render :show, status: :ok, location: @carrefour }\n else\n format.html { render :edit }\n format.json { render json: @carrefour.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle.update(vehicle_params)\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully updated.' }\n format.json { render :show, status: :ok, location: @vehcile }\n else\n format.html { render :edit }\n format.json { render json: @vehicle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n respond_to do |format|\n if @carrito.update(carrito_params)\n format.html { redirect_to @carrito, notice: 'Carrito was successfully updated.' }\n format.json { render :show, status: :ok, location: @carrito }\n else\n format.html { render :edit }\n format.json { render json: @carrito.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @carrito_item = CarritoItem.find(params[:id])\n\n respond_to do |format|\n if @carrito_item.update_attributes(params[:carrito_item])\n format.html { redirect_to @carrito_item, notice: 'Carrito item was successfully updated.' }\n format.js\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.js\n format.json { render json: @carrito_item.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @vehicle_card.update(vehicle_card_params)\n format.html { redirect_to @vehicle_card, notice: (t 'vehicle_cards.title')+(t 'actions.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_card.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.7065507", "0.7058446", "0.6793542", "0.6776894", "0.6776894", "0.672278", "0.66935647", "0.66935647", "0.66656405", "0.6629475", "0.66082126", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.6607564", "0.65508837", "0.65182024", "0.65100116", "0.6509894", "0.6502026", "0.64638305", "0.6450878", "0.6444656", "0.64395356", "0.6436898", "0.6425473", "0.6410449", "0.6393592", "0.6390546", "0.63647014", "0.6348638", "0.63451403", "0.6329178", "0.6306878", "0.62902886", "0.62691206", "0.62601274", "0.62579167", "0.6257752", "0.6255702", "0.6249158", "0.6249158", "0.624781", "0.62374157", "0.62210995", "0.62151366", "0.6212076", "0.6211823", "0.6199873", "0.6194396", "0.6177786", "0.6170623", "0.6158146", "0.6154575", "0.6154575", "0.6141401", "0.6133717", "0.61312157", "0.6114954", "0.6114918", "0.6103022", "0.6083734", "0.6083734", "0.6083734", "0.6080306", "0.6079602", "0.60763264", "0.60623443", "0.6054174", "0.60469735", "0.603835", "0.603626", "0.6026036", "0.60222715", "0.6020686", "0.60147893", "0.6012912", "0.59983474", "0.5996443", "0.5994786", "0.5987464", "0.59852827", "0.596964", "0.59667987", "0.5966022", "0.5964228", "0.596051", "0.5958533", "0.5954631", "0.59520817", "0.5939517", "0.5924436", "0.59233075" ]
0.7066692
0
DELETE /rental_cars/1 DELETE /rental_cars/1.json
def destroy @rental_car.destroy respond_to do |format| format.html { redirect_to rental_cars_url, notice: 'Rental car was successfully destroyed.' } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @car = Car.find(params[:id])\n @car.destroy\n\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @car = Car.find(params[:id])\n @car.destroy\n\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end", "def remove_car\n \t@quote_car = QuoteCar.where(id: params[:car])\n @quote_car.destroy\n return render_json_response({:msg => \"ok\"}, :ok)\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car deleted!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully removed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n\n head :no_content\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car (' + @car.name + ') was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @railcar.destroy\n respond_to do |format|\n format.html { redirect_to railcars_url, notice: 'Railcar was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car = Car.find(params[:id])\n @car.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_cars_url(:type=>@car.type), notice=> '车辆删除成功!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car_item.destroy\n respond_to do |format|\n format.html { redirect_to car_items_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rented_car = current_user.rented_cars.where(car_id: params[:id]).first\n @rented_car.destroy\n logger.info \"here\"\n # respond_to do |format|\n # format.html { redirect_to rented_cars_url, notice: 'Rented car was successfully destroyed.' }\n # format.json { head :no_content }\n # end\n redirect_to rent_car_path\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: \"Car was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n authenticate_request!\n\n @car = Car.find(params[:id])\n @car.destroy\n\n head :no_content\n end", "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @car_wash.destroy\n respond_to do |format|\n format.html { redirect_to car_washes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.destroy\n\n respond_to do |format|\n format.html { redirect_to vehicles_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @car = Car.find(params[:car_id])\n @bid = @car.bids.find(params[:id])\n @bid.destroy\n\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trycar.destroy\n respond_to do |format|\n format.html { redirect_to trycars_url, notice: 'Trycar was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent = Rent.find(params[:id])\n @rent.destroy\n\n respond_to do |format|\n format.html { redirect_to rents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_car = MyCar.find(params[:id])\n @my_car.destroy\n\n respond_to do |format|\n format.html { redirect_to(my_cars_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @caricullum = Caricullum.find(params[:id])\n @caricullum.destroy\n\n respond_to do |format|\n format.html { redirect_to caricullums_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cartridge.destroy\n respond_to do |format|\n format.html { redirect_to cartridges_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @car_item.destroy\n respond_to do |format|\n format.html { redirect_to car_items_url, notice: 'Item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @cars1.destroy\n @car1 = current_user.cars1.find(params[:id]) \n car1.destroy\n respond_to do |format|\n format.html { redirect_to cars1s_url, notice: 'Cars1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @carrefour.destroy\n respond_to do |format|\n format.html { redirect_to carrefours_url, notice: 'Carrefour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental = Rental.find(params[:id])\n @rental.destroy\n\n respond_to do |format|\n format.html { redirect_to rentals_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @vehicle.destroy\n render json: { status: 'Vehicle was successfully destroyed' }, status: :ok\n end", "def destroy\n @car_request.destroy\n respond_to do |format|\n format.html { redirect_to car_requests_url, notice: 'Car request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sub_car = SubCar.find(params[:id])\n @sub_car.destroy\n\n respond_to do |format|\n format.html { redirect_to(sub_cars_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n vehicle = Vehicle.where(uid: params[:id]).first\n # vehicle.locations.destroy_all\n vehicle.destroy\n render nothing: true, :status =>204\n end", "def destroy\n @rental = Rental.where(:license => @car.license, :status => 'Checked out')\n if !@rental.empty?\n redirect_to cars_url, notice: 'Car has been checked out thus can not be deleted until returned.'\n else\n @rental = Rental.where(:license => @car.license, :status => 'Reserved')\n @rental.each do |r|\n Rental.update(r.id,:status => \"Cancelled\")\n end\n @car.destroy\n respond_to do |format|\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed and it\\'s reservations were cancelled.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @carrito.destroy\n respond_to do |format|\n format.html { redirect_to carritos_url, notice: 'Carrito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html do\n redirect_to car_rentals_path(@car)\n flash[:success] = 'Booking was successfully destroyed.'\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @order_car.destroy\n respond_to do |format|\n format.html { redirect_to order_cars_url, notice: 'Order car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @food_truck.destroy\n respond_to do |format|\n format.html { redirect_to food_trucks_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @carry.destroy\n respond_to do |format|\n format.html { redirect_to carries_url, notice: 'Carry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url, notice: 'Rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rent.destroy\n respond_to do |format|\n format.html { redirect_to rents_url, notice: 'Rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car3.destroy\n respond_to do |format|\n format.html { redirect_to car3s_url, notice: 'Car3 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car = Car.find(params[:id])\n reservations = Reservation.where(car_id: @car.id)\n reservations.destroy_all\n @car.destroy\n flash[:success] = 'Car deleted.'\n redirect_to cars_url\n end", "def destroy\n @backoffice_car.destroy\n respond_to do |format|\n format.html { redirect_to backoffice_cars_url, notice: 'Car was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car_specific_spec.destroy\n respond_to do |format|\n format.html { redirect_to car_specific_specs_url, notice: 'Car specific spec was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car_info.destroy\n respond_to do |format|\n format.html { redirect_to car_infos_url, notice: 'Car info was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @showcar.destroy\n respond_to do |format|\n format.html { redirect_to showcars_url, notice: 'Showcar was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @data = @recipe.delete(params[:id])\n render json: @data\n end", "def destroy\n @apprentice = Apprentice.find(params[:id])\n @apprentice.destroy\n\n respond_to do |format|\n format.html { redirect_to apprentices_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle_army.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_armies_url, notice: (t 'vehicle_armies.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end", "def destroy\n @car = Car.find(params[:car_id])\n @lien_procedure = @car.lien_procedures.find(params[:id])\n @lien_procedure.destroy\n\n respond_to do |format|\n format.html { redirect_to @car }\n format.json { head :no_content }\n end\n end", "def destroy\n @car2.destroy\n respond_to do |format|\n format.html { redirect_to car2s_url, notice: 'Car2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end", "def destroy\n @vehicletype.destroy\n respond_to do |format|\n format.html { redirect_to vehicletypes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @field_rent.destroy\n respond_to do |format|\n format.html { redirect_to field_rents_url, notice: 'Field rent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n # @recipe = Recipe.find(params[:id])\n # @recipe.destroy\n #\n destroy! do |format|\n # format.html { redirect_to recipes_url }\n # format.json { head :ok }\n end\n end", "def destroy\n @lease = Lease.find(params[:id])\n\n car = Car.where(:registration => @lease.registration).first\n car.update_attributes(:longtermassigned => false)\n \n @lease.destroy\n\n respond_to do |format|\n format.html { redirect_to cars_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'Vehicle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @vehicle.destroy\n respond_to do |format|\n format.html { redirect_to vehicles_url, notice: 'El vehículo seleccionado fue eliminado' }\n format.json { head :no_content }\n end\n end", "def destroy\n @chase_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @chase_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "def destroy\n @carro.destroy\n respond_to do |format|\n format.html { redirect_to unidade_patio_carros_url(@unidade, @patio), notice: 'Carro was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @carpool = Carpool.find(params[:id])\n @carpool.destroy\n\n respond_to do |format|\n format.html { redirect_to carpools_url }\n format.json { head :no_content }\n end\n end", "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def destroy\n @car_option = CarOption.find(params[:id])\n @car_option.destroy\n\n respond_to do |format|\n format.html { redirect_to car_options_url }\n format.json { head :no_content }\n end\n end", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @cari.destroy\n respond_to do |format|\n format.html { redirect_to caris_url, notice: 'Cari was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @car = Car.find(params[:car_id])\n @asset = @car.assets.find(params[:id])\n @asset.destroy\n\n redirect_to car_path(@car)\n end", "def destroy\n @carro = Carro.find(params[:id])\n @carro.destroy\n\n respond_to do |format|\n format.html { redirect_to(carros_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @vehicle_type.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_types_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: 'Rental was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @detalle_carrito.destroy\n respond_to do |format|\n format.html { redirect_to detalle_carritos_url, notice: 'Detalle carrito was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @rental.destroy\n respond_to do |format|\n format.html { redirect_to rentals_url, notice: \"Rental was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @car.destroy\r\n respond_to do |format|\r\n format.html { redirect_to cars_url, notice: 'Car was successfully destroyed.' }\r\n end\r\n end", "def destroy\n @load_vehicle.destroy\n respond_to do |format|\n format.html { redirect_to load_vehicle_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @recipe.destroy\n\n respond_to do |format|\n format.html { redirect_to recipes_url }\n format.json { head :ok }\n end\n end", "def destroy\n @recipe.destroy\n respond_to do |format|\n format.html { redirect_to recipes_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.73858577", "0.73858577", "0.73850286", "0.73850286", "0.73323447", "0.7266304", "0.72424483", "0.722783", "0.72217613", "0.7181927", "0.71810055", "0.7178219", "0.7172007", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71236455", "0.71235794", "0.7121574", "0.70345485", "0.70322084", "0.70319515", "0.7026302", "0.7026302", "0.7015046", "0.6999028", "0.69949657", "0.6985509", "0.6985415", "0.69642335", "0.6944937", "0.69365126", "0.6931339", "0.6930293", "0.6924622", "0.6919915", "0.69100595", "0.68816197", "0.6872798", "0.68697566", "0.6864379", "0.68605006", "0.68596435", "0.6858091", "0.685733", "0.6854082", "0.6847249", "0.6842493", "0.6842493", "0.6839904", "0.6839351", "0.68386906", "0.6833292", "0.6833067", "0.68298274", "0.6829323", "0.6827081", "0.68228966", "0.68034035", "0.67861176", "0.6780392", "0.677321", "0.677047", "0.6762531", "0.6757202", "0.6755505", "0.6755505", "0.6755505", "0.6755505", "0.6749749", "0.67486066", "0.67400444", "0.67359006", "0.67359006", "0.6735222", "0.67303574", "0.6717096", "0.67132723", "0.6710709", "0.67000043", "0.6693185", "0.66856444", "0.6683645", "0.66778094", "0.66778094", "0.6677378", "0.6675087", "0.66726935", "0.66717494", "0.6669779", "0.6669274" ]
0.74562234
0
Use callbacks to share common setup or constraints between actions.
def set_rental_car @rental_car = RentalCar.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 rental_car_params params.require(:rental_car).permit(:brand, :model, :additional_information) 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
Method returning the templates used by the renderer. Should be overwritten by the subclasses.
def all_templates @templates = super.merge(TEMPLATES) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def rendered_templates; end", "def templates\n # Some cheap memoiziation\n @templates ||= begin\n files = Dir.glob(template_glob)\n # Check to see what mode we are in, that'll define how we parse the file names\n if Gluttonberg.localized? or Gluttonberg.translated?\n # Figure out what regex we need\n matcher, mode = if Gluttonberg.localized?\n [/\\/#{filename}.(\\w+).([a-z-]+).(\\w+).(erb|mab|haml)/, :localized]\n elsif Gluttonberg.translated?\n [/\\/#{filename}.([a-z-]+).(\\w+).(erb|mab|haml)/, :translated]\n end\n files.inject({}) do |memo, file|\n match = file.match(matcher)\n extract_template_details(memo, mode, match) if match\n memo\n end\n else\n # For the non-localized/dialect mode, just collect the various formats\n files.inject([]) do |memo, file|\n match = file.match(/#{filename}.(\\w+).(erb|mab|haml)/)\n memo << match[1] if match\n memo\n end\n end\n end\n end", "def templates\n @templates ||= (\n list = []\n list.concat templates_from_project\n list.concat templates_from_remotes\n list.concat templates_from_plugins\n list.sort_by{ |t| t.name }\n )\n end", "def templates; end", "def templates\n wayfinder.decorated_templates\n end", "def templates\n response = get 'templates'\n response.map{|item| Hashie::Mash.new(item)}\n end", "def result_templates\n return @result_templates\n end", "def templates\n @template_paths ||= Tilt.mappings.map do |ext, engines|\n Dir.glob(@root+\"/**/*.#{ext}\") if engines.map(&:default_mime_type).include?('text/html')\n end.flatten.compact\n end", "def templates\n @templates ||= TemplateFinder.new(path, types)\n end", "def templates\n GitWiki.template_cache ||= Dir[\"#{ settings.views[0] }/*.liquid\"].map do |f|\n name = File.basename(f, '.liquid')\n {\n \"name\" => name,\n \"examples\" => Page.get_template(name).examples\n }\n end\n end", "def template\n @_renderer.current_template\n end", "def templates\n @instruments_templates ||= lambda do\n args = ['xctrace', 'list', 'templates']\n\n hash = xcrun.run_command_in_context(args, log_cmd: true)\n hash[:out].chomp.split(\"\\n\").map do |elm|\n stripped = elm.strip.tr('\"', '')\n if stripped == '' || stripped == 'Known Templates:'\n nil\n else\n stripped\n end\n end.compact\n end.call\n end", "def templates\n state(metrics: \"metadata\").dig(\"metadata\", \"templates\")\n end", "def templates\n return self.class.get('/templates').parsed_response.map do |template|\n Template.new(template['template_id'], template['name'])\n end\n end", "def template_types_for_view\n\t\ttt = {}\n\t\tif File.exists?(theme_template_path + '/skin.liquid')\n\t\t\ttt[:rooms] = 'Rooms-Templates'\n\t\tend\n\t\tif File.exists?(theme_template_path + '/tickets')\n\t\t\ttt[:events] = 'Events-Templates'\n\t\tend\n\t\tif File.exists?(theme_template_path + '/vouchers')\n tt[:vouchers] = 'Voucher-Templates'\n end\n\t\treturn tt\n\tend", "def _mg_templates\n @_mg_templates ||= ModelGrinder.templates\n end", "def component_templates\n @component_templates ||= extract_component_templates\n end", "def templates\n @templates ||= EbanqApi::Templates.new(self)\n end", "def generate\n\t\t\t\tbegin\n\t\t\t\t\ttemplate = @template\n\t\t\t\t\ttemplate_manager = @template_manager\n\n\t\t\t\t\tt = template_manager.find_template_by_name(template)\n\t\t\t\t\tt = t.class.new\n\n\t\t\t\t\tif t.template_info[:renderer] == \"CSV\"\n\t\t\t\t\t\tRisu::Renderers::CSVRenderer.generate(@output_file) do |output|\n\t\t\t\t\t\t\tt = template_manager.find_template_by_name(template)\n\t\t\t\t\t\t\tt = t.class.new\n\t\t\t\t\t\t\tt.output = output\n\t\t\t\t\t\t\tt.render(output) unless t == nil\n\t\t\t\t\t\tend\n\t\t\t\t\telsif t.template_info[:renderer] == \"PDF\"\n\t\t\t\t\t\tPrawn::Document.generate(@output_file, :margin => [75, 50, 75, 50]) do |output|\n\t\t\t\t\t\t\toutput.font_size 10\n\t\t\t\t\t\t\tt = template_manager.find_template_by_name(template)\n\t\t\t\t\t\t\tt = t.class.new\n\t\t\t\t\t\t\tt.output = output\n\t\t\t\t\t\t\tt.render(output) unless t == nil\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue => e\n\t\t\t\t\traise unless Rails.env.production?\n\t\t\t\t\tputs \"Templater Error: #{e.message} \\n #{e.backtrace.join(\"\\n\\t\")}\\n\"\n\t\t\t\tend\n\t\t\tend", "def template\n @template\n end", "def renderer\n Cms::RenderTemplate.new\n end", "def template\n @__template\n end", "def templates\n @conn.templates\n end", "def _template\n @template\n end", "def get_available_template_types\n\t\tskin = @params['from']\n\t\tskin_dir = File.join(THEMES, skin)\n\t\toptions = []\n\t\tif File.exists? File.join(skin_dir, \"templates\", \"skin.liquid\")\n\t\t\toptions << create_checkbox(\"functions\", \"rooms\", \"Rooms\", \"validate-one-required\")\n\t\tend\n\t\tif File.exists? File.join(skin_dir, \"templates\", \"tickets\")\n\t\t\toptions << create_checkbox(\"functions\", \"events\", \"Events\", \"validate-one-required\")\n\t\tend\n\t\tif File.exists? File.join(skin_dir, \"templates\", \"vouchers\")\n\t\t options << create_checkbox(\"functions\", \"vouchers\", \"Vouchers\", \"validate-one-required\")\n\t\tend\n\t\toptions = options.join(\"<br />\")\n\t\trender :text => options\n\tend", "def templates_for(file); end", "def available_page_templates\n dirname = Rails.root.join('app/' + Option.theme_full_dir)\n templates = []\n Dir.foreach(dirname) do |filename|\n if filename.length > 19 + 1 && filename.slice(0, 9) == 'template_' && filename.slice(-10, 10) == '.html.haml'\n templates << filename.slice(9, filename.length - 19)\n end\n end\n templates\n end", "def render_templates(output, dom_namer)\n # Does nothing. Only multipliers really render templates\n end", "def template_map\n return TEMPLATE_MAP\n end", "def template\n return @template\n end", "def templates\n Dir.glob(File.join(gem_path, 'templates', '*'))\n end", "def template\n return @template if @template\n\n # If they sent any instance-level options use that instead of the class's.\n if @template_path || @template_extension || @template_name || @template_file\n @template = templateify(File.read(template_file))\n else\n @template = self.class.template\n end\n end", "def template\n @template.content\n end", "def create_templates\n files = %w(_filter _form index admin edit show new)\n files.each do |file|\n template \"assets/templates/#{file}.html.haml.erb\", \"app/assets/templates/#{class_name.tableize}/#{file}.html.haml\"\n end\n end", "def determine_template(options); end", "def templates\n file_list '{templates,puppet}/**/*.{erb,epp}'\n end", "def get_templates(type)\n Dir[get_template_location << type << '/*']\n end", "def template\n templater.template\n end", "def template_content\n if respond_to? :contents and contents\n contents.elements.map do |item|\n if item.content.respond_to? :template\n item.content.template.renderable.template.render\n else\n ::Alongslide::render item.text_value, plain: true\n end\n end\n end\n end", "def templates(&block)\n instance_eval(&block)\n end", "def get_item_template\n get_type_template(@source.types)\n end", "def get_driver_templates\n @client.raw('get', '/content/email-templates/driver/templates')\n end", "def template\n @template ||= self.class.template\n end", "def get_template\n @template\n end", "def template\n if object.respond_to?(:template)\n object.template\n else\n @template\n end\n end", "def list\n @client.call(method: :get, path: 'templates')\n end", "def render\n Mustache.view_namespace = self.class\n\n result = {}\n self.class.views.each do |view_name|\n template = File.join 'templates', \"#{view_name}.mustache\"\n template_path = self.class.find template\n\n view = File.join 'views', \"#{view_name}.rb\"\n view_path = self.class.find view\n\n Mustache.template_path = File.dirname template_path\n Mustache.view_path = File.dirname view_path\n mustache = Mustache.view_class(view_name).new(self)\n mustache.template_name = view_name\n result[view_name] = mustache.render\n end\n result\n end", "def template_files\r\n \t[].concat(@templates)\r\n end", "def plugin_templates(type: :export)\n type = valid_type(type)\n templates = []\n plugs = plugins[type].clone\n plugs.delete_if { |_t, o| o[:templates].nil? }.each do |_, options|\n options[:templates].each do |t|\n out = t[:name]\n out += \" (#{t[:format]})\" if t.key?(:format)\n templates << out\n end\n end\n\n templates.sort.uniq\n end", "def find_template\n self.class.ancestor_renderables.each do |klass|\n return \"kaminari/#{klass.template_filename}\" if @renderer.partial_exists? klass.template_filename\n end\n \"kaminari/#{self.class.template_filename}\"\n end", "def supported_templates\n [\n double_opt_in_template,\n admin_forgot_password_template,\n user_forgot_password_template,\n kyc_issue_template,\n admin_invite_template,\n test_webhook_result_template,\n\n # kyc_data_mismatch_template,\n # kyc_document_id_issue_template,\n # kyc_selfie_image_issue_template,\n # kyc_residency_image_issue_template,\n\n kyc_approved_template,\n kyc_denied_template,\n purchase_confirmation,\n altdrop_sent,\n contact_us_template,\n low_whitelister_balance_template,\n manual_review_needed_template,\n billing_plan_notification_template,\n update_ethereum_request_outcome_template,\n open_case_request_outcome_template,\n contact_us_ost_partner_autoresponder_template,\n contact_us_ost_kyc_autoresponder_template,\n kyc_report_download_template,\n low_balance_whitelisting_suspended_template,\n contract_address_update_template\n ]\n end", "def erb_templates(*paths)\n @erb_templates ||= []\n @erb_templates.push(*paths) if paths.size > 0\n @erb_templates\n end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def template; end", "def templates(value = nil)\n if value\n @templates = value\n else\n root.join @templates.to_s\n end\n end", "def default_templates\n assets, logs, steps = @options.values_at(:assets, :logs, :steps)\n\n {\n asset: \":protocol://#{assets}/:prefix/:timestamp\",\n log: \":protocol://#{logs}/:prefix/:timestamp\",\n step: \":protocol://#{steps}/:prefix\",\n shared_asset: \":protocol://#{assets}/:prefix/shared/:datestamp\",\n bucket_relative_asset: ':prefix/:timestamp',\n }\n end", "def _render_template(options); end", "def _render_template(options); end", "def templates_from_plugins\n list = []\n dirs = ::Find.data_path(File.join('quarry', '*/'))\n dirs = dirs.uniq.map{ |d| d.chomp('/') }\n dirs.each do |dir|\n i = dir.rindex('quarry/')\n name = dir[i+7..-1]\n list << Template.new(name, dir, :type=>:plugin)\n end\n list\n end", "def determine_template(options)\n keys = options.has_key?(:locals) ? options[:locals].keys : []\n\n if options.key?(:body)\n Template::Text.new(options[:body])\n elsif options.key?(:plain)\n Template::Text.new(options[:plain])\n elsif options.key?(:html)\n Template::HTML.new(options[:html], formats.first)\n elsif options.key?(:file)\n if File.exist?(options[:file])\n Template::RawFile.new(options[:file])\n else\n if Pathname.new(options[:file]).absolute?\n raise ArgumentError, \"File #{options[:file]} does not exist\"\n else\n raise ArgumentError, \"`render file:` should be given the absolute path to a file. '#{options[:file]}' was given instead\"\n end\n end\n elsif options.key?(:inline)\n handler = Template.handler_for_extension(options[:type] || \"erb\")\n format = if handler.respond_to?(:default_format)\n handler.default_format\n else\n @lookup_context.formats.first\n end\n Template::Inline.new(options[:inline], \"inline template\", handler, locals: keys, format: format)\n elsif options.key?(:renderable)\n Template::Renderable.new(options[:renderable])\n elsif options.key?(:template)\n if options[:template].respond_to?(:render)\n options[:template]\n else\n @lookup_context.find_template(options[:template], options[:prefixes], false, keys, @details)\n end\n else\n raise ArgumentError, \"You invoked render but did not give any of :body, :file, :html, :inline, :partial, :plain, :renderable, or :template option.\"\n end\n end", "def render_template(options={})\n # puts \"ActionController#render_template(start), options = #{options}\"\n #`var d = new Date(); console.log(\"time= \" + d.getSeconds() + \":\" + d.getMilliseconds());`\n #Timer.time_stamp(\"render_template (begin)\")\n content_fors = options.delete(:content_for) || {}\n partial = options[:partial]\n\n # renderer = ActionView::Renderer.new(self, path: render_path)\n # puts \"renderer = #{@renderer.inspect}\"\n if partial\n # puts \"ActionController#render_template (partial)\"\n top_view_html = @renderer.render(options)\n else\n # puts \"ActionController#render_template (file)\"\n top_view_html = @renderer.render(file: render_path, options: {locals: @__locals})\n end\n\n content_for_htmls = {}\n content_fors.each do |key, selector|\n content_for_html = @renderer.content_fors[key]\n #puts \"content for #{key} = #{content_for_html}\"\n content_for_htmls[selector] = content_for_html\n end\n #`var d = new Date(); console.log(\"time= \" + d.getSeconds() + \":\" + d.getMilliseconds());`\n [top_view_html, content_for_htmls]\n end", "def template(name,locals={})\n Tilt.new(Dir.glob(\"#{settings.service.templates_dir}/#{name}.*\").first)\n .render(self,locals)\n end", "def get_template(template); end", "def get_templates(opts={})\n path = '/template/list'\n opts[:query] = create_search_string(opts[:query]) if opts[:query]\n query = create_query_string(opts, [:page, :page_size, :query])\n path += query\n HelloSign::Resource::ResourceArray.new get(path, opts), 'templates', HelloSign::Resource::Template\n end", "def get_policy_templates\n @command = :get_policy_templates\n # get the policy templates from the RESTful API (as an array of objects)\n uri = URI.parse @uri_string + '/templates'\n result = hnl_http_get(uri)\n unless result.blank?\n # convert it to a sorted array of objects (from an array of hashes)\n sort_fieldname = 'template'\n result = hash_array_to_obj_array(expand_response_with_uris(result), sort_fieldname)\n end\n # and print the result\n print_object_array(result, \"Policy Templates:\", :style => :table)\n end", "def page_template\n self_template || inherited_template || DEFAULT_TEMPLATE\n end", "def text_templates\n Easybill::Api::TextTemplates\n end", "def templates_configuration\n yield @templates_configuration\n end", "def template\n @template ||= Template.new name: script_name, out_file: root_ruby_file, type: type\n end", "def template_folder_for clazz\n # Search the potential matches in reverse order\n # because subclasses have registered AFTER their\n # superclasses and superclasses match the ===\n # check...\n generator_paths.reverse.each do |options|\n if options[:class] === clazz\n return options[:templates]\n end\n end\n nil\n end", "def template\n @template || nil\n end", "def files\n templates.map(&:filename)\n end", "def initialize\n @templates = Array.new\n end", "def templates_from_project\n list = []\n dirs = Dir.glob(File.join(output, LOCAL_DIRECTORY, '*/'))\n dirs = dirs.uniq.map{ |d| d.chomp('/') }\n dirs.each do |dir|\n name = dir.sub(File.join(output, LOCAL_DIRECTORY)+'/', '')\n list << Template.new(name, dir, :type=>:project)\n end\n list\n end", "def result_templates=(value)\n @result_templates = value\n end", "def templates\n Dir.glob(::Webby.path('examples') / '*').sort\n end", "def get_resource_templates\n @model.get.mixins.select { |mixin| mixin.related.select { |rel| rel.end_with? 'resource_tpl' }.any? }\n end", "def get_os_templates\n @model.get.mixins.select { |mixin| mixin.related.select { |rel| rel.end_with? 'os_tpl' }.any? }\n end", "def template_for(file); end", "def to_html\t\t\t\t\n\t\thtml = if visible?\n\t\t\t#\t\t\tif Utils::TemplateHelper.template_exist? self.class\n\t\t\thtml = Utils::TemplateHelper.render_template self.class, :binding => binding, :preprocessing => true\n\t\t\t#\t\t\telse\n\t\t\t#\t\t\t\thtml = Utils::TemplateHelper.render_template(WComponent, :binding => binding, :resource => \"default.#{TEMPLATE_EXTENSION}\")\n\t\t\t#\t\t\tend\n\t\telse\n\t\t\t\"\"\n\t\tend\n\t\treturn Utils::TemplateHelper.render_template(WComponent, :binding => binding,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t:resource => \"wrapper.#{TEMPLATE_EXTENSION}\")\n\tend", "def template\n return @template if @template\n\n template = Template.new\n each_event do |event_name, event_model|\n event = TemplateEventGenerator.new(\n event_model.controlable?, event_model, plan: template\n )\n template.add(event)\n template.events_by_name[event_name] = event\n end\n\n instantiate_event_relations(template)\n @template = template\n end", "def editor_templates (type, uuid)\n res = http_get(:uri=>\"/editor/#{type}/templates/#{uuid}\", :fields=>x_cookie)\n end", "def templates_path\n @templates_path\n end", "def render(*args)\n tpls_file = (@__caller_info__ || __caller_info__).first.first\n self._template_parser.load(tpls_file).parse.each do |template_name, raw_content|\n # no controller name if absolute view path\n ctrl_name = template_name.match(/^\\//) ? nil : self.controller_name\n path = Merb.dir_for(:view) / self._template_location(template_name.gsub(/^\\//,''), nil, ctrl_name)\n file = VirtualFile.new(raw_content, path)\n TEMPLATES[path.to_s] = file\n end\n super\n end", "def initialize(template_text,options={})\n @renderer_extension_modules=[]\n\n @name=options[:template_name]\n @templates_root_dir= options[:templates_directory]# || \"#{::Rails.root.to_s}/app/views\"\n\n @output_buffer=\"\"\n #unique tag for escaping post and pre processing tags\n @ltag=\"!@@@##$$1212\"\n @rtag=\"!723465hjf3!@#\"\n\n @default_language=options[:default_language] || \"en\"\n\n\n @escape_tags= options[:tags_to_escape] || []\n @runtime_tags= options[:runtime_tags] || []\n\n\n #escape blocks that will be run at view time\n @template_text=template_text.clone\n @escape_tags.each do |etag|\n escape_tag_content( etag,@template_text)\n\n \n end\n\n# raise \"need templates directory\" unless options[:templates_directory]\n\n #escape all normal dynamic blocks for preprocessing\n @template_text=@template_text.gsub(\"<%\",@ltag).gsub(\"%>\",@rtag).gsub(\"<$\",\"<%\").gsub(\"$>\",\"%>\")\n \n #turn the setup block into a proc <## ##> into executable blocks\n @template_text=@template_text.gsub(\"<##\",\"<% set_setup_proc{ \").gsub(\"##>\",\"} %>\")\n\n #turn the key block into a proc <## ##> into executable blocks\n @template_text=@template_text.gsub(\"<!!KEY\",\"<% set_key_proc{ \").gsub(\"!!KEY>\",\"} %>\")\n\n\n @raw_template=compile(@template_text)\n #this hold variations of the template after it has been localized\n #into different languages, but before rendering\n @localized_templates={}\n @setup_proc=nil\n @key_proc=nil\n @render_base=options[:render_base]\n @template_name=options[:template_name]\n #this tag will be used to create non cachable dynamic blocks\n\n\n if options.has_key?(:helpers) && options[:helpers]!=nil\n options[:helpers].each do |helper|\n include helper\n end\n end\n \n end", "def template\n @template.join(\"\\n\")\n end", "def template\n @template.join(\"\\n\")\n end", "def render\n case File.extname(@template_file)\n when '.erb'\n render_erb\n else\n render_plain\n end\n end", "def list_templates(type)\n res = http_get(:uri=>\"/editor/#{type}/templates\", :fields=>x_cookie)\n end", "def load_templates\n templates = {}\n file = __FILE__\n\n begin\n io = ::IO.respond_to?(:binread) ? ::IO.binread(file) : ::IO.read(file)\n app, data = io.gsub(\"\\r\\n\", \"\\n\").split(/^__END__$/, 2)\n rescue Errno::ENOENT\n app, data = nil\n end\n\n if data\n lines = app.count(\"\\n\") + 1\n template = nil\n data.each_line do |line|\n lines += 1\n if line =~ /^@@\\s*(.*\\S)\\s*$/\n template = ''\n templates[$1.to_sym] = template\n elsif template\n template << line\n end\n end\n end\n\n templates\nend", "def pack_template\n selfclass.pack_template\n end" ]
[ "0.7450521", "0.72660863", "0.7203362", "0.713576", "0.7061059", "0.69929695", "0.6992193", "0.6953453", "0.68709505", "0.6837034", "0.68202364", "0.6781237", "0.6751528", "0.67395806", "0.6739252", "0.6702205", "0.6696489", "0.6629476", "0.65783674", "0.6538574", "0.65310615", "0.6518916", "0.65166336", "0.6502469", "0.6500416", "0.645084", "0.64346045", "0.6432748", "0.64301294", "0.64101994", "0.63864964", "0.63218963", "0.6308459", "0.6293743", "0.6215571", "0.62152374", "0.61938417", "0.6184589", "0.61830187", "0.6180732", "0.61785513", "0.6141094", "0.6139173", "0.61264163", "0.6116374", "0.6095298", "0.60891414", "0.60596454", "0.6055031", "0.6053113", "0.6047841", "0.6025837", "0.6024051", "0.6024051", "0.6024051", "0.6024051", "0.6024051", "0.6024051", "0.6024051", "0.601733", "0.60073334", "0.5977624", "0.5977624", "0.596585", "0.595287", "0.5943335", "0.5924637", "0.592413", "0.59230417", "0.59213746", "0.59137577", "0.59088075", "0.59044135", "0.5894765", "0.5894254", "0.5893227", "0.58927715", "0.58603615", "0.5860017", "0.58548737", "0.5850745", "0.5848973", "0.5842263", "0.5839699", "0.5819586", "0.58175707", "0.5815754", "0.58035254", "0.5797899", "0.57960075", "0.5785383", "0.5785383", "0.57839966", "0.57765317", "0.57750404", "0.5774939" ]
0.6062949
51
Indicates whether the renderer handles animations or not. false indicates that slides should not be repeated.
def handles_animation? false end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def handles_animation?\n true\n end", "def animated?\n @animated\n end", "def animation?\n return @animation != nil\n end", "def inPartyAnimation?\r\n return @animations.length>0\r\n end", "def animation?\n for sprite in @enemy_sprites + @actor_sprites\n return true if sprite.animation?\n end\n return false\n end", "def parallel_anim?\n !note[TSBS::ParallelTAG].nil?\n end", "def parallel_anim?\n !note[TSBS::ParallelTAG].nil?\n end", "def ignore_anim_guard?\n !note[TSBS::IgnoreAnimGuard].nil?\n end", "def ignore_anim_guard?\n !note[TSBS::IgnoreAnimGuard].nil?\n end", "def elide?\n false\n end", "def rendering_enabled?\n\t\treturn @rendering_enabled ? true : false\n\tend", "def animation_end?\n return false if @watch_sprite_animation.nil?\n return @watch_sprite_animation.animation_end?\n end", "def elide? # :nodoc:\n true\n end", "def animating_card?\n Animation.animations.any? do |anim|\n @card == anim.target && anim.running?\n end\n end", "def renderable?\n !!handler\n end", "def camera_reposition_case?\n $imported[:TSBS_Camera] && @animation.position != 3\n end", "def camera_reposition_case?\n $imported[:TSBS_Camera] && @animation.position != 3\n end", "def elide? # :nodoc:\n true\n end", "def render?\n true\n end", "def animation_done?\n @bands.all?(&:done?) && @credit_display.done? && @payout_display.done?\n end", "def done?\n private_done? && @parallel_animations.all?(&:done?) && (@sub_animation ? @sub_animation.done? : true) &&\n @played_until_end\n end", "def tick\n if @animation_timer > 0\n @animation_timer -= 1 \n return true if @animation_timer == 0\n end\n\n return false\n end", "def multi_arged?\n false\n end", "def is_non_repeating_animation?\n loop_count.in?(0..10)\n end", "def zoom?\n false\n end", "def anim_behind?\n !note[TSBS::AnimBehind].nil?\n end", "def anim_behind?\n !note[TSBS::AnimBehind].nil?\n end", "def render?\n true\n end", "def anim_behind?\n states.each do |state|\n return state.anim_behind? if state.state_anim > 0\n end\n return false\n end", "def needs_redraw?\n\t\t@swimming || @party_horn.needs_redraw?\n\tend", "def apply_post_processing?\n if self.has_default_image?\n return false\n else\n return true\n end\n end", "def rendered?\n !!@render_opts\n end", "def needs_redraw?\n @needs_redraw\n end", "def apply_post_processing?\n if self.is_video?\n return true\n elsif self.is_image?\n if self.is_seed\n return true\n end \n else \n return false \n end\n end", "def needs_redraw?\n\t\tif @has_moved || @prawn.needs_redraw?\n\t\t\treturn true\n\t\tend\n\t\tfalse\n\tend", "def capturing?\n @capture_on ? true : false\n end", "def animated?\n frames = 0\n\n # \"GIF\" + version (3) + width (2) + height (2)\n @stream.skip(10)\n\n # fields (1) + bg color (1) + pixel ratio (1)\n fields = @stream.read(3).unpack(\"CCC\")[0]\n if fields & 0x80 != 0 # Global Color Table\n # 2 * (depth + 1) colors, each occupying 3 bytes (RGB)\n @stream.skip(3 * 2 ** ((fields & 0x7) + 1))\n end\n\n loop do\n block_type = @stream.read(1).unpack(\"C\")[0]\n\n if block_type == 0x21 # Graphic Control Extension\n # extension type (1) + size (1)\n size = @stream.read(2).unpack(\"CC\")[1]\n @stream.skip(size)\n skip_sub_blocks\n elsif block_type == 0x2C # Image Descriptor\n frames += 1\n return true if frames > 1\n\n # left position (2) + top position (2) + width (2) + height (2) + fields (1)\n fields = @stream.read(9).unpack(\"SSSSC\")[4]\n if fields & 0x80 != 0 # Local Color Table\n # 2 * (depth + 1) colors, each occupying 3 bytes (RGB)\n @stream.skip(3 * 2 ** ((fields & 0x7) + 1))\n end\n\n @stream.skip(1) # LZW min code size (1)\n skip_sub_blocks\n else\n break # unrecognized block\n end\n end\n\n false\n end", "def effect?\n @_whiten_duration > 0 or\n @_appear_duration > 0 or\n @_escape_duration > 0 or\n @_collapse_duration > 0 or\n @_damage_duration > 0 or\n @_animation_duration > 0\n end", "def visualizer_set?\n !@visualizer.nil?\n end", "def update_fade_in\n return false\n end", "def repealed?\n !!repealed_on\n end", "def event_running?\n get_scene.event_running?\n end", "def is_scene_changing?\n SceneManager.scene != self\n end", "def is_modified?\n booleans = [ :presenter_share_only, :auto_start_audio, :auto_start_video ]\n others = [ :default_layout, :background ]\n booleans.any? { |method| !self.send(method).nil? } ||\n others.any? { |method| self.send(method).present? }\n end", "def decorated?\n false\n end", "def needs_redraw?\n\t\tif @has_changed\n\t\t\t@has_changed = false\n\t\t\treturn true\n\t\tend\n\t\tfalse\n\tend", "def is_loop\n\n false\n end", "def simulation_mode?\n controller.simulation_mode\n end", "def zoom_enabled?\n self.isZoomEnabled\n end", "def repeatable?\n false\n end", "def render_charts?\n @render_charts\n end", "def preview?\n false\n end", "def update_sseffect?\r\n # If effect is showing\r\n return @spriteset.effect?\r\n end", "def recording_events?\n false\n end", "def capturing?\n @capturing\n end", "def interchange?\n @presenter.interchange?\n end", "def preview?\n !!@preview\n end", "def splayed?\n splayed\n end", "def rotation_enabled?\n MSPhysics::Newton::CurvySlider.rotation_enabled?(@address)\n end", "def rotation_enabled?\n MSPhysics::Newton::CurvySlider.rotation_enabled?(@address)\n end", "def alignment_enabled?\n MSPhysics::Newton::CurvySlider.alignment_enabled?(@address)\n end", "def alignment_enabled?\n MSPhysics::Newton::CurvySlider.alignment_enabled?(@address)\n end", "def repeats?\n false\n end", "def bubbles?\n false\n end", "def needs_redraw?\n true \n end", "def collapsing?\n @effect_type == :collapse\n end", "def is_replaying?\n decision_context.workflow_clock.replaying\n end", "def is_replaying?\n decision_context.workflow_clock.replaying\n end", "def drawing?\n @speed.nil? and not @paused\n end", "def hault_processing\n if self.processing?\n true\n else\n false\n end\n end", "def is_loop_enabled\n return @is_loop_enabled\n end", "def simulation?\n self[:simulation].present?\n end", "def image_work?\n true\n end", "def imag?\n false\n end", "def showing?\n return true if @state == STATE_DISPLAYED\n ext = extent\n case(@anchor)\n when ANCHOR_TOP\n return @slide_offset >= 0\n when ANCHOR_LEFT\n return @slide_offset >= 0\n when ANCHOR_BOTTOM\n return @slide_offset <= -ext\n when ANCHOR_RIGHT\n return @slide_offset <= -ext\n end\n end", "def use_sprite?\n return true\n end", "def handled?\n handled\n end", "def uses_modal?\n params[:uses_modal].to_s.match(/^(true|1)/i) ? true : false\n end", "def regular?\n @capture_on ? false : true\n end", "def wrap?\n true\n end", "def wrap?\n true\n end", "def is_modified?\n !self.default_layout.nil? || !self.presenter_share_only.nil? || !self.auto_start_audio.nil? ||\n !self.auto_start_video.nil?\n end", "def enabled?\n false\n end", "def update_transition?\r\n # Abort loop if transition processing\r\n if $game_temp.transition_processing\r\n return true\r\n end\r\n return false\r\n end", "def hide?\n @hide\n end", "def is_presentation?(); @type == GRT_PRESENTATION; end", "def on_client?\n @render_on != :server_only\n end", "def raster_work?\n false\n end", "def flex?\n false\n end", "def needs_rotate?\n false\n end", "def prerender?\n !! prerender\n end", "def framed?\n dim_type.outer_target == \"frame\"\n end", "def loop?\n get_animloop_array[0][0] && @battle_phase != :covered\n end", "def enabled?\n false\n end", "def processed?\n return self.processed\n end", "def rendered?\n end", "def sections?\n false\n end", "def hidden?\n return true if @state == STATE_HIDDEN\n ext = extent\n case(@anchor)\n when ANCHOR_TOP\n return @slide_offset <= -ext\n when ANCHOR_LEFT\n return @slide_offset <= -ext\n when ANCHOR_BOTTOM\n return @slide_offset >= 0\n when ANCHOR_RIGHT\n return @slide_offset >= 0\n end\n end", "def needs_positioning?\n false\n end" ]
[ "0.8096767", "0.76583505", "0.74129844", "0.6555348", "0.62362456", "0.6214282", "0.6214282", "0.61646605", "0.61646605", "0.60942906", "0.6080439", "0.5908779", "0.5886608", "0.5852896", "0.5851341", "0.58097315", "0.58097315", "0.57868123", "0.578375", "0.5780767", "0.57322115", "0.57308763", "0.5696973", "0.56893", "0.56829506", "0.5666875", "0.5666875", "0.56269115", "0.5618942", "0.5609152", "0.55638856", "0.5548211", "0.55450886", "0.552877", "0.5526277", "0.55131745", "0.5500651", "0.5498096", "0.5477855", "0.5473641", "0.5459343", "0.54364973", "0.54248655", "0.542156", "0.5399629", "0.5384003", "0.53835493", "0.53673184", "0.53484833", "0.5342954", "0.5339301", "0.5330433", "0.5330101", "0.53283066", "0.53263146", "0.5321994", "0.5321384", "0.5319699", "0.53131425", "0.53131425", "0.53015006", "0.53015006", "0.52948445", "0.52925545", "0.5288186", "0.526649", "0.5259488", "0.5259488", "0.5257196", "0.5256418", "0.5256008", "0.52548987", "0.5230609", "0.5226263", "0.5204485", "0.51918393", "0.5191055", "0.5189443", "0.5187473", "0.51841134", "0.51841134", "0.51835096", "0.5177363", "0.5176552", "0.5175943", "0.51751506", "0.51708895", "0.5159835", "0.51548564", "0.51417285", "0.5139647", "0.5132613", "0.51267594", "0.51101816", "0.511002", "0.51082844", "0.50938326", "0.509072", "0.5080985" ]
0.8116292
1
Render an UML inline diagram using an external tool
def uml(picture_name, contents, width_slide, width_plain) new_width = calculate_width(width_plain) formats = %w(pdf eps) img_path = super(picture_name, contents, width_slide, width_plain, 'pdf') image(img_path, formats, '', '', new_width, new_width) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def render(context)\n api = URI.parse('https://www.planttext.com/api/scripting')\n http = Net::HTTP.new(api.host, api.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(api.request_uri)\n request['Content-Type'] = 'application/x-www-form-urlencoded'\n uml = \"\\n@startuml\\n#{super}\\n@enduml\\n\"\n request.set_form_data(type: 'svg', plantuml: uml)\n response = http.request(request)\n return \"<p>Can't render PlantUML diagram.</p>\" unless response.code == '200'\n url = response.body.gsub(/^\"|\"$/, '')\n puts \"PlantUML SVG generated: #{url}\"\n \"<p><object data='#{url}' type='image/svg+xml' #{@markup}></object></p>\"\n end", "def UseCaseDiagram( options={}, &block )\n # options :name => \"Name of the Diagram\"\n $name = \"#{$name}\\n#{options[:name]}\" if options.has_key? :name\n # first create internal model,\n # i.e. the <code> in the DSL is executed\n # UseCaseDiagram () do ...<code>... end is executed\n # thereby building the internal use case diagram representation\n block.call\n # display the model\n displayOpen options # display preamble, also provide specific options for the display\n displayUseCases $usecases # display all use cases\n displayLinks $usecases # display links between the use cases\n displayActors $actors # display actors and their links to use cases\n displayClose # display epilogue\nend", "def draw_diagram\n xml = %(<uml:DiagramElement preferredShapeType=\"Class\" subject=\"#{id}\" xmi:id=\"#{id}de\">\n </uml:DiagramElement>)\n\n return xml if @definition.superklass.empty? && @definition.inherited_modules.empty?\n return xml unless ::Xumlidot::Options.inheritance\n\n xml + draw_diagram_generalisation\n end", "def emit_body(anIO)\n anIO.puts <<-DOT\n subgraph island {\n node [shape = box, style=filled, color=lightgray];\nDOT\n feature_files.each_with_index do |ff, i|\n draw_node(anIO, ff, i) if ff.feature.anonymous?\n end\n\n anIO.puts <<-DOT\n label = \"Isolated features\";\n }\n\n subgraph dependencies {\n node [shape = box, fillcolor = none];\nDOT\n feature_files.each_with_index do |ff, i|\n draw_node(anIO, ff, i) unless ff.feature.anonymous?\n end\n anIO.puts <<-DOT\n label = \"Dependencies\";\n }\n\n // The edges represent dependencies\nDOT\n dependencies.each { |a_dep| draw_edge(anIO, a_dep) }\n end", "def uml(picture_name, contents, width_slide, width_plain)\n img_path = super(picture_name, contents, width_slide, width_plain, 'svg')\n @io << @templates[:uml].result(binding)\n end", "def inkscape\n @inkscape ||= executable(dependency_filename(:inkscape))\n end", "def visualize\n require 'open3'\n Open3.popen3('graph-easy') do |i,o,_|\n i.write to_graph_easy\n i.close\n puts o.read\n end\n end", "def visualize\n\n if @output\n STDERR.puts \"Refuce to output twice.\"\n exit( false )\n end\n\n @output = true\n\n close\n\n Common.openOutput\n\n outo %Q{<?xml version=\"1.0\" encoding=\"UTF-8\"?>}\n\n # No scale:\n if Opt['zoom'].given\n scaler = 1 / ( Opt['zoom'].value.to_i / 100.0 )\n else\n scaler = 1\n end\n\n if @scale\n scaler = scaler * ( 1 / ( @scale / 100.0 ) )\n end\n\n outo %Q{<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"#{size.x!/scaler}#{unit}\" height=\"#{size.y!/scaler}#{unit}\" viewBox=\"0 0 #{size.x!} #{size.y!}\">}\n\n # Output marker \"templates\".\n outo %Q{\\\n <defs>\n\n <marker id=\"markerCircle\" markerWidth=\"8\" markerHeight=\"8\" refX=\"5\" refY=\"5\">\n <circle cx=\"5\" cy=\"5\" r=\"3\" style=\"stroke: none; fill:#{linecolor_o};\"/>\n </marker>\n\n <marker id=\"endArrow\" markerWidth=\"13\" markerHeight=\"13\" refX=\"#{10-linewidth}\" refY=\"4\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 0 L 0 8 L 10 4 L 0 0\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n <marker id=\"startArrow\" markerWidth=\"13\" markerHeight=\"13\" refX=\"#{linewidth}\" refY=\"4\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 4 L 10 8 L 10 0 L 0 4\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n <marker id=\"endTee\" markerWidth=\"13\" markerHeight=\"13\" refX=\"0\" refY=\"5\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 0 L 0 10 L 2 10 L 2 0 z\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n <marker id=\"startTee\" markerWidth=\"13\" markerHeight=\"13\" refX=\"0\" refY=\"4\"\n orient=\"auto\" markerUnits=\"strokeWidth\" >\n <path d=\"M 0 0 L 0 10 L 2 10 L 2 0 z\" style=\"fill:#{linecolor_o};\" />\n </marker>\n\n </defs>}\n\n\n if Opt['name'].given\n outo %Q{ <title>#{Opt['name'].value}</title>}\n else\n outo %Q{ <title>Sivigi figure</title>}\n end\n\n @items.each do |i|\n i.fixpos\n end\n\n # Output each layer in turn.\n layers = Layer.system.list\n layers.each do |layer|\n @items.each do |i|\n incind 2\n i.output( layer )\n decind 2\n end\n end\n\n outo \"</svg>\"\n\n Common.closeOutput\n end", "def dot(io)\n log \"drawing graph \"\n io << <<END\ndigraph test_definition {\ngraph [ rankdir=TB ]\nnode [shape=record,fontname=helvetica]\nedge [fontname=helvetica, arrowsize=0.5]\nEND\n # nodes,transitions = collect_nodes\n # transitions.to_a.flatten.to_set.each do |n|\n @nodes.each do |n|\n next if n.record # if we are a port, skip, record handles drawing\n if n.is_record? # if we are a record, call specialized function\n n.dot_code(io)\n else\n label_sym = (n.is_a?(JoinNode) ? :xlabel : :label)\n attrs={label_sym => '\"'+n.dot_label+'\"'}\n # if n.symbol\n # attrs[:xlabel]=n.symbol\n # end\n if n.respond_to? :dot_node_shape\n attrs[:shape]='\"'+n.dot_node_shape+'\"'\n end\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io.puts \"#{n.node_name} [#{attr_string}]\"\n end\n end\n @control_edges.each do |s,d,label|\n log \"adding control edge: [#{s},#{d},#{label}]\"\n attrs={color:\"red\",fontcolor:\"red\"}\n attrs[:label] = '\"'+label.to_s+'\"' if label\n draw_transition(s,d,io,attrs)\n end\n @data_edges.each do |s,d|\n log \"adding data edge\"\n draw_transition(s,d,io,{color: \"green\"})\n end\n io.puts \"}\"\n self\n end", "def x_visualize\n require 'open3'\n Open3.popen3('dot -T svg | display') do |i,o,_|\n i.write to_dot\n i.close\n end\n end", "def dot_code(io)\n # puts \"drawing record\"\n props\n portinfos = get_port_nodes.map do |n|\n OpenStruct.new(name: n.node_name,\n label: MFactor::dot_escape(n.dot_label)+(n.symbol ? \"(#{n.symbol})\":\"\"))\n end\n label= '\"{{'\n label << (portinfos.map do |p|\n \"<#{p.name}> #{p.label}\"\n end.join(\" | \"))\n label << '}}\"'\n attrs={:label => label}\n attr_string=attrs.map do |k,v|\n \"#{k.to_s}=#{v}\"\n end.join(\", \")\n io << node_name << ' ' << '[' << attr_string << \"]\\n\"\n end", "def how_to_render_lines args\n # Render a horizontal line at the bottom\n args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 0 }\n\n # Render a vertical line at the left\n args.nokia.lines << { x: 0, y: 0, x2: 0, y2: 47 }\n\n # Render a diagonal line starting from the bottom left and going to the top right\n args.nokia.lines << { x: 0, y: 0, x2: 83, y2: 47 }\nend", "def visualize\n fc = javaobj\n vm = jnew(\"visualizer.VisuMain\")\n vm.init(fc)\n end", "def draw_tactic_overview\n end", "def show\n @workflow = Workflow.find(params[:id])\n \n default_graph_settings = \"node [shape=box,style=filled];\\n\"\n \n @processed_graph = default_graph_settings + @workflow.graph + process_graph(@workflow)\n \n gv = IO.popen(\"/usr/local/bin/dot -q -Tpng\", \"w+\")\n gv.puts \"digraph G{\", @processed_graph, \"}\"\n gv.close_write\n @gvpng = gv.read\n\n\n gv = IO.popen(\"/usr/local/bin/dot -q -Tcmapx\", \"w+\")\n gv.puts \"digraph G{\", @processed_graph, \"}\"\n gv.close_write\n @gvmap = gv.read\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @workflow }\n end\n end", "def render(src)\n src = embed_lines(src, '/*** CONSTS ***/', gen_consts)\n src = embed_lines(src, '/*** DCLS ***/', gen_decls)\n embed_lines(src, '/*** INPUTS ***/', gen_inputs)\n end", "def render_fluo (workitems=[])\n\n workitems = Array(workitems)\n\n <<-EOS\n<canvas id=\"fluo\" width=\"50\" height=\"50\"></canvas>\n<script>\n FluoCan.renderFlow('fluo', #{@json_process_definition}, {'workitems': #{workitems.inspect}});\n FluoCan.toggleMinor('fluo');\n FluoCan.crop('fluo');\n</script>\n\n<br/>\n<br/>\n<div class=\"fluo_text\">\n #{link_to_function(\n \"hide/show minor expressions\",\n \"FluoCan.toggleMinor('fluo'); FluoCan.crop('fluo')\")}\n</div>\n EOS\n end", "def to_ly\n template_dir = File.join(File.dirname(__FILE__), '../../templates/')\n template_path = File.join(template_dir, 'chartup.ly.erb')\n template = File.read(template_path)\n renderer = ERB.new(template)\n rendered = renderer.result(binding)\n end", "def extend_and_draw(collection)\n collection.map do |member|\n case member\n when ::Xumlidot::Types::MethodSignature\n member.extend(::Xumlidot::Diagram::Xmi::MethodSignature)\n when ::Xumlidot::Types::Attribute\n member.extend(::Xumlidot::Diagram::Xmi::Attribute)\n end\n member.draw\n end.join(' ')\n end", "def draw\n <<~RUBY\n def initialize(#{initialize_parameters})\n #{initialize_body}\n end\n RUBY\n end", "def show\n graph = GraphViz.new(:G, type: :digraph)\n competency = Competency.find(params[:id])\n graphviz(graph, competency)\n @file = Tempfile.new(['foo', '.png'], \"#{Rails.root}/public/images\")\n graph.output(png: @file.path)\n end", "def render(xm=Builder::XmlMarkup.new(:indent => 2))\n xm.instruct!\n xm.kml(:xmlns => 'http://www.opengis.net/kml/2.2'){\n objects.each { |o| o.render(xm) }\n }\n end", "def render_inlined_string(template)\n render(template: template, layout: 'layouts/inlined_string')\n end", "def render(xm=Builder::XmlMarkup.new(:indent => 2))\n [:name, :visibility, :address].each do |a|\n xm.__send__(a, self.__send__(a)) unless self.__send__(a).nil?\n end\n \n xm.description { xm.cdata!(description) } unless description.nil?\n xm.open(self.open) unless open.nil?\n \n xm.phoneNumber(phone_number) unless phone_number.nil?\n xm.styleUrl(style_url) unless style_url.nil?\n \n unless address_details.nil?\n xm.AddressDetails(:xmlns => \"urn:oasis:names:tc:ciq:xsdschema:xAL:2.0\") { address_details.render(xm) } \n end\n \n xm.Snippet(snippet.text, snippet.max_lines) unless snippet.nil?\n \n xm.LookAt { look_at.render(xm) } unless look_at.nil?\n xm.TimePrimitive { time_primitive.render(xm) } unless time_primitive.nil?\n xm.StyleSelector { style_selector.render(xm) } unless style_selector.nil?\n end", "def view(name = \"\", viewpoint: :total, elements: :all, relationships: :for_elements)\n dia = __model.diagrams.find { |diagram| diagram.name == name }\n __model.remove_reference(dia) if dia\n __model.diagrams << View.new(__model, name, dia&.id, viewpoint, elements, relationships).render\n end", "def print\n puts SEPARATOR\n puts @name\n puts SEPARATOR\n puts @desc\n if(@diagram)\n puts\n puts \"Diagram:\"\n puts\n puts @diagram\n end\n end", "def as_json\n {\n type: :diagram,\n data:\n {\n caption: caption,\n code: code,\n width: width,\n height: height\n }\n }\n end", "def render_inlined_string(template)\n render(template: template, layout: \"layouts/inlined_string\")\n end", "def show\n @qrcode = RQRCode::QRCode.new(url_for(@service.lineup))\n @svg = @qrcode.as_svg(\n color: \"000\",\n shape_rendering: \"crispEdges\",\n module_size: 7,\n standalone: true,\n use_path: true\n )\n @pulll = \"ksksksksks\"\n end", "def show\n @diagram = Diagram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diagram }\n end\n end", "def render\n return @markdown unless $yart_installed\n\n lines = @markdown.split(\"\\n\")\n return @markdown unless yart_snippet?(lines)\n\n yart_lines = extract_yart_lines(lines)\n yart_snippet = yart_lines[1..-2].join(\"\\n\")\n raise YART_PARSE_ERROR if yart_snippet.include?(\"YART.parse\")\n\n html = YART.parse { eval(yart_snippet) }\n @markdown.sub!(yart_lines.join(\"\\n\"), html)\n\n render\n end", "def draw_model_inheritance # rubocop:disable Metrics/AbcSize\n return '' if @definition.superklass.empty? && @definition.inherited_modules.empty?\n\n xml = ''\n\n unless @definition.superklass.empty?\n xml += %(<generalization general=\"#{@definition.superklass.id}\" xmi:id=\"#{gen_id}\" xmi:type=\"uml:Generalization\">\n </generalization>)\n end\n\n return xml if @definition.inherited_modules.empty?\n\n @definition.inherited_modules.each do |m|\n next if m.empty?\n\n xml += %(<generalization general=\"#{m.id}\" xmi:id=\"#{gen_id}\" xmi:type=\"uml:Generalization\">\n </generalization>)\n end\n xml\n end", "def render_code(exe_str, display_str = nil)\n dsp_str = display_str\n dsp_str = exe_str if !display_str\n dsp_str.strip!\n #puts \"exe_str: #{exe_str}\"\n stack :margin_bottom => 12 do \n background rgb(210, 210, 210), :curve => 4\n para dsp_str, {:size => 9, :margin => 12, :font => 'monospace'}\n stack :top => 0, :right => 2, :width => 70 do\n stack do\n background \"#8A7\", :margin => [0, 2, 0, 2], :curve => 4 \n para link(\"Run this\", :stroke => \"#eee\", :underline => \"none\") { eval(exe_str, TOPLEVEL_BINDING) },\n :margin => 4, :align => 'center', :weight => 'bold', :size => 9\n end\n stack :top => 0, :right => 2, :width => 70 do\n background \"#8A7\", :margin => [0, 2, 0, 2], :curve => 4 \n para link(\"Copy this\", :stroke => \"#eee\", :underline => \"none\") { self.clipboard = exe_str },\n :margin => 4, :align => 'center', :weight => 'bold', :size => 9\n end\n end\n end\n end", "def render\n Vedeu.renderers.render(output) if Vedeu.ready?\n end", "def get_graphviz\n handle_graphviz_setup\n @file_name = build_graphviz_restfulpath(params, @output_format)\n # @file_name = get_graph_dir(\"#{@graph_path}#{params[:program]}.#{@output_format}\")\n \n render :layout=>false\n end", "def display_instance(instance)\n manuscript = instance.manuscript\n annotation = instance.annotations.first\n canvas_id = annotation ? annotation.canvas_id : nil\n manifest_id = manuscript ? manuscript.manifest_url : nil\n\n link = if manifest_id\n @@witness_link_template % {manifest_id: manifest_id, canvas_id: canvas_id}\n else\n ''\n end\n\n \"#{instance.label} #{link}\".html_safe\n end", "def render\n Vedeu.render_output(output) if visible?\n end", "def draw_imgui\n\n\t\tend", "def yaml_display(env, \n options = {}, \n colors = DbAgile::Core::Schema::STATUS_TO_COLOR, \n indent = 0)\n env.display(\"---\\nlogical:\")\n logical.yaml_display(env, options, colors, indent + 1)\n env.display(\"\\n---\\nphysical:\")\n physical.yaml_display(env, options, colors, indent + 1)\n end", "def map\n shape = @opts.fetch :shape, 'record'\n rslt = StringIO.new\n rslt.puts \"digraph #{@model[:name]} {\"\n rslt.puts ' graph [rankdir=\"LR\"]'\n rslt.puts ''\n\n @model[:tables].each do |table|\n # nodes\n rslt.puts \" \\\"#{table[:name]}\\\" [label=\\\"#{table[:name]}\\\", shape=\\\"#{shape}\\\"]\"\n # @nodes.puts \" \\\"#{table[:name]}\\\" [label=\\\"<f0> #{table[:name]}|<f1> #{table[:desc]}\\\", shape=\\\"#{shape}\\\"]\"\n # edges\n table.fetch(:fks, []).each do |fk|\n rslt.puts \" \\\"#{table[:name]}\\\"->\\\"#{fk[:table]}\\\"\"\n end\n # graphviz\n table.fetch(:graphvizs, []).each do |text|\n rslt.puts \" #{text}\"\n end\n end\n\n rslt.puts '}'\n rslt.string\n end", "def render(canvas)\n output = horizontal_line(canvas.width) + \"\\n\"\n\n canvas.each_line do |line|\n output += generate_line line\n end\n\n output += horizontal_line(canvas.width)\n output\n end", "def populate_diagram\n\n # Parse the Diagram data using the #Reader\n puts \"Parsing Diagram data . . .\"\n diagram_data = @reader.get_diagram_data\n\n # Create and populate a Diagram from the parsed data\n puts \"Populating Diagram with Classes . . .\"\n\t\t\t@diagram = Diagram.new(diagram_data[:name], diagram_data[:artifacts])\n @diagram.populate!\n end", "def to_visual i_string, default_direction=nil\n Algorithm.run { |algo| algo.to_visual(i_string, default_direction) }\n end", "def draw_me_a_train\n puts %Q{ .---- - -\n ( ,----- - -\n \\_/ ___\n c--U---^--'o [_\n |------------'_| MTA ROUTE OPTIMIZER\n /_(o)(o)--(o)(o) *******************\n ~ ~~~~~~~~~~~~~~~~~~~~~~~~\n }\nend", "def execute\n src = read_dsl\n dsl = Markun::Dsl.new\n dsl.instance_eval src\n convert_markdown_to_html dsl.markun.have_menu\n end", "def linetool\n Sketchup.active_model.select_tool LineTool.new\nend", "def modeler_description\n return \"This uses the OpenStudio::Model::Space::fromFloorPrint method, and is very much like the Create Spaaces From Diagram tool in the OpenStudio SketchUp plugin, but lets you draw teh diagram in the tool of your choice, and then imports it into the OpenStudio application via a measure.\"\n end", "def visuals\n <<~HEREDOC\n #{'VISUALS'.bold.blue}\n\n The appearance and colours of the pieces and board depend on your system and console settings.\n On your device, pieces will look like this:\n\n\n #{'P R B N Q K'.bold.green}\n\n WHITE => \\u2659 \\u2656 \\u2657 \\u2658 \\u2655 \\u2654\n\n BLACK => \\u265F \\u265C \\u265D \\u265E \\u265B \\u265A\n HEREDOC\n end", "def line_template(ul = 'unmarked', ur = 'unmarked', ll = 'unmarked', lr = 'unmarked')\n html = <<-eol\n <div class=\"fam-tree-line-container\">\n <div class=\"fam-tree-line-level\">\n <div class=\"fam-tree-#{ul}\"></div>\n <div class=\"fam-tree-#{ur}\"></div>\n #{clear}\n </div>\n <div class=\"fam-tree-line-level\">\n <div class=\"fam-tree-#{ll}\"></div>\n <div class=\"fam-tree-#{lr}\"></div>\n #{clear}\n </div>\n </div>\n eol\n html.html_safe\n end", "def render\n out = HighLine.new\n out.wrap_at = 78\n out.say <<-RENDER\n<%=color(\"#{@name}\", :bold)%> [#{@category.upcase}]\n<%='-'*#{@name.length}%>\n#{@description}\nRENDER\n end", "def process_graphviz(data)\n data.gsub(/\\<graphviz\\>\\s*([\\s\\S]*?)\\s*\\<\\/graphviz\\>/m) do\n id = Digest::SHA1.hexdigest($1)\n\n # Write graphviz graph to temp file\n tmp = Tempfile.new ''\n tmp.write $1\n tmp.close\n\n out_path_dir = ::File.expand_path ::File.join(@wiki.path, 'tmp')\n Dir.mkdir out_path_dir unless ::File.exists? out_path_dir\n out_path = ::File.join(out_path_dir, id)\n\n system \"#{@wiki.dot} -Tpng -o #{out_path}.png #{tmp.path}\"\n\n # Clean up tmp file\n tmp.delete\n\n # Replace graph with img link\n %Q(<img alt=\"Graphviz image\" src=\"/tmp/#{id}.png\">)\n end\n end", "def draw renderer\n raise NotImplementedError\n end", "def draw_edge\n print \"|\"\n end", "def render_ground( ground, opts={} )\r\n tmpl = File.read_utf8( 'templates/shared/_ground.md' )\r\n render_erb_template( tmpl, binding )\r\nend", "def draw(stream)\n @xml = Builder::XmlMarkup.new(:target=>stream, :indent=>2)\n @xml.instruct!\n @xml.declare! :DOCTYPE, :svg, :PUBLIC, \"-//W3C//DTD SVG 1.1//EN\", \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\"\n @xml.svg(:width=>\"#{PHYSICAL_WIDTH}#{PHYSICAL_UNITS}\",\n :height=>\"#{PHYSICAL_HEIGHT}#{PHYSICAL_UNITS}\",\n :viewBox=>\"#{MIN_X} #{MIN_Y} #{WIDTH} #{HEIGHT}\",\n :xmlns=>NAMESPACE,\n :version=>VERSION) do |page|\n @slist.each_with_index do |series, i|\n page.g(:transform=>\"translate(#{MARGIN}, #{i * @spacing})\") do |panel|\n panel.g(:transform=>\"scale(#{@yscale})\") do |caption|\n caption.text(:x=>\"-#{TSIZE}\",\n :y=>\"#{MARGIN}\",\n :'font-size'=>\"#{TSIZE}\",\n :'font-family'=>\"Verdana\",\n :'text-anchor'=>\"end\") do |textlabel|\n textlabel.text! series.name\n end\n end\n widthscale = Float(WIDTH - MARGIN)/series.total\n boxdepth = DEPTH/widthscale\n panel.g(:transform=>\"scale(#{widthscale})\") do |core|\n core.rect(:x=>\"0\", :y=>\"0\", :width=>\"#{series.total}\", :height=>\"#{boxdepth}\", :fill=>\"goldenrod\")\n cx = (-series.offset).to_s\n series.rings.inject(0) do |x, ring|\n ring_width, ring_start = ring\n ew_width = 0.75 * ring_width\n r_e, r_w = ring_start + ew_width, ring_start + ring_width\n p_a_x, p_b_x = x + ew_width, x + ring_width\n data = \"M#{p_a_x},0 H#{p_b_x} A#{r_w},#{r_w} 0 0,1 \"\n data << case\n when r_w <= boxdepth\n p_c_y, p_d_y = Math.sqrt(r_w**2 - series.offset**2), Math.sqrt(r_e**2 - series.offset**2)\n \"0,#{p_c_y} V#{p_d_y} A#{r_e},#{r_e} 0 0,0 \"\n when r_e > boxdepth && Math.sqrt(r_e**2 - boxdepth**2) > series.offset\n p_c_x, p_d_x = Math.sqrt(r_w**2 - boxdepth**2) - series.offset, Math.sqrt(r_e**2 - boxdepth**2) - series.offset\n \"#{p_c_x},#{boxdepth} H#{p_d_x} A#{r_e},#{r_e} 0 0,0 \"\n when Math.sqrt(r_w**2 - boxdepth**2) <= series.offset\n p_c_y, p_d_y = Math.sqrt(r_w**2 - series.offset**2), Math.sqrt(r_e**2 - series.offset**2)\n \"0,#{p_c_y} V#{p_d_y} A#{r_e},#{r_e} 0 0,0 \"\n else\n p_c_x, = Math.sqrt(r_w**2 - boxdepth**2) - series.offset\n p_d_y = Math.sqrt(r_e**2 - series.offset**2)\n \"#{p_c_x},#{boxdepth} H0 V#{p_d_y} A#{r_e},#{r_e} 0 0,0 \"\n end\n data << \"#{p_a_x},0 Z\"\n core.path(:d=>data, :'stroke'=>\"none\", :fill=>\"saddlebrown\")\n p_b_x\n end\n end\n end\n end\n end\n end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json do |output|\n output.gsub!(\"threed\",\"3d\")\n output.gsub!(\"default_dot_style\",\"dot_style\")\n %w(solid_dot font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click dot_style hollow_dot).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def draw_graph(graph)\n type = graph.directed? ? :digraph : :graph\n g = GraphViz.new(:G, :type => type)\n graph.vertices().each do |v|\n g.add_node(v.id)\n end\n\n added_edges = Set.new\n\n graph.edges_by_vertices().each do |x, edges|\n from = g.get_node(x.id)\n edges.each do |y|\n to = g.get_node(y.id)\n\n if graph.directed?\n # draw each individual 'directed' edge\n g.add_edge(from, to)\n else\n # draw only one edge to represent 'undirected' edge\n g.add_edge(from, to) unless added_edges.include?([to, from])\n added_edges.add([from, to])\n end\n\n\n end\n end\n\n\n filename = \"graph.png\"\n g.output( :png => filename )\n system(\"open #{filename}\")\nend", "def render_layout(output, layout, info); end", "def diagram=(diagram_in)\n self.picture=diagram_in.read\n end", "def plot!\n return plot if plot && plot.valid? && plot.file_exists?\n plot.destroy if (plot)\n f = ExtendedArgumentationFramework::Framework.new(graph_representation, auto_generate_nodes: true)\n file = ExtendedArgumentationFramework::Plotter.new(f, plot_acceptability: false, edges_style: 'dir=back style=dashed').to_png\n p=Plot.create(filename: \"#{Plot::BASE_URL}/#{file}\", object: self)\n p\n end", "def download_image\n Net::HTTP.start(\"yuml.me\", 80) do |http|\n http.get(URI.escape(@diagram.get_uri))\n end\n end", "def tralics_commands\n base_commands = <<-'EOS'\n% Commands specific to Tralics\n\\def\\hyperref[#1]#2{\\xmlelt{a}{\\XMLaddatt{target}{#1}#2}}\n\\newcommand{\\heading}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\codecaption}[1]{\\xmlelt{heading}{#1}}\n\\newcommand{\\sout}[1]{\\xmlelt{sout}{#1}}\n\\newcommand{\\kode}[1]{\\xmlelt{kode}{#1}}\n\\newcommand{\\coloredtext}[2]{\\xmlelt{coloredtext}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\coloredtexthtml}[2]{\\xmlelt{coloredtexthtml}{\\AddAttToCurrent{color}{#1}#2}}\n\\newcommand{\\filepath}[1]{\\xmlelt{filepath}{#1}}\n\\newcommand{\\image}[1]{\\xmlelt{image}{#1}}\n\\newcommand{\\imagebox}[1]{\\xmlelt{imagebox}{#1}}\n% Ignore pbox argument, just replacing with content.\n\\newcommand{\\pbox}[2]{#2}\n% Ignore some other commands.\n\\newcommand{\\includepdf}[1]{}\n\\newcommand{\\newunicodechar}[2]{}\n\\newcommand{\\extrafloats}[1]{}\n EOS\n custom_commands = <<-EOS\n\\\\usepackage{amsthm}\n\\\\theoremstyle{definition}\n\\\\newtheorem{codelisting}{#{language_labels[\"listing\"]}}[chapter]\n\\\\newtheorem{aside}{#{language_labels[\"aside\"]}}[chapter]\n EOS\n [base_commands, custom_commands].join(\"\\n\")\n end", "def make_render exp, in_view = false\n render_type, value, rest = find_render_type exp, in_view\n rest = process rest\n result = Sexp.new(:render, render_type, value, rest)\n result.line(exp.line)\n result\n end", "def render(io)\n io.cmd :celld\n io.cmd :clbrdrt\n io.cmd :brdrs\n io.cmd :brdrw10\n io.cmd :clbrdrl\n io.cmd :brdrs\n io.cmd :brdrw10\n io.cmd :clbrdrb\n io.cmd :brdrs\n io.cmd :brdrw10\n io.cmd :clbrdrr\n io.cmd :brdrs\n io.cmd :brdrw10\n io.cmd v_merge if v_merge\n io.cmd :cellx, right_width\n contents = [@content] unless @content.is_a?(Array)\n contents.each do |c|\n if c.respond_to?(:render)\n c.render(io)\n else\n io.txt c\n end\n end\n io.cmd :cell\n end", "def generate(options = {})\n embed_outline(options[:selflink]) if options[:outline]\n\n #if options[:dirmap]\n # md_dir = Pathname.new(@md_file).dirname.expand_path\n # embed_sidebar( Madowu::DirectoryMapper.dirmap(md_dir) )\n #end\n\n if options[:sidebar]\n #lines = File.open( options[:sidebar], \"r\").readlines\n lines = `#{@markdown} #{options[:sidebar]}`.split(\"\\n\")\n embed_sidebar(lines)\n end\n\n result = [\n make_header(options[:css], options[:charset]),\n @markup_lines,\n \"</div></div></body></html>\",\n ''\n ].join(\"\\n\")\n end", "def renderer; end", "def graphic(number)\n File.open(\"#{frame_id(number)}.svg\", \"w\") do |file|\n file.write render(\"bit101_style.erb\")\n end\n\n system(\"convert #{frame_id(number)}.svg #{frame_id(number)}.jpg\")\n # system(\"java -jar ~/Downloads/batik-1.7/batik-rasterizer.jar #{frame_id(number)}.svg\")\n File.unlink(\"#{frame_id(number)}.svg\")\n\n print \"+\"\nend", "def draw(interface)\n output \" | | \"\n output \" #{@squares[interface[:top_left]]} | #{@squares[interface[:top]]} | #{@squares[interface[:top_right]]} \"\n output \" | | \"\n output \"-----+-----+-----\"\n output \" | | \"\n output \" #{@squares[interface[:left]]} | #{@squares[interface[:middle]]} | #{@squares[interface[:right]]} \"\n output \" | | \"\n output \"-----+-----+-----\"\n output \" | | \"\n output \" #{@squares[interface[:bottom_left]]} | #{@squares[interface[:bottom]]} | #{@squares[interface[:bottom_right]]} \"\n output \" | | \"\n end", "def call\n result = self.class.markdown_renderer.result(schema: schema)\n if @html\n result = self.class.html_renderer.result(body: self.class.redcarpet.render(result))\n result.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n result\n end\n end", "def render\n # need to return the following like this\n # 1) font_size as font-size \n # 2) dot_size as dot-size\n # 3) outline_colour as outline-colour\n # 4) halo_size as halo-size\n # 5) start_angle as start-angle\n # 6) tick_height as tick-height\n # 7) grid_colour as grid-colour\n # 8) threed as 3d\n # 9) tick_length as tick-length\n # 10) visible_steps as visible-steps\n # 11) key_on_click as key-on-click\n returning self.to_json2 do |output|\n output.gsub!(\"threed\",\"3d\")\n %w(font_size dot_size outline_colour halo_size start_angle tick_height grid_colour tick_length no_labels label_colour gradient_fill fill_alpha on_click spoke_labels visible_steps key_on_click).each do |replace|\n output.gsub!(replace, replace.gsub(\"_\", \"-\"))\n end\n end\n end", "def render opts={}\n # italic(bold) => italic{ bold{ data }}, then evaled\n expr = self.expr.gsub(\"(\", \"{\").gsub(\")\", \"}\")\n \n if expr.include?('{')\n expr.sub!( \"}\", \"{@data}}\")\n else\n expr << \"{@data}\"\n end\n self.renderer.instance_eval expr\n end", "def graph(name, options = {}, &block)\n GraphViz::DSL.new(name, options.merge( { :type => \"graph\" } ), &block).graph\nend", "def to_svg\n rp=rubyvis_panel\n rp.render\n rp.to_svg\n end", "def render_dot_generic2(graph_name,file_type, opts )\n @graph_data ||= RicGraph.get_dot(graph_name,opts)\n gv=IO.popen(\"/usr/bin/dot -q -T#{file_type}\",\"w+\")\n #gv.puts( Gr aph.to_dot(graph_name,opts) )\n gv.puts( @graph_data )\n gv.close_write\n @generic_svg = {\n :name => graph_name,\n :data => gv.read,\n }\n return @generic_svg[:data]\n end", "def display\n puts (\"[\" + @id.name + \", \" + @id.version + \"]\").green.bold\n puts \"author = \".blue + @author\n print \"wrapper = \".blue + @wrapper.to_s\n puts \", unique = \".blue + @unique.to_s\n puts\n\n puts \"[Path:]\".green.bold\n puts @path\n\n #\n # Display the provided elements\n #\n\n puts \"\\n[Provide]\".green.bold\n @provide.each do |context|\n puts \"\\n<Context #{context.name}>\".blue.bold\n OCMSet::SECTIONS.each { |section| context[section].each { |k| puts k } }\n end\n\n #\n # Display the required elements\n #\n\n if @require != nil then\n puts \"\\n[Require]\".green.bold\n OCMSet::SECTIONS.each { |section| @require[section].each { |k| puts k } }\n end\n\n end", "def assemble_markup\n\n design_renderer = liquid_for(@design.markup)\n view_renderer = liquid_for(@view_template.markup)\n params = node_template_data.merge(global_template_data)\n\n # Render the view template.\n rendered_view = view_renderer.render(params, :filters => liquid_filters)\n\n # Render the design and merge in the view.\n design_renderer.render(params.merge('content' => rendered_view), :filters => liquid_filters)\n\n end", "def render(prompt, bottomline = nil)\n @rendered = wrap(prompt)\n @bottomline = bottomline\n\n print rendered_output\n end", "def render\n super\n args.outputs.primitives << [\n # Layout\n {x: 330, y: 335, w: 556, h: 308, r: 100, g: 100, b: 100}.solid,\n @exit,\n {x: 860, y: 625, text: 'X', r: 175, g: 175, b: 175}.label,\n { x: 340, y: 370, text: \"Money: $#{state.money}\", size_enum: 5, alignment_enum: align(:left) }.label,\n { x: 500, y: 66, text: 'Take a Break', size_enum: 10, r: 250, g: 250, b: 250 }.label\n ]\n args.outputs.primitives << items.map(&:render)\n end", "def inline rdoc, reference = rdoc\n RDoc::RD::Inline.new rdoc, reference\nend", "def to_dot\n template = <<-eos\ndigraph \"<%= uid || 'graph' %>\" {\n node[ style = \"filled, solid\"];\n<% each_task do |task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n \"<%= task %>\" [label = \"<%= task %>\", fillcolor = \"<%= task.color %>\"];\n<% end -%>\n\n<% each_task do |task| -%>\n<% task.each_forward_dependency do |forward_task| -%>\n<% next unless task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless task.node.name =~ dot_node_filter if dot_node_filter and task.node -%>\n<% next unless forward_task.name =~ dot_task_filter if dot_task_filter -%>\n<% next unless forward_task.node.name =~ dot_node_filter if dot_node_filter and forward_task.node -%>\n \"<%= task %>\" -> \"<%= forward_task %>\";\n<% end -%>\n<% end -%>\n}\n eos\n ERB.new(template, nil, '-').result(binding)\n end", "def draw_edge(anIO, aDependency)\n source_id = feature_files.find_index(aDependency.dependee)\n target_ids = aDependency.dependents.map do |a_target|\n feature_files.find_index(a_target)\n end\n\n target_ids.each do |t_id|\n anIO.puts \"\\tnode_#{source_id} -> node_#{t_id};\"\n end\n end", "def render_StateMachine sm, dot_opts = nil\n return if @rendered[sm]\n @rendered[sm] = true\n\n dot_opts ||= { }\n hide_decomposition = dot_opts.delete(:hide_decomposition)\n\n stream.puts \"\\n// {#{sm.inspect}\"\n name = dot_opts.delete(:_node_name) || dot_name(sm)\n type = \"subgraph #{name}\"\n\n dot_opts[:label] ||= dot_label(sm.superstate)\n dot_opts[:shape] = :box\n dot_opts[:style] = 'filled,rounded'\n dot_opts[:fillcolor] ||= :white\n dot_opts[:fontcolor] ||= :black\n\n dot_opts = dot_opts_for sm, dot_opts\n\n if hide_decomposition && false\n dot_opts[:label] += \"\\\\r o-o\"\n end\n \n stream.puts \"#{type} {\"\n stream.puts %Q{ #{render_opts(dot_opts, \";\\n \")}}\n \n yield if block_given?\n\n unless hide_decomposition\n start_name = dot_name(sm, :start)\n @rendered[start_name] = true\n stream.puts \"\\n// Implicit :start Pseudostate\"\n stream.puts %Q{ node [ shape=\"circle\", label=\"\", style=filled, fillcolor=black ] #{start_name}; }\n sm.states.each { | s | render(s) }\n end\n\n stream.puts \"}\"\n stream.puts \"// } #{sm.inspect}\\n\"\n end", "def markdown_inline_renderer\n Redcarpet::Markdown.new(InlineRenderer, tables: false)\n end", "def render_visual i_string, default_direction=nil\n return to_visual(i_string, default_direction).reverse!\n end", "def draw_delauney\nend", "def setup()\n @strm = IO::popen(\"#{@commandPath} #{@commandOpts}\",'r+') ;\n call(\"display2d:false;\")\n call(\"linel:1000000000;\")\n end", "def displayOpen( options={} ) # open the graph (preamble)\n $options = options\n if $options != nil then\n if $options.has_key? :layout then $layout = options[:layout] end\n if $options.has_key? :rankdir then $rankdir = options[:rankdir] end\n end\n puts \"digraph G {\"\n puts \" rankdir=#{$rankdir}\"\n puts \" layout=\\\"#{$layout}\\\"\"\n puts \" fontname = \\\"Bitstream Vera Sans\\\"\"\n puts \" ucd [shape=plaintext, fontsize=18, label=\\\"#{$name}\\\"] \" if $layout == :circo\nend", "def make_vm_line(vm)\n \"${color2} #{vm}\\n\"\nend", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tunning_diagram }\n format.xml { render xml: @tunning_diagram }\n end\n end", "def render(obj = Object.new, locals = {})\n output = template.result(obj.instance_eval { binding })\n (view == 'document' || view == 'embedded') ? output.gsub(BLANK_LINES_PATTERN, '').gsub(LINE_FEED_ENTITY, \"\\n\") : output\n end", "def render\n \n raise \"files not specified\" if self.files.empty?\n \n self.xml.instruct! :xml, version: \"1.0\", encoding: \"UTF-8\"\n self.xml.metalink( xmlns: \"urn:ietf:params:xml:ns:metalink\" ) do |metalink|\n \n metalink.generator(\"Sudrien/metalink-ruby 0.2.0\") #may\n metalink.origin( self.origin, dynamic: self.origin_dynamic ) if self.origin\n \n metalink.published( self.published.strftime('%FT%T%:z') ) if self.published\n metalink.updated( self.updated.strftime('%FT%T%:z') ) if self.updated\n \n self.files.each do |file|\n file.render(self, metalink)\n end\n end\n self.xml.target!\n end", "def draw_external_type(level, type)\n return if excluded? type\n\n name = type.qualified_name\n label = type.name\n kind = $implemented_types.include?(type) && :interface || $extended_types.include?(type) && :class\n\n draw_node level, name, label, kind\nend", "def to_yumlme_dsl\n # FIXME tmp FIX for modules\n # @classes -= [ActsAsRateable, AuthenticatedBase, Geocodeable, HasStatus, XmasProjectMethods]\n\n @options.classes = @classes\n # puts @classes if @options.debugging\n\n @yumlme_dsl = @note + @classes.map do |klass|\n unless @options.inheritance\n klass.to_yumlme_dsl(@options)\n else\n create_yuml_dsl_for_class_hierarchy(klass)\n end\n end.flatten.uniq.join(\",\")\n end", "def render_wsd(code, style)\n response = Net::HTTP.post_form(URI.parse(WSD_URL), 'style' => style, 'message' => code)\n if response.body =~ /img: \"(.+)\"/\n url = \"http://www.websequencediagrams.com/#{$1}\"\n \"<img src=\\\"#{url}\\\" />\"\n else\n puts response.body\n html_error(\"Sorry, unable to render sequence diagram at this time.\")\n end\n end", "def to_markup\n <<-STR\n= #{self.class} Api\n\n#{sorted_endpoints.map do |e|\n \"=== #{e.http_method} #{e.path}\\n\\n\" +\n \"<em>#{e.description}</em>\\n\\n\" +\n \"Details at link:#{e.path}#{self.class.api_doc_suffix}\"\n end.join \"\\n\\n\" }\n STR\n end", "def generatexml()\n merge(gadrgeneratexml: 'true')\n end", "def test_simple_render\n \n correct_result = \"<!-- Start Header --><div id=\\\"header\\\" class=\\\"foo bar\\\"><div class=\\\"ring\\\"><div class=\\\"outer\\\"><div class=\\\"inside\\\"><div class=\\\"lining\\\">I return the rendered content of header-and-logo at 0<br/>\\n</div></div></div></div></div><!-- Start Nav --><div id=\\\"navigation\\\"><div class=\\\"container\\\"><div class=\\\"inside\\\">I return the rendered content of navigation at 1<br/>\\n</div></div></div><!-- Start Content --><div id=\\\"content\\\"><div class=\\\"inside\\\"><div id=\\\"liquid\\\"><div class=\\\"lining\\\">I return the rendered content of :auto at 2<br/>\\n</div></div></div></div><!-- Start Footer --><div id=\\\"footer\\\"><div class=\\\"outside\\\"><div class=\\\"inside\\\">I return the rendered content of footer-navigation at 3<br/>\\nI return the rendered content of footer-logo at 4<br/>\\n</div></div></div>\"\n \n alml = Alml::Engine.new TEST_STR\n rendered_result = alml.render { |dynamic_script_name, script_index| \"I return the rendered content of #{dynamic_script_name} at #{script_index}<br/>\\n\" } \n \n assert_equal correct_result, rendered_result\n end", "def create_graphic\n y = @enchant_list.bottom_corner\n h = Graphics.height - y - @enchant_window.height\n @graphic = GraphicUnifier.new(0, y, Graphics.width, h)\n @graphic.viewport = @viewport2\n @enchant_window.graphic = @graphic\n @enchant_window.scroll = @enchant_list.item\n end", "def render(model, &content)\n template = Neapolitan.file(path, :stencil=>site.config.stencil)\n\n # update the model's metadata\n #model.update(template.metadata)\n\n result = template.render(model, &content).to_s\n\n layout_name = template.metadata['layout']\n\n if layout_name\n layout = site.lookup_layout(layout_name)\n\n raise \"No such layout -- #{layout}\" unless layout\n\n result = layout.render(model){ result }\n end\n\n result.to_s\n end", "def call\n markdown = markdown_renderer.result(schema: schema)\n if @html\n html = markdown_parser.render(markdown)\n html = html_renderer.result(body: html)\n html.gsub(/id=\"(.+)\"/) {|text| text.tr(\"/:\", \"\") }\n else\n markdown\n end\n rescue Jdoc::Link::ExampleNotFound => exception\n abort(\"Error: #{exception.to_s}\")\n end", "def digraph(name, options = {}, &block)\n GraphViz::DSL.new(name, options.merge( { :type => \"digraph\" } ), &block).graph\nend" ]
[ "0.6608325", "0.6058108", "0.600414", "0.5879647", "0.58231646", "0.575163", "0.57049733", "0.56710804", "0.566984", "0.56106937", "0.5603775", "0.55910534", "0.55837697", "0.553744", "0.5508813", "0.54329497", "0.53771", "0.5375752", "0.5371835", "0.536338", "0.5321961", "0.52885956", "0.52554476", "0.52514505", "0.52497953", "0.5245052", "0.5205689", "0.519416", "0.5186753", "0.5174934", "0.51740617", "0.5149433", "0.51322913", "0.5120402", "0.5119131", "0.50996155", "0.5087904", "0.50878483", "0.5086883", "0.5078411", "0.50765705", "0.5074802", "0.50693053", "0.50664014", "0.5064938", "0.5063945", "0.5052174", "0.5052058", "0.5037423", "0.503165", "0.5029387", "0.50191087", "0.50180304", "0.50120527", "0.50087756", "0.5007619", "0.49989367", "0.4986982", "0.4979479", "0.4975814", "0.49732086", "0.4966742", "0.49651256", "0.49622807", "0.49533147", "0.49387312", "0.49296936", "0.49295333", "0.4921975", "0.49209175", "0.49199158", "0.4919655", "0.49163488", "0.4912836", "0.49101317", "0.4908086", "0.49033478", "0.48961985", "0.48893806", "0.4887771", "0.48831046", "0.4881205", "0.48735696", "0.48719868", "0.48712674", "0.48660302", "0.4864867", "0.48620304", "0.48505053", "0.48489535", "0.48483324", "0.4844484", "0.48437867", "0.48357967", "0.48349255", "0.4834716", "0.48304132", "0.48294884", "0.48284698", "0.48270202", "0.4826754" ]
0.0
-1
Returns the i18n_scope for the class. Overwrite if you want custom lookup.
def i18n_scope :activemodel end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def i18n_scope\n self.class.i18n_scope\n end", "def i18n_scope\n self.class.i18n_scope\n end", "def locale_scope\n I18n::Scope.new(locale_translations)\n end", "def i18n_scope\n @i18n_scope ||= nil\n end", "def i18n_scope=(scope)\n @i18n_scope = scope\n end", "def i18n_scope\n return event_name if user_role.blank? || !event_has_roles?\n\n \"#{event_name}.#{user_role}\"\n end", "def scope\n klass\n end", "def scope\n @scope ||= Array(@root_scope) + [Inflector.underscore(name)]\n end", "def scope\n read_attr :scope, :to_sym\n end", "def get_named_scope_info(klass)\n klass.respond_to?(:scopes) ? klass.scopes.keys.map(&:to_s) : []\n end", "def translation_scope\n \"kiqr.#{controller_name}\"\n end", "def i18n_scope\n \"exhibits.notifications.order.delivery_confirmation_period_elapsed.#{role}\"\n end", "def translation_scope\n \"controllers.#{params[:controller]}\"\n end", "def translation_scope\n \"order_details.notices\"\n end", "def scope\n @scope\n end", "def scope\n @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def scope\n return @scope\n end", "def i18n_scope\n :mongoid\n end", "def scope\n @attributes[:scope]\n end", "def localized(scope, attribute, default)\n self.class.localized scope, attribute, default, object.class.name.downcase\n end", "def l_scope(*sections, &block)\r\n ArkanisDevelopment::SimpleLocalization::Language.with_app_scope(*sections, &block)\r\n end", "def custom_scope_get scope_name\n\t\t\tThread.current[SESSION].custom_scope_get scope_name\n\t\tend", "def translation_class\n const_get translation_class_name\n end", "def name\n object.translated_name(scope[:locale] || I18n.default_locale)\n end", "def scope\n field[:scope]\n end", "def scope\n @scope ||= {}\n end", "def scope\n @scope ||= {}\n end", "def get_scope(cur_scope = nil)\n # base default scope is set up here so that deactivated module can update this\n cur_scope = AssemblyComponent.scoped if (cur_scope.nil?)\n return (defined?(super)) ? super(cur_scope) : cur_scope\n end", "def get_scope(cur_scope = nil)\n # base default scope is set up here so that deactivated module can update this\n cur_scope = StateComponentTypeTax.scoped if (cur_scope.nil?)\n return (defined?(super)) ? super(cur_scope) : cur_scope\n end", "def translation_scope\n \"devise.#{controller_name}\"\n end", "def scope_name; end", "def scope_name name\n name.to_s.pluralize.to_sym\n end", "def current_scope\n @scope\n end", "def scope\n record.class\n end", "def scope\n @scope ||= %i[evil client errors] << \\\n Tram::Policy::Inflector.underscore(model.to_s).to_sym\n end", "def default_prop_group_scope\n class_scope\n end", "def i18n_scope\n :neo4j\n end", "def scope\n parameter[:scope]\n end", "def scope_name scope\n\t\traise \"No data-source set\" unless data_source\n\t\tdata_source.scopes.get(scope).human_name\n\tend", "def page_i18n_scope(page)\n 'pages.' + page.gsub('/', '.')\n end", "def translation_scope\n \"mailers.#{mailer_name.tr(\"/\", \".\").sub(\"_mailer\", \"\")}.#{action_name}\"\n end", "def scopes\n self.class.scopes\n end", "def scope(level = @skl_level)\n return @skl_levelcache[level][:scope]\n end", "def klass\n @klass ||= @parent unless @parent.is_a?(Scope)\n end", "def get_label_in_scope(t,l)\n @lang_ = get_default_label(l)\n languages = t.counterplayers(:atype => @base_locator+\"/association/scoping\", :rtype=>@base_locator+\"/types/named_topic_type\", :otype => @base_locator+\"/types/language\" )\n labels = t.counterplayers(:atype => @base_locator+\"/association/scoping\", :rtype=>@base_locator+\"/types/named_topic_type\", :otype => @base_locator+\"/types/displaylabel\" )\n namedlabels = languages.zip(labels)\n namedlabel = get_default_label(t)\n for label in namedlabels\n if get_default_label(label[0]).include?(@lang_)\n namedlabel = get_default_label(label[1])\n break\n end\n end\n return namedlabel;\n end", "def current_scope\n params[:scope].try(:to_sym) || railgun_resource.default_scope.try(:key)\n end", "def locale_translations\n @locale_scope ||= begin\n locale_path = \"#{@locale}.yml\"\n locale_path = File.join(@locales_dir, locale_path) if @locales_dir\n YAML.load_file(locale_path).fetch(@locale)\n end\n end", "def nav_scope\n self.class._nav_scope\n end", "def translate(field)\n super(\"#{@_i18n_scope}.#{field}\")\n end", "def it_scope\n @it_scope ||= Example::Scope.new(self)\n end", "def scope\n @scope ||= Scope.new(parent)\n end", "def scoped_model\n if @is_top_widget || @selector_for\n Object.const_get @resource.classify\n else\n parent.record.send(@resource.pluralize) rescue Object.const_get @resource.classify\n end\n end", "def get_scope_of_context\n stack_to_analyse = $lc_test_get_scope_of_context_stack || caller\n latest_app_file = stack_to_analyse.detect { |level| level =~ /#{Regexp.escape(RAILS_ROOT)}\\/app\\/(controllers|views|models)\\// }\n return [] unless latest_app_file\n \n path = latest_app_file.match(/([^:]+):\\d+.*/)[1]\n dir, file = path.match(/^#{Regexp.escape(RAILS_ROOT)}\\/app\\/(controllers|views|models)\\/(.+)#{Regexp.escape(File.extname(path))}$/)[1, 2]\n \n scope = file.split('/')\n case dir\n when 'controllers'\n scope.last.gsub! /_controller$/, ''\n when 'views'\n scope.last.gsub! /^_/, ''\n when 'models'\n scope.last.gsub! /_observer$/, ''\n end\n \n scope\n end", "def set_scope_class\n klass = self.class::Scope\n klass.send(:include, ScopeMethods)\n @scope_class = klass.new(@scope, @search_attributes)\n end", "def scope\n GlobalScope.instance\n end", "def lookup(locale, key, scope = [], options = {})\n\n init_translations unless initialized?\n result = nil\n _locale = ::Locale.first(:code => locale)\n key = pluralizer(_locale, key, options[:count])\n value = _locale.translations.first(:code => key)\n result = value.value unless value.nil?\n result = options[:default] if !value.nil? && value.value == key && options[:default]\n return result unless value.nil? || value.value == key\n \n # check devise messages for remaining keys\n result = _locale.translations.first(:code => \"devise.sessions.#{key}\")\n return result.value unless result.nil?\n\n # fall back on yaml file if no object is found in db\n keys = I18n.normalize_keys(locale, key, scope, options[:separator])\n keys.inject(translations) do |result, _key|\n return nil unless result.is_a?(Hash) && result.has_key?(_key)\n result = result[_key]\n result = resolve(locale, _key, result, options.merge(:scope => nil)) if result.is_a?(Symbol)\n result = options[:default] if options[:default] && result.nil?\n result\n end\n \n end", "def scope\n return !@scopes.empty? ? @scopes[-1] : @storage[:scope]\n end", "def translation_scope\n matcher = /(?<path>.*)\\/_?(?<view>[^\\/.]+)(?<extension>\\.html\\.haml)?/\n info = matcher.match(@virtual_path)\n\n if info\n path = info[:path].gsub('/', '.')\n \"views.#{path}.#{info[:view]}\"\n else\n \"views.#{params[:controller]}.#{params[:action]}\"\n end\n end", "def resolved_scope(scope)\n scoper_object(scope).resolve\n end", "def scope\n @scope ||= \"study.#{app_name}\"\n end", "def get_class_from_scope(scope, name)\n klass = scope\n name = name.to_s.sub(%r{^Backup::Config::DSL::}, \"\")\n name.split(\"::\").each do |chunk|\n klass = klass.const_get(chunk)\n end\n klass\n end", "def context_scope\n defined?(@_scope) ? @_scope : nil\n end", "def scoped_variables_for_translations\n @scoped_variables_for_translations ||= {\n :default => '',\n :scope => controller_action_scope }.freeze # frozen to force use of dup, otherwise wrong vars get sent to i18n\n end", "def scope\n finder_or_run(:scope)\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 scope(method, key = nil) #:nodoc:\n if current_scoped_methods && (scope = current_scoped_methods[method])\n key ? scope[key] : scope\n end\n end", "def find_scope!(obj); end", "def enum_i18n(class_name, enum, key)\n I18n.t(\"activerecord.attributes.#{class_name.model_name.i18n_key}.#{enum.to_s.pluralize}.#{key}\")\n end", "def scope\n @scope.dup\n end", "def scope\n @options[:scope]\n end", "def i18n(locale)\n selected_locale = self.i18ns.select{|i18n| i18n.locale_id == locale.id }\n return selected_locale.first if selected_locale.any?\n\n self.i18ns.first\n end", "def find_message(kind, options = {})\n options[:scope] ||= translation_scope\n I18n.t(kind, **options)\n end", "def current_scope\n if ss = method.staticscope\n return ss.module\n else\n home.current_scope\n end\n end", "def privacy_scope\r\n\t\t\tif @privacy_scope.nil?\r\n\t\t\t\t@privacy_scope = privacy_owner.get_privacy_scope(self.class.privacy_rule_name, privacy_object_id)\r\n\t\t\tend\r\n\t\t\treturn @privacy_scope\r\n\t\tend", "def scope(scope_name, scope_enum_keys)\n target_enum = @record_class.defined_enums[@enum_name.to_s]\n sub_enum_values = target_enum.values_at(*scope_enum_keys)\n\n if @record_class.defined_enum_scopes.has_key?(scope_name)\n fail ArgumentError,\n \"Conflicting scope names. A scope named #{scope_name} has already been defined\"\n elsif sub_enum_values.include?(nil)\n unknown_key = scope_enum_keys[sub_enum_values.index(nil)]\n fail ArgumentError, \"Unknown key - #{unknown_key} for enum #{@enum_name}\"\n elsif @record_class.respond_to?(scope_name.to_s.pluralize)\n fail ArgumentError,\n \"Scope name - #{scope_name} conflicts with a class method of the same name\"\n elsif @record_class.instance_methods.include?(\"#{scope_name}?\".to_sym)\n fail ArgumentError,\n \"Scope name - #{scope_name} conflicts with the instance method - #{scope_name}?\"\n end\n\n sub_enum_entries = target_enum.slice(*scope_enum_keys)\n @record_class.defined_enum_scopes[scope_name] = sub_enum_entries\n\n # 1. Instance method <scope_name>?\n @record_class.send(:define_method, \"#{scope_name}?\") { sub_enum_entries.include? self.role }\n\n # 2. The class scope with the scope name\n @record_class.scope scope_name.to_s.pluralize,\n -> { @record_class.where(\"#{@enum_name}\" => sub_enum_entries.values) }\n\n @scope_names << scope_name\n end", "def define_scopes(custom_plural = T.unsafe(nil)); end", "def scope\n\t\treturn @scopes.last\n\tend", "def scope\n self.slug.scope\n end", "def stradivari_scopes\n @_stradivari_scopes ||= {}\n end", "def lookup(locale, key, scope = [], options = {})\r\n return '' if translations_blocked\r\n\r\n if ::LinguaFranca.debugging? && available_locales.include?(::LinguaFranca.debugging)\r\n locale = ::LinguaFranca.debugging\r\n end\r\n\r\n result = super(locale, key, scope, options)\r\n\r\n key = key_name(key, scope)\r\n\r\n return result\r\n end", "def app_scope\n return @app_scope\n end", "def scopes\n @@scopes ||= {}\n end", "def node_update_i18n_scope\n if resource.renderable\n :\"admin.nodes.#{resource.renderable.class.model_name.collection}\"\n end\n end", "def scope\n if @scope.kind_of? String\n @scope = @scope.split \",\"\n else\n @scope || []\n end\n end", "def list_scope(field)\n scope_field = self.class.mongoid_list_fields[field][:scope]\n scope_field ? self.class.where(scope_field => self[scope_field]) : self.class.all\n end", "def computed_visibility_class\n I18n.t(\"computed_visibility.#{computed_visibility}.class\")\n end", "def computed_visibility_class\n I18n.t(\"computed_visibility.#{computed_visibility}.class\")\n end", "def scoped_variables_for_translations\n @scoped_variables_for_translations ||= super.dup.merge({\n preferred_common_name: @preferred_common_name.presence,\n scientific_name: @scientific_name.presence,\n hierarchy_provider: @taxon_page.hierarchy_provider,\n }).freeze\n end", "def scope_names\n keys.map { |k| k.to_s }\n end", "def scrub_for_scope(name)\n if respond_to? :added_scrubber\n name = added_scrubber(name)\n end\n\n TextHelper.pluralize(name.downcase)\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 enclosing_resource_name\n enclosing_resource.class.name.underscore\n end", "def named_tag_scope\r\n NamedTagScopeController.instance\r\n end" ]
[ "0.81534255", "0.81534255", "0.74639636", "0.7434711", "0.64501226", "0.64040077", "0.64011437", "0.6308559", "0.6280304", "0.6013249", "0.594106", "0.5931121", "0.5868417", "0.5866702", "0.5815899", "0.5815899", "0.580037", "0.580037", "0.580037", "0.580037", "0.580037", "0.580037", "0.5793413", "0.5785498", "0.5771264", "0.5720149", "0.5712821", "0.56723344", "0.5654409", "0.5623279", "0.56143713", "0.56143713", "0.560589", "0.560467", "0.5588149", "0.5571781", "0.5519999", "0.55081254", "0.55046964", "0.55007654", "0.54668534", "0.5458552", "0.54494154", "0.54491323", "0.5447336", "0.5442214", "0.54245853", "0.5421116", "0.54166156", "0.5413018", "0.5392134", "0.53783876", "0.53706044", "0.534356", "0.53323525", "0.5317017", "0.53025496", "0.52976", "0.5289211", "0.5286735", "0.52230716", "0.52207184", "0.52106243", "0.5209472", "0.5202555", "0.5180698", "0.5179099", "0.516188", "0.51418656", "0.51408666", "0.51332676", "0.5127614", "0.5126863", "0.51234484", "0.5122578", "0.51098484", "0.51005954", "0.508923", "0.508438", "0.5049832", "0.50342256", "0.50031006", "0.4996786", "0.4990526", "0.49880973", "0.49847752", "0.49847263", "0.49813625", "0.49566838", "0.49458453", "0.49450126", "0.49450126", "0.49359", "0.49304157", "0.49295977", "0.49295476", "0.49232692", "0.49226454" ]
0.5757508
27
Transforms attributes names into a more human format, such as "First name" instead of "first_name". Example: Person.human_attribute_name("first_name") => "First name" Specify +options+ with additional translating options.
def human_attribute_name(attribute, options = {}) defaults = lookup_ancestors.map do |klass| :"#{klass.model_name.underscore}.#{attribute}" end defaults << options.delete(:default) if options[:default] defaults << attribute.to_s.humanize options.reverse_merge! :scope => [self.i18n_scope, :attributes], :count => 1, :default => defaults I18n.translate(defaults.shift, options) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def human_attribute_name(attribute, options={})\n attribute = Ldaptic.encode(attribute)\n if at = namespace.attribute_type(attribute)\n attribute = at.verbose_name\n end\n attribute = attribute[0..0].upcase + attribute[1..-1]\n attribute.gsub!(/([A-Z])([A-Z][a-z])/) { \"#$1 #{$2.downcase}\" }\n attribute.gsub!(/([a-z\\d])([A-Z])/) { \"#$1 #{$2.downcase}\" }\n attribute.gsub!(/\\b[a-z][A-Z]/) { $&.upcase }\n attribute.gsub!('_', '-')\n attribute\n end", "def human_attribute_name(attribute, options = {})\n attribute = attribute.to_s\n\n if attribute.include?(\".\")\n namespace, _, attribute = attribute.rpartition(\".\")\n namespace.tr!(\".\", \"/\")\n\n defaults = lookup_ancestors.map do |klass|\n :\"#{i18n_scope}.attributes.#{klass.model_name.i18n_key}/#{namespace}.#{attribute}\"\n end\n defaults << :\"#{i18n_scope}.attributes.#{namespace}.#{attribute}\"\n else\n defaults = lookup_ancestors.map do |klass|\n :\"#{i18n_scope}.attributes.#{klass.model_name.i18n_key}.#{attribute}\"\n end\n end\n\n defaults << :\"attributes.#{attribute}\"\n defaults << options[:default] if options[:default]\n defaults << MISSING_TRANSLATION\n\n translation = I18n.translate(defaults.shift, count: 1, **options, default: defaults)\n translation = attribute.humanize if translation == MISSING_TRANSLATION\n translation\n end", "def human_name\n Base.human_attribute_name(@name)\n end", "def human_name(attribute_name)\n self.class.human_attribute_name(attribute_name)\n end", "def humanize_attribute(resource, attribute, options = {})\n\n # Get human attribute name if possible or use the string representation\n string = (get_resource_class resource).human_attribute_name(attribute) rescue attribute.to_s\n\n # Return the humanized representation\n apply_human_options string, options\n end", "def human_attribute_name(attribute, options = {})\n options = { count: 1 }.merge!(options)\n parts = attribute.to_s.split(\".\")\n attribute = parts.pop\n namespace = parts.join(\"/\") unless parts.empty?\n attributes_scope = \"#{i18n_scope}.attributes\"\n\n if namespace\n defaults = lookup_ancestors.map do |klass|\n :\"#{attributes_scope}.#{klass.model_name.i18n_key}/#{namespace}.#{attribute}\"\n end\n defaults << :\"#{attributes_scope}.#{namespace}.#{attribute}\"\n else\n defaults = lookup_ancestors.map do |klass|\n :\"#{attributes_scope}.#{klass.model_name.i18n_key}.#{attribute}\"\n end\n end\n\n defaults << :\"attributes.#{attribute}\"\n defaults << options.delete(:default) if options[:default]\n defaults << attribute.humanize\n\n options[:default] = defaults\n I18n.translate(defaults.shift, options)\n end", "def human_attribute_name(field_name, options={})\n \"\"\n end", "def human_attribute_name(attribute_key_name, options = {})\n defaults = self_and_descendants_from_active_resource.map do |klass|\n :\"#{klass.name.underscore}.#{attribute_key_name}\"\n end\n defaults << options[:default] if options[:default]\n defaults.flatten!\n defaults << attribute_key_name.to_s.humanize\n options[:count] ||= 1\n I18n.translate(defaults.shift, options.merge(:default => defaults, :scope => [:activeresource, :attributes]))\n end", "def human_attribute_name(attribute_key_name) #:nodoc:\n attribute_key_name.humanize\n end", "def human_attribute_name(attribute, options = {})\n options[:default] || attribute.to_s.split('.').last\n end", "def humanize(symbol)\n human_attr = symbol.to_s.split('_').map(&:capitalize).join(' ')\n end", "def human_attribute_name(attribute_key_name)\n attribute_key_name.gsub(/_/, \" \").capitalize unless attribute_key_name.nil?\n end", "def human_attribute(object, attribute)\n object.class.human_attribute_name(attribute)\n end", "def human_attribute(object, attribute)\n object.class.human_attribute_name(attribute)\n end", "def format_attribute_name name\n return name if name !~ /_/ && name =~ /[A-Z]+.*/\n name.split('_').map{ |e| e.capitalize }.join \n end", "def attribute_titles\n attribute_names.map {|f| f.to_s.capitalize.sub(/$/, \":\").gsub(/_/, \" \") }\n end", "def humanize(string)\n attribute = string.tr(\".\", \"_\")\n if attribute.respond_to?(:humanize)\n attribute.humanize\n else\n attribute.tr(\"_\", \" \").capitalize\n end\n end", "def humanize(options = {})\n result = self.dup\n\n #inflections.humans.each { |(rule, replacement)| break if result.sub!(rule, replacement) }\n\n result.sub!(/\\A_+/, '')\n result.sub!(/_id\\z/, '')\n result.tr!('_', ' ')\n\n #result.gsub!(/([a-z\\d]*)/i) do |match|\n # \"#{inflections.acronyms[match] || match.downcase}\"\n #end\n\n if options.fetch(:capitalize, true)\n result.sub!(/\\A\\w/) { |match| match.upcase }\n end\n\n result\n end", "def attribute_names(normalize=false)\n ensure_apply_object_class\n names = @attr_methods.keys\n if normalize\n names.collect do |name|\n to_real_attribute_name(name)\n end.uniq\n else\n names\n end\n end", "def resource_attribute_human_name_for(attribute_name)\n attribute_name = attribute_name.to_s\n I18n.t(\"activerecord.attributes.#{resource_name}.#{attribute_name}\",\n default: attribute_name.humanize)\n end", "def human_name_for(instance, method)\n I18n.t(\"activerecord.attributes.#{instance}.#{method}\", :default => method.to_s.humanize)\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 human(key, options={})\n return if key.nil? # otherwise, key.to_s.humanize will return \"\"\n # Mimics ActiveModel::Translation.human_attribute_name\n defaults = @klass.lookup_ancestors.map do |klass|\n :\"#{@klass.i18n_scope}.active_flag.#{klass.model_name.i18n_key}.#{@column}.#{key}\"\n end\n defaults << :\"active_flag.#{@klass.model_name.i18n_key}.#{@column}.#{key}\"\n defaults << :\"active_flag.#{@column}.#{key}\"\n defaults << options.delete(:default) if options[:default]\n defaults << key.to_s.humanize\n I18n.translate defaults.shift, **options.reverse_merge(count: 1, default: defaults)\n end", "def human_name(*args)\n ActiveSupport::Deprecation.warn(\"human_name has been deprecated, please use model_name.human instead\", caller[0,1])\n model_name.human(*args)\n end", "def name\n @custom_name || @attribute.to_s.humanize\n end", "def class_name_to_attribute_name(name)\r\n name.gsub(/([a-z]+)([A-Z])/, '\\1_\\2').gsub('-', '_').downcase\r\n end", "def class_name_to_attribute_name(name)\r\n name.gsub(/([a-z]+)([A-Z])/, '\\1_\\2').gsub('-', '_').downcase\r\n end", "def class_name_to_attribute_name(name)\n name.gsub(/([a-z]+)([A-Z])/, '\\1_\\2').gsub('-', '_').downcase\n end", "def class_name_to_attribute_name(name)\n name.gsub(/([a-z]+)([A-Z])/, '\\1_\\2').gsub('-', '_').downcase\n end", "def normalize_attributes\n self.first_name = self.first_name.downcase.titleize\n self.last_name = self.last_name.downcase.titleize\n self.email.downcase!\n end", "def human_to_name; end", "def human_name(options = {})\n defaults = self_and_descendants_from_active_resource.map {|klass| :\"#{klass.name.underscore}\" }\n defaults << self.name.humanize\n I18n.translate(defaults.shift, {:scope => [:activeresource, :models], :count => 1, :default => defaults}.merge(options))\n end", "def apply_human_options(string, options = {})\n\n # Ensure to process an string\n unless string.is_a? String\n string = string.to_s\n end\n\n # Humanize unless is not required\n unless options[:humanize] === false\n string = string.humanize\n end\n\n if options[:capitalize]\n string = string.capitalize\n end\n\n if options[:titleize]\n string = string.titleize\n end\n\n if options[:downcase]\n string = string.downcase\n end\n\n if options[:upcase]\n string = string.upcase\n end\n\n if options[:pluralize]\n string = string.pluralize\n end\n\n # Return the humanized string\n string\n end", "def field_human_name(field)\n I18n.translate(\"#{model_name}.attributes.#{field}\", :count => 1, :default => Inflections.humanize(field), :scope => :models)\n end", "def name\n read_attribute(:name).try(:titleize)\n end", "def format_name(attribute_name)\n attribute_name.to_s\n end", "def convert_attribute_name name\n ATTRIBUTE_NAME_MAPPING[name] || name\n end", "def canonical_name_attr(attr = nil)\n if attr\n @canonical_name_attr = attr.to_sym\n else\n @canonical_name_attr || CANONICAL_NAME_ATTR\n end\n end", "def human_name\n name.capitalize.to_s\n end", "def attribute_field_name(attr)\n attr.to_s.camelize(:lower)\n end", "def input(attribute_name, options = {}, &block)\n options = options.dup\n\n options[:error_prefix] ||=\n if object.class.respond_to?(:human_attribute_name)\n object.class.human_attribute_name(attribute_name.to_s)\n else\n attribute_name.to_s.humanize\n end\n\n input_without_error_prefix(attribute_name, options, &block)\n end", "def human_value(attribute_name)\n value = send(attribute_name)\n self.class.human_attribute_value attribute_name, value\n end", "def name!(attributes)\n hash = attributes.clone\n\n [:role, :order].each do |k|\n hash.delete(k)\n end\n\n if hash[:first].length == 1\n hash[:first] = \"#{hash[:first]}.\"\n end\n\n if hash[:middle]\n hash[:middle] = \"#{hash[:middle][0,1].upcase}.\"\n end\n\n if @order == :last || hash[:suffix]\n hash[:last] = \"#{hash[:last]},\"\n end\n\n if @order == :last && hash[:middle]\n hash[:middle] = \"#{hash[:middle]},\"\n end\n\n hash.values.compact.reject(&:empty?).join(' ').squish\n end", "def humanize(capitalize: true, keep_id_suffix: false)\n ActiveSupport::Inflector.humanize(self, capitalize: capitalize, keep_id_suffix: keep_id_suffix)\n end", "def sanitize_attribute_name(name)\n name.gsub(/[^\\w\\-_]/, '').downcase\n end", "def human_from_name; end", "def normalize_attributes\n self.title = self.title.downcase.titleize\n self.brand = self.brand.downcase.titleize\n end", "def attribute_names\r\n translated_attribute_names.map(&:to_s) + @attributes.keys.sort\r\n end", "def human_name\n @human_name ||= self.to_s.demodulize.titleize\n end", "def format_attributes\n self.email = self.email.downcase\n self.first_name = self.first_name.titleize\n self.last_name = self.last_name.titleize\n self.full_name = \"#{self.first_name} #{self.last_name}\"\n end", "def normalize_options\n copy_options_to_attributes(ATTRIBUTE_OPTIONS)\n copy_boolean_options_to_attributes(ATTRIBUTE_BOOLEAN_OPTIONS)\n handle_key_option\n handle_errors_option\n\n Forme.attr_classes(@attr, @opts[:class]) if @opts.has_key?(:class)\n\n if @opts[:error]\n Forme.attr_classes(@attr, 'error')\n @attr[\"aria-invalid\"] = \"true\"\n if @opts.fetch(:error_handler, true)\n if @opts[:error_id]\n @attr['aria-describedby'] ||= @opts[:error_id]\n else\n if id = @attr[:id] || @attr['id']\n error_id = @attr['aria-describedby'] ||= \"#{id}_error_message\"\n @opts[:error_id] = error_id\n end\n end\n end\n end\n\n if data = opts[:data]\n data.each do |k, v|\n k = k.to_s.tr(\"_\", \"-\") if k.is_a?(Symbol) && input.opts[:dasherize_data]\n sym = :\"data-#{k}\"\n @attr[sym] = v unless @attr.has_key?(sym)\n end\n end\n end", "def normalize_attribute(name, value)\n if name.nil?\n raise RuntimeError, _('The first argument, name, must not be nil. ' \\\n 'Please report this as a bug!')\n end\n\n name = normalize_attribute_name(name)\n rubyish_class_name = Inflector.underscore(value.class.name)\n handler = \"normalize_attribute_value_of_#{rubyish_class_name}\"\n if respond_to?(handler, true)\n [name, send(handler, name, value)]\n else\n [name, [value.to_s]]\n end\n end", "def humanize(normalized)\n\t\t\t\tnormalized.to_s\n\t\t\tend", "def normalize_name(name)\n CapitalizeNames.capitalize(name)\n end", "def humanize\n MotionSupport::Inflector.humanize(self)\n end", "def generate_names(name, options={})\n name = name.to_s\n effective_names = [name]\n effective_names += [\"#{name}A\", \"#{name}W\"] unless name =~ /[WA]$/\n aliases = ([options[:alias]] + [options[:aliases]]).flatten.compact\n snake_name = options[:snake_name] || snake_case(name)\n camel_name = options[:camel_name] || camel_case(name)\n case snake_name\n when /^is_/\n aliases << snake_name.sub(/^is_/, '') + '?'\n when /^set_/\n aliases << snake_name.sub(/^set_/, '')+ '='\n when /^get_/\n aliases << snake_name.sub(/^get_/, '')\n end\n [snake_name, camel_name, effective_names, aliases]\nend", "def human_name\n Helpers.underscore(@name)\n end", "def test_column_human_name\n assert_equal @attribute_names[:name], Address.columns.find{|c| c.name == 'name'}.human_name\n end", "def humanize(lower_case_and_underscored_word, options = {})\n Geode::FastInflector.humanize(lower_case_and_underscored_word, options.fetch(:capitalize, true))\n end", "def label_from_attribute(attribute)\n attribute.to_s.humanize\n end", "def humanize_model(resource, options = {})\n\n # Get humanized model name or use resource string representation\n string = (get_resource_class resource).model_name.human rescue resource.to_s\n\n # Apply human options to resulting string\n apply_human_options string, options\n end", "def humanize\n # TODO\n # Inflector.humanize(self)\n end", "def t_attr(attribute, model = nil)\n model ||= controller_name.classify.constantize\n model.human_attribute_name(attribute)\n end", "def human_name(*args)\n I18n.t(\"models.#{name.underscore}\", {:count => 1, :default => name.humanize})\n end", "def attributes\n super.map { |k, v| [ k.to_s.camelize(:lower).to_sym, v ] }.to_h\n end", "def correct_abbreviations_attributes; end", "def titleize_name\r\n self.name = name.titleize\r\n end", "def downcase_attributes\n ea = ''\n attr_list = []\n\n if self.class.respond_to?(:no_downcase_attributes) && self.class.no_downcase_attributes\n attr_list += self.class.no_downcase_attributes\n end\n\n attr_list += no_downcase_attributes if respond_to?(:no_downcase_attributes) && no_downcase_attributes\n\n attr_list.each do |e|\n ea += \"(#{e})?\"\n end\n\n ignore =\n /(item_type)?(notes)?(description)?(message)?(.+_notes)?(.+_description)?(.+_details)?(e_signed_document)?#{ea}/\n\n attributes.select { |k, _v| k.to_sym.in? self.class.permitted_params }\n .reject { |k, _v| k && k.match(ignore)[0].present? }\n .each do |k, v|\n send(\"#{k}=\".to_sym, v.downcase) if attributes[k].is_a? String\n end\n true\n end", "def attribute_parse_naming\n OBJ_ATTRIBUTE_PARSE_NAMING\n end", "def inspect\n inspected_attributes = attribute_names.sort\n attributes_list = \"(#{inspected_attributes.join(\", \")})\" unless inspected_attributes.empty?\n \"#{name}#{attributes_list}\"\n end", "def anchored_attribute(attribute, options = {})\n resource = object.class.name.demodulize.underscore\n anchor_name = [resource, attribute.tr(' ', '_')].join('.').downcase\n anchor_and_label_markup(anchor_name, nil, options)\n end", "def sanitize_attributes\n self.name = \"#{self.name}\".strip\n end", "def to_s\n human_name\n end", "def human_name(*args)\n #defined by default_for_arg_type in initialize!\n end", "def get_object_name attr_name\n return attr_name.capitalize if @@object_attribute.include?(attr_name)\n # return attr_name.capitalize if @object_attribute.include?(attr_name)\n attr_name = attr_name.to_s\n if attr_name.include? '_'\n if attr_name[-2, 2] == 'es' and attr_name != 'tour_dates'\n attr_name.split('_')[0].capitalize + attr_name.split('_')[1][0...-2].capitalize\n else\n attr_name.split('_')[0].capitalize + attr_name.split('_')[1][0...-1].capitalize\n end\n elsif attr_name == 'addresses'\n attr_name[0...-2].capitalize\n else\n attr_name[0...-1].capitalize\n end\n end", "def human_name\n cn = name\n\n if respond_to?(:is_dynamic_model) && is_dynamic_model || respond_to?(:is_activity_log) && is_activity_log\n cn = cn.split('::').last\n end\n\n cn.underscore.humanize.captionize\n end", "def cap_names\n self[:first_name].capitalize if self[:first_name] != nil\n self[:last_name].capitalize if self[:last_name] != nil\n end", "def t(column)\n object.class.human_attribute_name(column.to_sym)\n end", "def titleize_names\n self.first_name = self.first_name.titleize\n self.last_name = self.last_name.titleize\n end", "def attribute(name, options={:strip => true, :null_if_blank => true})\n\t\t\treturn @attributes[name.to_sym] if @attributes && @attributes[name.to_sym]\n\t\t\treturn nil unless @node.attribute(name)\n\t\t\t@attributes = {} unless @attributes\n\t\t\t@attributes[name] = @node.attribute(name).evaluate(@node, :attrs => true).to_s\n\t\t\t@attributes[name].strip! if options[:strip]\n\t\t\t@attributes[name] = nil if @attributes[name].blank? && options[:null_if_blank]\n\t\t\t@attributes[name]\n\t\tend", "def translation_for(field)\n object.class.human_attribute_name(field)\n end", "def humanize\n self.downcase.gsub(/_/, \" \").capitalize\n end", "def to_human\n encoded_name = super\n decode_name(encoded_name)\n end", "def get_name_column(options) #:nodoc:\n if options.has_key?(:name_column) && !options[:name_column].blank? then\n options[:name_column].to_s.to_sym\n else\n :name\n end\n end", "def human_name\n @name.is_a?(Symbol) ? I18n.t(\"backend.menus.#{@name}\", :default => @name.to_s.humanize) : @name\n end", "def human_name\n @name.is_a?(Symbol) ? I18n.t(\"backend.menus.#{@name}\", :default => @name.to_s.humanize) : @name\n end", "def normalize(name); end", "def define_attribute_methods(attr)\n name = attr.name\n return if @attr_methods.has_key?(name)\n ([name] + attr.aliases).each do |ali|\n @attr_methods[ali] = name\n @attr_aliases[Inflector.underscore(ali)] = name\n @normalized_attr_names[normalize_attribute_name(ali)] = name\n end\n end", "def translate_attributes\n info = {}\n translate.each do |attribute_name, label|\n info[label] = send(attribute_name)\n end\n info\n end", "def display_name(attr)\n attr.name unless attr.nil?\n end", "def name_format\n self.name.gsub!(/[^0-9a-z\\-_ ]/i, '_') unless self.name.nil?\n self.name.gsub!(/\\s+/, '-') unless self.name.nil?\n self.name = self.name.downcase unless self.name.nil?\n end", "def name_format\n self.name.gsub!(/[^0-9a-z\\-_ ]/i, '_') unless self.name.nil?\n self.name.gsub!(/\\s+/, '-') unless self.name.nil?\n self.name = self.name.downcase unless self.name.nil?\n end", "def normalize_attributes\n self.address.downcase!\n self.state.upcase!\n self.city = self.city.downcase.titleize\n self.country = self.country.downcase.titleize\n end", "def normalized_str(attribute)\n normalized(attribute).join(\"; \")\n end", "def validated_attribute_names(params); end", "def phony_normalized_method(*attributes)\n main_options = attributes.last.is_a?(Hash) ? attributes.pop : {}\n main_options.assert_valid_keys :country_code, :default_country_code\n attributes.each do |attribute|\n raise(StandardError, \"Instance method normalized_#{attribute} already exists on #{name} (PhonyRails)\") if method_defined?(:\"normalized_#{attribute}\")\n\n define_method :\"normalized_#{attribute}\" do |*args|\n options = main_options.merge(args.first || {})\n assign_values_for_phony_symbol_options(options)\n raise(ArgumentError, \"No attribute/method #{attribute} found on #{self.class.name} (PhonyRails)\") unless respond_to?(attribute)\n\n options[:country_code] ||= country_code if respond_to?(:country_code)\n PhonyRails.normalize_number(send(attribute), options)\n end\n end\n end", "def name_pretty\n to_s.underscore.split(\"_\").map(&:capitalize).join(\" \")\n end", "def titleize_name\n self.name = self.name.titleize unless self.name.blank?\n end", "def test_direct_base_call\n assert_nil ActiveRecord::Base.localized_model_name\n assert_not_equal @attribute_names[:name], ActiveRecord::Base.human_attribute_name('name')\n assert_equal 'name'.humanize, ActiveRecord::Base.human_attribute_name('name')\n end", "def namify\n self.name.split(\" \").map{|x| x.first.capitalize}[0..1].join(\"\")\n end" ]
[ "0.76447475", "0.73518664", "0.70934385", "0.70898396", "0.70388824", "0.69810474", "0.67747957", "0.66921955", "0.6665899", "0.66610175", "0.6651572", "0.65408146", "0.6479377", "0.6479377", "0.6453617", "0.64374626", "0.6425629", "0.6266602", "0.6254121", "0.620868", "0.618907", "0.61753744", "0.6079008", "0.60537654", "0.60340387", "0.59937096", "0.59937096", "0.59904385", "0.59904385", "0.5971614", "0.59619707", "0.5961859", "0.595524", "0.5936016", "0.5933587", "0.59223956", "0.59145445", "0.5912924", "0.5907656", "0.5888159", "0.5872756", "0.5863421", "0.5843596", "0.58128047", "0.5762193", "0.57507676", "0.570195", "0.57007486", "0.5668032", "0.5666503", "0.5660153", "0.56590354", "0.56550914", "0.5642719", "0.563128", "0.56290454", "0.5611355", "0.5594655", "0.55936146", "0.55916244", "0.55638987", "0.5555838", "0.55515337", "0.55174965", "0.5513033", "0.5505607", "0.55045164", "0.550164", "0.547092", "0.5467927", "0.54603523", "0.54575115", "0.54343295", "0.542938", "0.542889", "0.54187286", "0.5402349", "0.5392996", "0.5382401", "0.5381187", "0.5365352", "0.53598446", "0.5355327", "0.53454596", "0.53394043", "0.53394043", "0.5332588", "0.53314656", "0.5326953", "0.53124017", "0.53020203", "0.53015345", "0.52936494", "0.5291715", "0.5281912", "0.5264446", "0.5242421", "0.5240902", "0.5240454", "0.5240384" ]
0.71905017
2
Model.human_name is deprecated. Use Model.model_name.human instead.
def human_name(*args) ActiveSupport::Deprecation.warn("human_name has been deprecated, please use model_name.human instead", caller[0,1]) model_name.human(*args) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def human_model_name\n model_name.humanize\n end", "def human_model_name\n model_name.humanize\n end", "def human_model name=nil, pluralize=false\n s = model(name).human_name\n s = s.pluralize if pluralize && pluralize != 1\n s\n end", "def human_model_name(object)\n if object.class.respond_to?(:human)\n object.class.human\n elsif object.class.respond_to?(:human_name)\n object.class.human_name\n else\n t(\"models.#{object.class.to_s.underscore}\", :default => object.class.to_s.humanize)\n end\n end", "def human_name\n @human_name ||= self.to_s.demodulize.titleize\n end", "def human_name(*args)\n I18n.t(\"models.#{name.underscore}\", {:count => 1, :default => name.humanize})\n end", "def human_name\n cn = name\n\n if respond_to?(:is_dynamic_model) && is_dynamic_model || respond_to?(:is_activity_log) && is_activity_log\n cn = cn.split('::').last\n end\n\n cn.underscore.humanize.captionize\n end", "def human_name\n name.capitalize.to_s\n end", "def entity_name_for_human\r\n self.class.name.titleize\r\n end", "def human_to_name; end", "def field_human_name(field)\n I18n.translate(\"#{model_name}.attributes.#{field}\", :count => 1, :default => Inflections.humanize(field), :scope => :models)\n end", "def model_title\n model_name.titleize\n end", "def humanize(capitalize: true, keep_id_suffix: false)\n ActiveSupport::Inflector.humanize(self, capitalize: capitalize, keep_id_suffix: keep_id_suffix)\n end", "def t_model(record, pluralize=true, downcase=false)\n options = { }\n\n options[:count] = 2 if pluralize\n\n string = record.model_name.human options\n string = string.downcase if downcase\n string\n end", "def humanize\n MotionSupport::Inflector.humanize(self)\n end", "def test_model_naming\n assert model.class.respond_to?(:model_name), \"The model should respond to model_name\"\n model_name = model.class.model_name\n assert model_name.respond_to?(:to_str)\n assert model_name.human.respond_to?(:to_str)\n assert model_name.singular.respond_to?(:to_str)\n assert model_name.plural.respond_to?(:to_str)\n end", "def human_name\n Base.human_attribute_name(@name)\n end", "def human_from_name; end", "def to_s\n human_name\n end", "def display_name\n\t\tself.name.titleize\n\tend", "def humanize_model(resource, options = {})\n\n # Get humanized model name or use resource string representation\n string = (get_resource_class resource).model_name.human rescue resource.to_s\n\n # Apply human options to resulting string\n apply_human_options string, options\n end", "def humanize\n # TODO\n # Inflector.humanize(self)\n end", "def human_name\n Helpers.underscore(@name)\n end", "def resource_human_name\n resource_class.model_name.human\n end", "def title\n model.name.titleize\n end", "def friendly_name\n self.class.model_name.split(\"::\").join(\" \")\n end", "def to_s\n self.name.humanize\n end", "def human_name(options = {})\n defaults = self_and_descendants_from_active_resource.map {|klass| :\"#{klass.name.underscore}\" }\n defaults << self.name.humanize\n I18n.translate(defaults.shift, {:scope => [:activeresource, :models], :count => 1, :default => defaults}.merge(options))\n end", "def model_display_name(str)\n names = {\n 'association_note' => Note.model_name.human,\n 'description' => Description.model_name.human,\n 'feature' => Feature.model_name.human,\n 'feature_geo_code' => FeatureGeoCode.model_name.human,\n 'feature_name' => FeatureName.model_name.human,\n 'time_unit' => 'date'\n }\n names[str].nil? ? str : names[str]\n end", "def i18n_mn(resource, options = {})\n model_class(resource).model_name.human options\n end", "def human_name\n if respond_to?(:rec_type) && rec_type\n rec_type.underscore.humanize.captionize\n else\n self.class.human_name\n end\n end", "def human_name\n if respond_to?(:rec_type) && rec_type\n rec_type.underscore.humanize.captionize\n else\n self.class.human_name\n end\n end", "def human_name_for(instance, method)\n I18n.t(\"activerecord.attributes.#{instance}.#{method}\", :default => method.to_s.humanize)\n end", "def t_model(model = nil)\n return model.model_name.human if model.is_a? ActiveModel::Naming\n return model.class.model_name.human if model.class.is_a? ActiveModel::Naming\n model_key = if model.is_a? Class\n model.name.underscore\n elsif model.nil?\n controller_name.singularize\n else\n model.class.name.underscore\n end\n I18n.t(\"activerecord.models.#{model_key}\")\n end", "def model_display_name(str)\n names = {\n 'association_note' => Note.model_name.human,\n 'description' => Description.model_name.human,\n 'feature' => Feature.model_name.human,\n 'feature_geo_code' => FeatureGeoCode.model_name.human,\n 'feature_name' => FeatureName.model_name.human,\n 'feature_object_type' => 'feature_type',\n 'shape' => Shape.model_name.human,\n 'time_unit' => 'date',\n 'category_feature' => Topic.human_name #'kmap_characteristic'\n }\n names[str].nil? ? str : names[str]\n end", "def name\n model_name\n end", "def name\n model_name\n end", "def model_name\n return unless item\n\n @model_name ||= item.model_name.human.downcase\n end", "def human_name\n @name.is_a?(Symbol) ? I18n.t(\"backend.menus.#{@name}\", :default => @name.to_s.humanize) : @name\n end", "def human_name\n @name.is_a?(Symbol) ? I18n.t(\"backend.menus.#{@name}\", :default => @name.to_s.humanize) : @name\n end", "def record_name\n model.to_s.downcase\n end", "def display_name\n read_attribute(:title).humanize\n end", "def t_model(model = nil, pluralize: false)\n logger.info(\"model: #{model.inspect}\")\n return model.model_name.human if model.is_a? ActiveModel::Naming\n return model.class.model_name.human if model.class.is_a? ActiveModel::Naming\n\n model_key = if model.is_a? Class\n model.name.underscore\n elsif model.nil?\n controller_name.singularize\n else\n model.class.name.underscore\n end\n count = pluralize ? 2 : 1\n I18n.t(\"activerecord.models.#{model_key}\", count: count)\n end", "def friendly_name_pluralized\n @friendly_name_pluralized ||= self.name.humanize.pluralize\n end", "def humanise_identifier(model)\n klass = model.constantize\n klass.human_attribute_name identifier(model)\n end", "def model_name(model)\n model.class.to_s.downcase\n end", "def display_name\n @name.titlecase\n end", "def to_s\n self.name.capitalize\n end", "def humanize(str)\n ActiveSupport::Inflector.humanize(str)\n end", "def human_name(attribute_name)\n self.class.human_attribute_name(attribute_name)\n end", "def clean_name\n ActiveSupport::Inflector.transliterate self.name\n end", "def pretty_name\n super || name.humanize\n end", "def model_name\n model.name\n end", "def name\n super.to_s.titleize\n end", "def model_display_name(str)\n names = {\n 'association_note' => 'note',\n 'description' => 'essay',\n 'feature_geo_code' => 'geo_code',\n 'feature_name' => 'name',\n 'feature_object_type' => 'feature_type',\n 'shape' => 'location',\n 'time_unit' => 'date',\n 'category_feature' => Topic.human_name #'kmap_characteristic'\n }\n names[str].nil? ? str : names[str]\n end", "def belongs_to_name(model)\n model.attributes['name'] || \"#{model.class.name.humanize.titleize} ##{model.id}\"\n end", "def display_name\n name\n end", "def display_name\n name\n end", "def display_name\n name\n end", "def human_name\n I18n.t(@name, :scope => [:role], :default => @name.to_s.humanize)\n end", "def model_name_or_title(model)\n model.respond_to?('title') ? model.title : model.name\n end", "def model_name\n described_class.to_s.underscore\nend", "def model_name_or_title(model)\n model.respond_to?('title') ? model.title : model.name rescue model\n end", "def models_label\n @models_label ||= model_class.model_name.human.pluralize\n end", "def description\n self.class.name.underscore.humanize.downcase\n end", "def display_name\n self.name\n end", "def model_name\n model_name = options.fetch(:model_name) do\n ActiveSupport::Inflector.singularize(name.to_s)\n end\n\n Name.new(model_name.to_s)\n end", "def name\n model_name\n end", "def resource_human_name_for(resource_class_name, count = 1)\n class_name = resource_class_name.to_s.classify\n eval(class_name).model_name.human(count: count)\n end", "def human(options={})\n return @human unless @klass.respond_to?(:lookup_ancestors) &&\n @klass.respond_to?(:i18n_scope)\n\n defaults = @klass.lookup_ancestors.map do |klass|\n [klass.model_name.i18n_key,\n klass.model_name.i18n_key.to_s.tr('.', '/').to_sym]\n end.flatten\n\n defaults << options.delete(:default) if options[:default]\n defaults << @human\n\n options.reverse_merge! :scope => [@klass.i18n_scope, :models], :count => 1, :default => defaults\n I18n.translate(defaults.shift, options)\n end", "def name\n read_attribute(:name).try(:titleize)\n end", "def titleize\n MotionSupport::Inflector.titleize(self)\n end", "def display_name\n @name.capitalize.freeze\n end", "def title\n self.name.titleize\n end", "def translation_for(field)\n object.class.human_attribute_name(field)\n end", "def scaffold_human_name\n @scaffold_human_name ||= scaffold_name.humanize\n end", "def test_direct_base_call\n assert_nil ActiveRecord::Base.localized_model_name\n assert_not_equal @attribute_names[:name], ActiveRecord::Base.human_attribute_name('name')\n assert_equal 'name'.humanize, ActiveRecord::Base.human_attribute_name('name')\n end", "def display_name\n \"#{name}\"\n end", "def display_name\n \"#{name}\"\n end", "def display_name\n \"#{name}\"\n end", "def model_name; end", "def model_name; end", "def model_name\n ::ActiveModel::Name.new(self, nil, ::ActiveSupport::Inflector.demodulize(self))\n end", "def human_attribute(object, attribute)\n object.class.human_attribute_name(attribute)\n end", "def human_attribute(object, attribute)\n object.class.human_attribute_name(attribute)\n end", "def upcase_first\n ActiveSupport::Inflector.upcase_first(self)\n end", "def model_name\n @model_class ? @model_class.name.demodulize.underscore : self.controller_name.singularize\n end", "def t_attr(attribute, model = nil)\n model ||= controller_name.classify.constantize\n model.human_attribute_name(attribute)\n end", "def model_name\n self.class.name.underscore.split('_').first.singularize\n end", "def singularize\n ActiveSupport::Inflector.singularize(self)\n end", "def humanize\n\t\tself.gsub('_',' ').titlecase\n\tend", "def humanName\n schema&.dig('name')\n end", "def to_human\n \"\"\n end", "def name\n @name.capitalize\n end", "def name\n @name.capitalize\n end", "def humanize\n\t\tlower_case_and_underscored_word = self\n\t\tresult = lower_case_and_underscored_word.to_s.dup\n#\t\tinflections.humans.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }\n\t\tresult.gsub!(/_id$/, \"\")\n\t\tresult.gsub!(/_/, ' ')\n#\t\tresult.gsub(/([a-z\\d]*)/) { |match|\n#\t\t\"#{inflections.acronyms[match] || match.downcase}\"\n#\t\t}.gsub(/^\\w/) { $&.upcase }\n\tend", "def display_name\n name\n end", "def display_name\n name\n end", "def object_model_name(explicit_object=object)\n logger.warn \"##{__method__} is deprecated\"\n return @options[:as] if root_form? && @options[:as].is_a?(Symbol)\n explicit_object.is_a?(Symbol) ? explicit_object : explicit_object.class.to_s.underscore.gsub(/\\//, '_')\n end", "def to_s\n\t\tself.name.titleize\n\tend" ]
[ "0.83423424", "0.83423424", "0.80238086", "0.7833945", "0.77923775", "0.764233", "0.7599657", "0.7581026", "0.7498146", "0.74338466", "0.7408258", "0.74073416", "0.7393924", "0.73533976", "0.7341057", "0.72971845", "0.7202835", "0.71300805", "0.71073735", "0.70728", "0.70466256", "0.7016173", "0.69905293", "0.6975198", "0.6965379", "0.6954267", "0.69049954", "0.68999565", "0.6890857", "0.68863344", "0.68526286", "0.68526286", "0.6844184", "0.68323827", "0.68014616", "0.67842275", "0.67842275", "0.67605", "0.6732765", "0.6732765", "0.67297465", "0.67111534", "0.67057794", "0.670533", "0.6702226", "0.6698502", "0.6697619", "0.6696793", "0.66860706", "0.6674994", "0.6674429", "0.66653013", "0.6654475", "0.65892655", "0.6582231", "0.6553676", "0.6548617", "0.6548617", "0.6548617", "0.6523681", "0.65154624", "0.6512101", "0.6496758", "0.64892197", "0.6482765", "0.6463528", "0.6455449", "0.6445315", "0.6440803", "0.64320546", "0.6421899", "0.6421171", "0.6421106", "0.64135987", "0.639769", "0.63955134", "0.6394392", "0.63861424", "0.63861424", "0.63861424", "0.6384372", "0.6384372", "0.638086", "0.6365914", "0.6365914", "0.6365411", "0.6359707", "0.6352507", "0.6351691", "0.63514733", "0.63491213", "0.6337532", "0.6325177", "0.6316491", "0.6316491", "0.63147485", "0.6311707", "0.6311707", "0.631", "0.63090235" ]
0.8492617
0
resource wrappers (wrapped around Localeze elements) element 2935 get categories
def get_categories body = build_request(2935, 1501, "ACTIVEHEADINGS") response = send_to_localeze(body) xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def categories\n @categories ||= (@doc/\"Category\").collect { |it| Element.new(it) }\n end", "def uhook_category_partial category\n locale = ::Locale.find_by_iso_code(category.locale)\n content_tag(:dt, ::Category.human_attribute_name(\"locale\") + ':') +\n content_tag(:dd, (locale.native_name.capitalize.html_safe rescue t('ubiquo.category.any')))\n end", "def categories(options = {})\n fetch_categories.at('categories').children_of_type('category').inject([]){ |r, i| r << parse_single_category_xml(i) }\n\tend", "def catses\n REXML::XPath.match(@xml, './app:categories', Names::XmlNamespaces)\n end", "def categories\n category\n end", "def all_categories\n end", "def categories\n\t\t\t@cat_cache ||= @db.js('musicthoughts.all_categories()').map {|c| c.merge(category: c[@lang]) }\n\t\t\t@cat_cache\n\t\tend", "def categories\n if nodes = @node.xpath(\"category\")\n nodes.map { |node| RSSCategory.new(node) }\n end\n end", "def uhook_index_search_subject\n ::Category.locale(current_locale, :all)\n end", "def categories\n nodes = @doc.xpath(\"atom:feed/atom:category\", ::AtomFeed::NS) || []\n nodes.map { |node| AtomCategory.new(node) }\n end", "def categories\n []\n end", "def categories\n if @categories.nil?\n @categories = []\n category_nodes =\n FeedTools::XmlHelper.try_xpaths_all(self.channel_node, [\n \"category\",\n \"dc:subject\"\n ])\n unless category_nodes.nil?\n for category_node in category_nodes\n category = FeedTools::Category.new\n category.term = FeedTools::XmlHelper.try_xpaths(category_node, [\n \"@term\",\n \"text()\"\n ], :select_result_value => true)\n category.term.strip! unless category.term.blank?\n category.label = FeedTools::XmlHelper.try_xpaths(\n category_node, [\"@label\"],\n :select_result_value => true)\n category.label.strip! unless category.label.blank?\n category.scheme = FeedTools::XmlHelper.try_xpaths(category_node, [\n \"@scheme\",\n \"@domain\"\n ], :select_result_value => true)\n category.scheme.strip! unless category.scheme.blank?\n @categories << category\n end\n end\n end\n return @categories\n end", "def category\n @ole.Category\n end", "def create_avail_category\n file = ::File.new(\"#{node['opennms']['conf']['home']}/etc/categories.xml\", \"r\")\n doc = REXML::Document.new file\n file.close\n cg_el = doc.elements[\"/catinfo/categorygroup[name[text()[contains(.,'#{new_resource.category_group}')]]]/categories\"]\n cat_el = cg_el.add_element 'category'\n label_el = cat_el.add_element 'label'\n label_el.add_text(REXML::CData.new(new_resource.label))\n comment_el = cat_el.add_element 'comment'\n comment_el.add_text new_resource.comment\n normal_el = cat_el.add_element 'normal'\n normal_el.add_text \"#{new_resource.normal}\" # really ruby? really?\n warning_el = cat_el.add_element 'warning'\n warning_el.add_text \"#{new_resource.warning}\"\n new_resource.services.each do |s|\n s_el = cat_el.add_element 'service'\n s_el.add_text s\n end\n rule_el = cat_el.add_element 'rule'\n rule_el.add_text(REXML::CData.new(new_resource.rule))\n out = \"\"\n formatter = REXML::Formatters::Pretty.new(2)\n formatter.compact = true\n formatter.write(doc, out)\n ::File.open(\"#{node['opennms']['conf']['home']}/etc/categories.xml\", \"w\"){ |file| file.puts(out) }\nend", "def categories\n expose Metadata.categories(@oauth_token)\n end", "def category; end", "def categories\n rpg_shop.handled_categories\n end", "def get_categories\r\n categories = Taxonomy.get_categories\r\n render json: categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def all(&block)\n categories = []\n\n # Categories are listed in catalog xml, so fetch that.\n catalog = Catalog.new(@options)\n catalog.all do |item|\n categories << {\n code: item[:subcategory].gsub(\"&amp;\", \"\").gsub(/[^A-Za-z0-9]/, \"_\").squeeze(\"_\").downcase,\n description: item[:subcategory].gsub(\"&amp;\", \"&\")\n }\n end\n\n categories.uniq! { |c| c[:code] }\n categories.sort_by! { |c| c[:code] }\n\n categories.each do |category|\n yield category\n end\n end", "def categories()\n @web.get('http://www.waymarking.com/cat/categorydirectory.aspx') do |page|\n ile = 0\n #puts page.parser.to_html.to_s\n cache = {}\n\n page.parser.css('div#content div.gutter a').each do |cat|\n href = cat.attr('href')\n m = Category::GUID_REGEXP.match href\n key = Waymarking::Utils.parameterize(cat.text)\n unless m.nil? then\n ile +=1\n raise DuplicatedCategory if cache.has_key? key\n\n cache[key] = m[1]\n #puts \"#{ile} #{key} #{cat.text} #{m[1]}\"\n else\n puts href\n end\n\n end\n\n cache2 = {}\n cache.keys.each do |key|\n @web.get(\"http://www.waymarking.com/cat/details.aspx?f=1&guid=#{cache[key]}&exp=True\") do |page2|\n begin\n cat = Waymarking::Category.from_html(page2)\n cache2[key] = cat\n rescue\n puts key\n end\n end\n end\n\n File.open('categories.yml', 'w') do |f|\n f.write YAML::dump(cache2)\n end\n end\n end", "def getCategories()\n\t\tcat = Array.new\n\t\tcat.push(\"heroku\")\n\t\tcat.push(\"go\")\n\t\tcat.push(\"github\")\n\t\tcat.push(\"docker\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"apache\")\n\t\tcat.push(\"html\")\n\t\tcat.push(\"bootstrap\")\n\t\tcat.push(\"java ee\")\n\t\tcat.push(\"javafx\")\n\t\tcat.push(\"java\")\n\t\tcat.push(\"jquery\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"c++\")\n\t\tcat.push(\"laravel\")\n\t\tcat.push(\"linux\")\n\t\tcat.push(\"opengl\")\n\t\tcat.push(\"sml\")\n\t\tcat.push(\"javascript\")\n\t\tcat.push(\"mongo db\")\n\t\tcat.push(\"c\")\n\t\tcat.push(\"yacc\")\n\t\tcat.push(\"circuit\")\n\t\tcat.push(\"php\")\n\t\tcat.push(\"mysql\")\n\t\tcat.push(\"node js\")\n\t\tcat.push(\"photoshop\")\n\t\tcat.push(\"rails\")\n\t\tcat.push(\"postgres\")\n\t\tcat.push(\"ruby\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"mac osx\")\n\t\tcat.push(\"sass\")\n\t\tcat.push(\"ubuntu\")\n\t\tcat.push(\"bower\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"css\")\n\t\tcat.push(\"hosted\")\n\t\tcat.push(\"python\")\n\t\tcat.push(\"maven\")\n\t\tcat.push(\"maven mojo\")\n\t\tcat.push(\"composer\")\n\t\tcat.push(\"mips\")\n\t\tcat.push(\"gulp\")\n\t\tcat.push(\"grunt\")\n\t\tcat.push(\"phpstorm\")\n\t\tcat.push(\"react\")\n\t\tcat.push(\"swift\")\n\t\tcat.push(\"wordpress\")\n\t\tcat.push(\"tomcat\")\n\t\tcat.push(\"redis\")\n\t\tcat.push(\"travis\")\n\t\treturn cat\n\tend", "def categories_list\n self.categories.collect{|c| c.name}\n end", "def tags_and_categories_list\n list =[]\n self.div(:id=>\"contentmetadata_tags_container\").links.each do |link|\n list << link.text\n end\n return list\n end", "def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end", "def getCategoryAll()\n params = Hash.new\n return doCurl(\"get\",\"/category/all\",params)\n end", "def category_types\n @category_types.each\n end", "def categories\n @categories ||= wayfinder.decorated_vocabularies.sort_by(&:label)\n end", "def category\n data['category']\n end", "def categories\n add_to_query restrict_kind: 'category'\n end", "def set_categories\n @categories = {}\n @mechanize.page.search('//*[@id=\"prtcalst\"]//li').each do |cat|\n cat_link = cat.search('a')[0]\n cat_name = cat.search('.//em')[0].inner_text()\n catObj = Category.new()\n catObj.elem = cat_link\n catObj.name = cat_name\n @categories[cat_name] = catObj\n\n puts(\"#{cat_name}\")\n puts(\"-------------------\")\n end\n end", "def categories\n raw_categories.to_hashugar\n end", "def category\n @data['category']\n end", "def tags\n node.css(\"category\").map(&:text)\n end", "def category_descriptions\n return @category_descriptions\n end", "def categories\n get('venues/categories').categories\n end", "def categories\n return @categories\n end", "def categories\n return @categories\n end", "def categories\n return @categories\n end", "def category_names\n self.categories.map do |category|\n category.name\n end\n end", "def getCategories(_, _, _)\n @db.categories\n end", "def categories\n\t\trender :json => {:status => 1, :categories => {\"1\" => \"Apparel & Accessories\", \"2\" => \"Arts and Crafts\", \"3\" => \"Electronics\", \n\t\t\t\"4\" => \"Home Appliances\", \"5\" => \"Kids & Baby\", \"6\" => \"Movies, Music, Books & Games\", \"7\" => \"Motor Vehicles\", \n\t\t\t\"8\" => \"Office & Education\", \"9\" => \"Parties & Events\", \"10\" => \"Spaces & Venues\", \"11\" => \"Sports & Outdoors\", \"12\" => \"Tools & Gardening\", \"13\" => \"Other\"}}, :status => 200\n\t\treturn\n\tend", "def get_category\n json_response({ message: 'NOT IMPLEMENTED' })\n end", "def categories\n parsed_json['data']\n end", "def category_info\n {\n categories: self.object.appointments.map{ |appt| \n appt.category\n }\n \n }\n end", "def category\n ActiveModel::SerializableResource.new(object.category, each_serializer: CategoriesSerializer)\n end", "def articles\n return AP.category(@id)\n end", "def categories\r\n return handle_resource_not_found unless @article_category\r\n\r\n add_category_breadcrumbs(@article_category)\r\n if @article_category.leaf?\r\n @title_text = @article_category.display_text\r\n @articles = fetch_articles(order_by, nil, :conditions => {:article_category_id => @article_category.id}, :include => [:user, :article_category])\r\n @other_recent_posts = @article_category.parent.all_recent_posts(:exclude_category => @article_category) if @article_category.parent\r\n render 'articles/subcategories'\r\n else\r\n return unless check_category_for_stale\r\n @subcategories_with_posts = @article_category.children.with_published_articles\r\n render 'articles/categories'\r\n end\r\n end", "def categories\n return [] if @categories.blank?\n @categories.records.map {|c| c.display_name}\n end", "def getCat \n\t\tputs ''\n\t\tputs 'Fetching categories . . '\n\t\t@page.css('ul.dropdown li a').each do |cat|\n\t\t\tarr=[]\n\t\t\tarr.push cat.text\n\t\t\tarr.push cat['href']\n\t\t\t@arr_cat.push arr\n\t\t\tprint '. '\n\t\tend\n\t\ti=0\n\t\t@arr_cat.each do |pair|\n\t\t\t@db.execute 'insert into category values (?, ? ,?)', i, pair[0], pair[1]\n \t\t\ti +=1\n \t\tend\n\tend", "def get_category_list\n ret_hash = Rails.cache.fetch(\"zaim_api/category\", expired_in: 1.day) do\n json_categories = self.zaim_api.category\n tmp_ret_hash = {}\n json_categories['categories'].each do |value|\n tmp_ret_hash[value['id']] = value['name']\n end\n tmp_ret_hash\n end\n ret_hash\n end", "def category\n revision.category\n end", "def extract_categories(title)\n # First find the article_id\n article_id = get_article_id(title)\n return nil if article_id.nil?\n \n (prefix1, prefix2) = make_path_prefix(article_id)\n fname = @enwiki_dir + \"/\" + prefix1 + \"/\" + prefix2 + \"/#{article_id}.xml\"\n catlist = []\n open(fname).each_line do |line|\n if line =~ /\\[\\[(Category:.*?)\\]\\]/\n # Remove stuff after \"|\" if any\n cat_title = $1.gsub /\\|.*/, ''\n cat_article_id = get_article_id(cat_title)\n catlist.push(cat_article_id) if not cat_article_id.nil?\n end\n end\n return catlist\n end", "def source_result_category_names\n category_names\n end", "def categories\n return @categories\n end", "def get_categories()\n\t\tzomoato_categories_url = @base_uri + \"categories\"\n\t\tresponse = HTTParty.get(zomoato_categories_url, headers: @headers)\n\t\tif response.success?\n\t\t\t@categories = response.parsed_response\n\t\telse\n\t\t\traise response.response\n\t\tend\n\t\treturn @categories\n\tend", "def category18\n return @category18\n end", "def category_names\n categories.map {|category| CategoryCode[category]}\n end", "def get_categories_list\n args = receive_should_validate?\n get('redtube.Categories.getCategoriesList', {}, [], args[:should_validate])\n end", "def element_subcategory; end", "def fresh_categories\n # these are the categories that will be displayed by default\n # in the html view\n return {\n \"speakerData\" => {\"label\" => \"Character Direct Speech\", \"data\" => []},\n \"indirectData\" => {\"label\" => \"Character Indirect Diction\", \"data\" => []},\n \"traitData\" => {\"label\" => \"Trait: Character Type\", \"data\" => []}, \n \"genderData\" => {\"label\" => \"Trait: Character Sex\", \"data\" => []},\n \"maritalStateData\" => {\"label\" => \"Trait: Character Marriage Status\", \"data\" => []},\n \"socecStatusData\" => {\"label\" => \"Trait: Character Class Status\", \"data\" => []},\n \"ageData\" => {\"label\" => \"Trait: Character Age\", \"data\" => []},\n \"occupationData\" => {\"label\" => \"Trait: Character Occupation\", \"data\" => []},\n }\nend", "def categories\n category_keys.collect(&:to_s)\n end", "def mx_l7_application_categories\r\n MXL7ApplicationCategoriesController.instance\r\n end", "def getLookupCategory( string, language)\n params = Hash.new\n params['string'] = string\n params['language'] = language\n return doCurl(\"get\",\"/lookup/category\",params)\n end", "def index\n @categories = collections_config.values\n end", "def list_customer_categories\n doc = Hpricot::XML(request.raw_post) \n doc = doc.to_s.gsub(\"&amp;\",\"&\") \n doc = Hpricot::XML(doc)\n @customer_categories = Customer::CustomerCrud.list_customer_categories(doc)\n render_view( @customer_categories,'customer_categories','L')\n end", "def add_categories(collection)\n\tcategory = \"\"\n\tcollection[\"results\"][\"collection1\"].each do |article|\n\t\tif article[\"category\"] == \"\"\n article[\"category\"] = category\n else\n category = article[\"category\"]\n end\n\tend\nend", "def content_filtering_categories\r\n ContentFilteringCategoriesController.instance\r\n end", "def categories\n taxonomies.all :conditions => { :classification => :category }\n end", "def categories\n document.css('#jumpto a').map(&:text)\n end", "def category_parser\n @category_parser || Category\n end", "def list_categories(variable)\n if !variable.categories.empty?\n cat_list = \"\"\n variable.categories.split(',').each{|cat| cat_list << content_tag(:li, cat.capitalize, :class => cat.downcase)}\n content_tag(:ul, cat_list, :class => \"categories\")\n else\n content_tag(:span, \"None\")\n end\n end", "def uhook_category_index_actions category_set, category\n actions = []\n if category.in_locale?(current_locale)\n actions << category_view_link(category, category_set)\n end\n\n if category.in_locale?(current_locale)\n actions << category_edit_link(category, category_set)\n end\n\n unless category.in_locale?(current_locale)\n actions << category_translate_link(category, category_set)\n end\n\n actions << category_remove_link(category, category_set)\n\n if category.in_locale?(current_locale, :skip_any => true) && !category.translations.empty?\n actions << category_remove_translation_link(category, category_set)\n end\n\n actions\n end", "def name\n description_category\n end", "def get_sidebar_filter_categories(categories)\n html_code = ''\n if !categories.children.empty?\n\n html_code += '<div class=\"sidebar-module-container\">\n <div class=\"sidebar-filter\">\n <div class=\"sidebar-widget outer-bottom-small wow fadeInUp animated\">\n <h3 class=\"section-title\">shop by</h3>\n <div class=\"widget-header\">\n <h4 class=\"widget-title\">Category</h4>\n </div>\n <div class=\"sidebar-widget-body\">\n <div class=\"accordion\">'\n categories.children.each do |category|\n html_code += '<div class=\"accordion-group\">\n <div class=\"accordion-heading\">'\n html_code += link_to category.category_name, category_path(category: category.id), {class: 'accordion-toggle collapsed'}\n html_code += '</div></div>'\n end\n html_code += '</div></div></div></div></div>'\n end\n html_code.html_safe\n end", "def create_category_pages\n tags.keys.each do |tag|\n items << Nanoc3::Item.new(\n \"= render('category', :tag => '#{tag}')\",\n {\n :title => \"Category: #{tag}\",\n :changefreq => 'daily',\n :priority => 0.4\n },\n \"/categories/#{tag.downcase.parameterize}/\",\n :binary => false\n )\n end\nend", "def type\n self.category\n end", "def main_categories\n categories.to_a[0..3]\n end", "def getAutocompleteCategory( str, language)\n params = Hash.new\n params['str'] = str\n params['language'] = language\n return doCurl(\"get\",\"/autocomplete/category\",params)\n end", "def get_categories( parent = nil )\n\t\t\n\t\tcall = 'GetCategories'\n\n\t\tif parent.nil?\n\t\t\tbody = <<-END\n\t\t\t\t<CategorySiteID>0</CategorySiteID>\n\t \t\t\t<DetailLevel>ReturnAll</DetailLevel>\n\t \t\t\t<LevelLimit>1</LevelLimit>\n\t\t\tEND\n\t\telse\n\t\t\tbody = <<-END\n\t\t\t\t<CategoryParent>#{parent}</CategoryParent>\n\t\t\t\t<DetailLevel>ReturnAll</DetailLevel>\n\t\t\t\t<LevelLimit>2</LevelLimit>\n\t\t\tEND\n\t\tend\n\n\t\t@caller.make_trade_call( call, body )\n\n\tend", "def get_categories(row)\n categories = []\n cat = at_in(:category1 , row) # should invent some loop here\n categories << cat if cat\n cat = at_in(:category2 , row) # but we only support\n categories << cat if cat\n cat = at_in(:category3 , row) # three levels, so there you go\n categories << cat if cat\n categories\n end", "def parse_categories_structure(category_id = nil)\n super category_id, { product_link: '.productsArea .productArea .productDetail a',\n next_page_link: '.productsArea .tsk-pageview .next a' }\n end", "def load_categories\n q = @db.query(\"select t.term_id, t.name, t.slug\n from wp_terms as t join wp_term_taxonomy as x\n on t.term_id = x.term_id\n where x.taxonomy = 'category'\")\n\n q.each_hash { |c| os = OpenStruct.new(c) ; @categories[os.term_id.to_i] = OpenStruct.new(c) }\n end", "def get_subcategories\r\n sub_categories = Taxonomy.get_subcategories\r\n render json: sub_categories, root: 'categories', adapter: :json, status: :ok\r\n end", "def getCategories\n @categories = []\n @categories << Category.new(name: \"All\", id: -1)\n @categories += Category.all\n end", "def categories(options=nil, &definition)\n if options\n if options[:for]\n @embed_for = options[:for]\n end\n end\n \n @embedded = CategoryScraper.new @fetcher_class,{:main_url => @main_url}, &definition\n end", "def related_tag_categories\n @related_tag_categories ||= {\n GENERAL => [GENERAL],\n ARTIST => [COPYRIGHT, CHARACTER, GENERAL],\n CHARACTER => [COPYRIGHT, CHARACTER, GENERAL],\n COPYRIGHT => [COPYRIGHT, CHARACTER, GENERAL],\n META => [META, GENERAL]\n }\n end", "def channel_categories\n build :channel_categories, :using => data_for(:channel_categories)\n end", "def get_categories\n @categories = Category.all\n end", "def get_categories\n cats = []\n params.each do |k,v|\n if k.starts_with? \"category\"\n name = v\n num = cat_number(k) \n cats << [name,num]\n end\n end\n return cats\n end", "def category\n return @category\n end", "def category\n return @category\n end", "def category\n return @category\n end", "def category\n return @category\n end", "def category\n return @category\n end", "def category\n return @category\n end", "def category10\n return @category10\n end", "def categorized_list\n %w[artist copyright character meta general]\n end", "def categories\n response[\"categories\"].map!{|category| Foursquared::Response::Category.new(client, category)} if response[\"categories\"]\n end", "def category\n self.item.category\n end", "def category_type\n object.category.main_cat\n end" ]
[ "0.6873484", "0.6751526", "0.67265433", "0.65874094", "0.6584037", "0.64311963", "0.643012", "0.63962334", "0.6374662", "0.6371184", "0.632317", "0.6268836", "0.6258889", "0.62543905", "0.6233066", "0.6222465", "0.6195614", "0.6193665", "0.6187521", "0.6168951", "0.61427045", "0.61264247", "0.61220986", "0.61207676", "0.60908926", "0.60811675", "0.6080291", "0.60744405", "0.60490984", "0.6035332", "0.60315514", "0.602383", "0.6012809", "0.5981971", "0.59781027", "0.5976143", "0.5976143", "0.5976143", "0.5968821", "0.5967521", "0.59411705", "0.59291875", "0.59186566", "0.5910686", "0.58919233", "0.5886641", "0.58784086", "0.586564", "0.5857849", "0.5846522", "0.584568", "0.5839829", "0.5837942", "0.58352613", "0.5832925", "0.58124584", "0.58112353", "0.58109194", "0.5808389", "0.57994366", "0.5795104", "0.57906514", "0.57877094", "0.577429", "0.57698923", "0.57674277", "0.57595885", "0.57547593", "0.57509273", "0.5750368", "0.5736203", "0.57336944", "0.5724929", "0.5717563", "0.57165015", "0.57142043", "0.57090306", "0.5708883", "0.57069963", "0.5701521", "0.5697638", "0.5694025", "0.5681597", "0.56801766", "0.56795365", "0.5671435", "0.56612575", "0.56592387", "0.5657946", "0.5652928", "0.5652928", "0.5652928", "0.5652928", "0.5652928", "0.5652928", "0.5648068", "0.5643945", "0.5643116", "0.56378883", "0.5637679" ]
0.71457523
0
element 3722 check availability
def check_availability(business = {}) xml = Builder::XmlMarkup.new query = xml.tag!("BPMSPost", 'Edition' => "1.1") { xml.tag!("Record") { xml.tag!("Bowser Autio", business[:name]) xml.tag!("Autio", business[:department]) xml.tag!("6675 rivertown rd", business[:address]) xml.tag!("Fairburn", business[:city]) xml.tag!("GA", business[:state]) xml.tag!("30213", business[:zip]) xml.tag!("7708460972", business[:phone]) } } body = build_request(3722, 1510, query) response = send_to_localeze(body) xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text) xml_doc['ErrorCode'] == '1' # success (returns true/false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def check_rbs_availability!; end", "def XOcheckFor(tag, tvalue)\n\t\turl= @wwBrws.url.to_s\n\t\tres=OK\n\t\t$alog.lwrite(('Checking element '+tag.to_s+' with value /'+tvalue+'/'), 'DEBG')\n\t\tbegin\n\t\t\t$pfd.tstart( url)\n\t\t\tfound= findElement(tag, tvalue)\n\t\t\tif(found)\n\t\t\t\t$pfd.calcApplRes(true,'Check: '+tag.to_s+' found:/'+tvalue+'/', url)\n\t\t\t\tres= OK\n\t\t\telse\n\t\t\t\t$pfd.calcApplRes(true, tag.to_s+' not found. Value: /'+tvalue+'/ '+$!.to_s, url)\n\t\t\t\tres= WARNING\n\t\t\tend\n\t\trescue\n\t\t\tmsg= tag.to_s+' not selectable. Value: /'+tvalue+'/ '+$!.to_s\n\t\t\tres= setResCritical( msg)\n\t\tend\n\t\treturn res\n\tend", "def available?\n check_elements_for_compliance { |e| !e.available? }\n end", "def check ; true ; end", "def is_text_present(ele)\n $log.info \"verifying #{ele} present or not\"\n if s=$browser.button(:id, \"#{ele}\").exists?\n $log.info \"{ele} available on the page\"\n elsif\n $log.info \"failed to find the element: #{ele}!\"\n raise Exception.new(\"Failed to find the element: #{ele}!\")\n end\n \nend", "def used_by?(element)\n end", "def used_by?(element)\n end", "def elem_exists(elem)\n\t\treturn eval(\"@browser.\"+elem+\".exists?\")\n end", "def is_element_present(type,ele)\n ref=$array[\"#{ele}\"]\n \n path=ele.split(\"_\").last\n val=\"\"\n if type == \"button\"\n val=$browser.button(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"link\"\n val=$browser.link(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"checkbox\"\n val=$browser.checkbox(:\"#{path}\", \"#{ref}\").exists? \n \n elsif type == \"textfield\"\n val=$browser.text_field(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"radiobutton\"\n val=$browser.radio(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"list\"\n val=$browser.select_list(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"img\"\n val=$browser.img(:\"#{path}\", \"#{ref}\").exists?\n \n elsif type == \"div\"\n val=$browser.div(:\"#{path}\", \"#{ref}\").exists?\n \n else\n $log.info \"{ele} is not present\"\n raise(\"given type is not found\")\n end\n if val\n $log.info \"given #{ele} present on the page\"\n else\n $log.info \" fail to find the element\"\n raise(\"given #{ele} does not exists\")\n end\nend", "def ele_available?(selector)\n return nil if not ele_exists?(selector) # Hack\n ele_exists?(selector) and ele_enabled?(selector) and ele_visible?(selector) and ele_displayed?(selector)\n rescue\n return nil # Hack\n end", "def exist? ; ! @element.nil? ; end", "def elements_present\n elements_to_check.select { |name| there?(name) }\n end", "def availability\n end", "def availability\n end", "def verify_element_status(name, status)\n case status.upcase\n when \"DISABLED\"\n send(\"#{name}_element\").disabled?\n when \"ENABLED\"\n send(\"#{name}_element\").enabled?\n end\n end", "def evocations?\n\n\t !evocations('n08112402').nil?\n\n\tend", "def check\n \n end", "def check\n \n end", "def has_elements?; end", "def available; end", "def available; end", "def mobile_element_exists(xpath)\r\n\r\n result = true\r\n\r\n begin\r\n mobile_element = get_mobile_element xpath\r\n\r\n if mobile_element.nil? or mobile_element.to_s.empty?\r\n result = false\r\n end\r\n\r\n rescue Exception => e\r\n puts \"mobile_element_exists => Exception => #{e.message}\"\r\n result = false\r\n\r\n end\r\n\r\n return result\r\n\r\nend", "def acceptable_return?(return_val, element_name); end", "def checks; end", "def check_validity!\n # nothing\n end", "def check!\n true\n end", "def available?\n true\n end", "def ieIsAvailable()\n return false if @ie.busy \n return false if @ie.readyState != READYSTATE_COMPLETE\n return true\n end", "def verify_feed_elements\n wait_for_elements_exist([@@feedtable], :timeout => 10)\n wait_for_elements_exist([@@storycell], :timeout => 10)\n wait_for_elements_exist([@@compose], :timeout => 10)\n end", "def check_element_enable(access_type, access_name, test_case)\n result = is_element_enabled(access_type, access_name)\n if test_case\n expect(result).to be true\n else\n expect(result).to be false\n end\nend", "def check_element_presence(access_type, access_name, test_case)\n expect(is_element_displayed(access_type, access_name)).to be test_case\nend", "def wait_to_appear(sym,id)\n @wait.until {\n element_arr = driver.find_elements(sym,id)\n element_arr.size > 0 and element_arr[0].displayed? #wait until the element both exists and is displayed\n }\n end", "def check_accessibility\n end", "def restrictions_option_popup_present?\n until @browser.section(:id, 'update-page-restrictions-dialog').exists? do\n sleep 1\n end\n # for some reason the div never appeared as visible, only existing, and only becamne existing when the functionality\n # was invoked. Given this the only ways to validate presence was to check the z access it the style attribute or the exist? flag\n # neither of which i like very much and would like to discuss a better solution with developers as html implementation may be causing issues.\n expect(@browser.div(:id, 'update-page-restrictions-dialog').attribute_value('style')).to include('z-index: 3000')\n # or\n expect(@browser.div(:id, 'update-page-restrictions-dialog').exist?).to eq(true)\nend", "def wait_until_element_present(element)\n element.when_present.exists?\n end", "def element_visible\n assert_exists(element.visible?(\"failed\"))\n end", "def test_v_availability_simple\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20110101T000000Z\nDTEND:20120101T000000Z\nBEGIN:AVAILABLE\nDTSTART:20110101T000000Z\nDTEND:20110101T010000Z\nEND:AVAILABLE\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n \"FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T110000Z/20110101T120000Z\\n\" \\\n \"FREEBUSY:20110101T120000Z/20110101T130000Z\\n\" \\\n 'FREEBUSY;FBTYPE=BUSY-UNAVAILABLE:20110101T130000Z/20110103T110000Z',\n blob,\n nil,\n vavail\n )\n end", "def valid?\n @xml.xpath('//weather/problem_cause').size == 0\n end", "def is_available page\n return !page.nil? \nend", "def is_available page\n return !page.nil? \nend", "def is_available page\n return !page.nil? \nend", "def is_available page\n return !page.nil? \nend", "def is_available(page)\n\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n\n return !page.nil? \n\nend", "def is_available(page)\n\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n\n return !page.nil? \n\nend", "def is_available(page)\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n return !page.nil? \nend", "def is_available(page)\n # Todo: Return true if the page is available for scraping Development Applications. Return false otherwise\n return !page.nil? \nend", "def warning_display?\r\n begin\r\n @driver.find_element(:xpath, @data_xpath[:register_page][:adobe_id_frame_warning_message])\r\n true\r\n rescue Selenium::WebDriver::Error::NoSuchElementError\r\n false\r\n end\r\n end", "def isSatisfiable?()\n\tend", "def is_here?(element)\n element.exists?\n rescue\n false\n end", "def available?\n return false\n end", "def available?()\n #This is a stub, used for indexing\n end", "def usable?; end", "def element_visible?(how, what)\n @driver.find_element(how, what).displayed?\n rescue Selenium::WebDriver::Error::ElementNotVisibleError\n false\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n rescue Selenium::WebDriver::Error::StaleElementReferenceError\n false\n end", "def noTrains?\n return @driver.find_elements(:xpath, \".//*[@id='details']/p/a\").size()>0\nend", "def test_v_availability_irrelevant\n blob = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VEVENT\nUID:lalala\nDTSTART:20110101T120000Z\nDTEND:20110101T130000Z\nEND:VEVENT\nEND:VCALENDAR\nICS\n\n vavail = <<ICS\nBEGIN:VCALENDAR\nBEGIN:VAVAILABILITY\nDTSTART:20150101T000000Z\nDTEND:20160101T000000Z\nBEGIN:AVAILABLE\nDTSTART:20150101T000000Z\nDTEND:20150101T010000Z\nEND:AVAILABLE\nEND:VAVAILABILITY\nEND:VCALENDAR\nICS\n\n assert_free_busy_report(\n 'FREEBUSY:20110101T120000Z/20110101T130000Z',\n blob,\n nil,\n vavail\n )\n end", "def is_element_enabled(access_type, access_name)\n $driver.find_element(:\"#{access_type}\" => \"#{access_name}\").enabled?\nend", "def check_xml(html)\n doc = Hpricot.XML(html)\n \terrors = doc.search(\"*[@errCode]\")\n \tif errors.size > 0\n \t\terrors.each do |error|\n \t\t\traise error[:errCode]\n \t\tend\n \telsif (doc%'page').nil?\n \t\traise \"EmptyPage (#{url})\"\n \telse\n \t\treturn true\n \tend\n end", "def result_of_checking; end", "def wait_element(opt = {})\n begin\n wait = Selenium::WebDriver::Wait.new(:timeout => @timeout)\n wait.until {\n # post(@session_url+'/element/',opt)['status'].equal?(0)\n search_element(opt).length.equal?(32)\n }\n return true\n rescue\n return false\n end\n end", "def check(node); end", "def check_room_form\n has_element(\"input#bigbluebutton_room_name\",\n { :name => 'bigbluebutton_room[name]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_meetingid\",\n { :name => 'bigbluebutton_room[meetingid]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_private\",\n { :name => 'bigbluebutton_room[private]', :type => 'checkbox' })\n has_element(\"input#bigbluebutton_room_attendee_key\",\n { :name => 'bigbluebutton_room[attendee_key]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_moderator_key\",\n { :name => 'bigbluebutton_room[moderator_key]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_welcome_msg\",\n { :name => 'bigbluebutton_room[welcome_msg]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_logout_url\",\n { :name => 'bigbluebutton_room[logout_url]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_dial_number\",\n { :name => 'bigbluebutton_room[dial_number]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_max_participants\",\n { :name => 'bigbluebutton_room[max_participants]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_external\",\n { :name => 'bigbluebutton_room[external]', :type => 'checkbox' })\n has_element(\"input#bigbluebutton_room_slug\",\n { :name => 'bigbluebutton_room[slug]', :type => 'text' })\n has_element(\"input#bigbluebutton_room_voice_bridge\",\n { :name => 'bigbluebutton_room[voice_bridge]', :type => 'text' })\n has_element(\"label\", { :for => 'bigbluebutton_room_name' })\n has_element(\"label\", { :for => 'bigbluebutton_room_meetingid' })\n has_element(\"label\", { :for => 'bigbluebutton_room_private' })\n has_element(\"label\", { :for => 'bigbluebutton_room_attendee_key' })\n has_element(\"label\", { :for => 'bigbluebutton_room_moderator_key' })\n has_element(\"label\", { :for => 'bigbluebutton_room_welcome_msg' })\n has_element(\"label\", { :for => 'bigbluebutton_room_logout_url' })\n has_element(\"label\", { :for => 'bigbluebutton_room_dial_number' })\n has_element(\"label\", { :for => 'bigbluebutton_room_max_participants' })\n has_element(\"label\", { :for => 'bigbluebutton_room_external' })\n has_element(\"label\", { :for => 'bigbluebutton_room_slug' })\n has_element(\"label\", { :for => 'bigbluebutton_room_voice_bridge' })\n has_element(\"input\", { :name => 'commit', :type => 'submit' })\n end", "def element_present?(how, what)\n $driver.find_elements(how, what).size > 0\nrescue Selenium::WebDriver::Error::NoSuchElementError\n false\nend", "def already_used?\n p \"Checking already used\"\n vehicle.present? and state == 1\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 check_availability(opts)\n begin\n check_availability!(opts)\n rescue ActiveBookings::AvailabilityError\n false\n end\n end", "def check_exist_supporting_node\n check('supporting node existence') do |messages|\n all_nodes do |node, _nw|\n node.supports.each do |snode|\n begin\n next if find_node(snode.network_ref, snode.node_ref)\n rescue TopologyElementNotFoundError => e\n messages.push(message(:error, node.path, e.message))\n end\n\n msg = \"definition referred as supporting node #{snode} is not found.\"\n messages.push(message(:error, node.path, msg))\n end\n end\n end\n end", "def smartContentEnabled?\n smart_content_element.count > 0 \n end", "def check_bingo\n\t\t\n\tend", "def smartphones_are_visible\n wait = Selenium::WebDriver::Wait.new(:timeout => 0.2)\n preloader_wait\n $driver.manage.timeouts.implicit_wait = 0\n begin\n search_result = wait.until { $driver.find_element(@@список_смартфонов) }\n rescue => e\n error('Eti mobilkies not nahodyatsya, smeni prices epta')\n end\n $driver.manage.timeouts.implicit_wait = 10\n end", "def has_waiting?\n raise NotImpelementedError\n end", "def wait_for_page_to_load\n @wait_on.each { |element| wait_for_element(element) }\n loading_message.wait_while_present if loading_message.present?\n true\n rescue\n false\n end", "def element_state; end", "def check_status \n return self.status == :open_hotel_block\n end", "def is_available?\n count_available > 0\n end", "def check_availability_link()\n $tracer.trace(format_method(__method__))\n return ToolTag.new(@tag.find.a.id(\"/btnCheckStoreAvailability/\"), format_method(__method__))\n end", "def enabled_checks; end", "def element?; end", "def element?; end", "def check(oid)\n false\n end", "def element_is_visible(name, tag, container, yes = true)\n elem = wait_visibility(name, tag, container, yes)\n elem ? true : false\n end", "def check_element_exists(exist, element)\n element = element.downcase.gsub(' ', '_')\n\n if exist == 'exist'\n unless wait_until{send(\"#{element}?\")}\n raise \"#{element} was not found!\"\n end\n\n elsif exist == 'not exist'\n if send(\"#{element}?\")\n raise \"#{element} was found!\"\n end\n\n else 'Incorrect option selected'\n end\n end", "def assert_text_on_screen(validation_msg)\n\t\tsleep(2)\n\t\tputs \"#{validation_msg}\"\n\t\ttext_from_screen=query(\"*\", \"text\")\n\t\telement_present=text_from_screen.include? validation_msg\n\t\tassert_equal true, element_present\n\tend", "def verify_persinfo\n\t\t@browser.url == \"https://www.autogravity.com/credit/application/personal\"\n\t\t@browser.div(:visible_text, /Personal Information$/).present?\n\tend", "def element_enabled\n assert_enabled(element.enabled?(\"failed\"))\n end", "def expect_do_demandcheck_state\n page.assert_selector(\".capybara-do-demandcheck\")\n end", "def check_server_form\n has_element(\"input#bigbluebutton_server_name\",\n { :name => 'bigbluebutton_server[name]', :type => 'text' })\n has_element(\"input#bigbluebutton_server_url\",\n { :name => 'bigbluebutton_server[url]', :type => 'text' })\n has_element(\"input#bigbluebutton_server_secret\",\n { :name => 'bigbluebutton_server[secret]', :type => 'text' })\n has_element(\"input#bigbluebutton_server_version\",\n { :name => 'bigbluebutton_server[version]', :type => 'text' })\n has_element(\"input#bigbluebutton_server_slug\",\n { :name => 'bigbluebutton_server[slug]', :type => 'text' })\n has_element(\"label\", { :for => 'bigbluebutton_server_name' })\n has_element(\"label\", { :for => 'bigbluebutton_server_url' })\n has_element(\"label\", { :for => 'bigbluebutton_server_secret' })\n has_element(\"label\", { :for => 'bigbluebutton_server_version' })\n has_element(\"label\", { :for => 'bigbluebutton_server_slug' })\n has_element(\"input\", { :name => 'commit', :type => 'submit' })\n end", "def available?\n true\n end", "def errorPage?\n @driver.find_elements(:xpath, \".//*[@id='resultados']/ul\").size()==0 and \n @driver.find_elements(:xpath, \".//*[@id='details']/p\").first.text==\"No ha introducido ciudad de origen o destino\" or\n @driver.find_elements(:xpath, \".//*[@id='details']/p\").first.text==\"La fecha introducida no es correcta\"\nend", "def available?\n false\n end", "def check\n fetch(:@check) { |grid_string| grid_string[17,1] }\n end", "def e_not_used\n ElementReqs_::NotUsed\n end", "def ready?\n end", "def wait_for_mobile_element(xpath, timeout = nil)\r\n\r\n result = false\r\n timeout = timeout.nil? ? 1 : timeout\r\n start = Time.new\r\n\r\n while (start.to_i + timeout.to_i) > Time.new.to_i\r\n if mobile_element_exists(xpath)\r\n result = true\r\n break\r\n end\r\n end\r\n\r\n return result\r\n\r\nend", "def is_valid_element?(element)\n VALID_TAGS.include?(element.get_tag_name)\n end", "def element_exists(document,element_name,lang)\n xpath = REXML::XPath\n xpath.first(document, \"//metadata[@name='#{element_name}'][@xml:lang='#{lang}']\") != nil\nend", "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end", "def element_present?(how, what)\n @driver.find_element(how, what)\n true\n rescue Selenium::WebDriver::Error::NoSuchElementError\n false\n end" ]
[ "0.6755433", "0.66027594", "0.65604746", "0.65471834", "0.65050447", "0.64395046", "0.64395046", "0.64282084", "0.64206797", "0.6229034", "0.62003386", "0.61693406", "0.6147397", "0.6146912", "0.6139299", "0.6121195", "0.61167663", "0.61167663", "0.6106032", "0.6104841", "0.6104841", "0.6095933", "0.6058697", "0.6020993", "0.59958166", "0.5982184", "0.5978193", "0.5972455", "0.5968897", "0.59560424", "0.595551", "0.594516", "0.59230083", "0.5914304", "0.589706", "0.5886121", "0.58695096", "0.58669615", "0.5861644", "0.5861644", "0.5861644", "0.5861644", "0.5841643", "0.5841643", "0.58040005", "0.58040005", "0.5797735", "0.5797538", "0.5796329", "0.5788915", "0.5782967", "0.57707185", "0.5770148", "0.576853", "0.57684875", "0.5764369", "0.5759639", "0.5754425", "0.5739251", "0.5737785", "0.57347184", "0.5729054", "0.5722597", "0.5698083", "0.5698049", "0.5697432", "0.5682963", "0.5675006", "0.56737584", "0.567107", "0.56648797", "0.56526303", "0.56450254", "0.56421405", "0.56377226", "0.56351215", "0.5631509", "0.5631509", "0.5625754", "0.56246966", "0.56209433", "0.5608526", "0.56062573", "0.5604302", "0.5599777", "0.5599009", "0.5597638", "0.5594948", "0.5581788", "0.55801445", "0.55768114", "0.5572881", "0.5571157", "0.5567627", "0.55641854", "0.55619633", "0.55619633", "0.55619633", "0.55619633", "0.55619633" ]
0.5849146
42
element 3700 post business
def post_business(business, location) xml = Builder::XmlMarkup.new query = xml.tag!("BPMSPost", 'Edition' => "1.1") { xml.tag!("Record") { xml.tag!("Phone", location.phone) xml.tag!("BusinessName", location.location_name) xml.tag!("Address", location.address) xml.tag!("City", location.city) xml.tag!("State", location.state) xml.tag!("Zip", location.zip) xml.tag!("URL", location.website_url) xml.tag!("TagLine", location.special_offer) #xml.tag!("LogoImage", location.logo) xml.tag!("Categories") { xml.tag!("Category") { xml.tag!("Type", "Primary") xml.tag!("Name", business.industry_primary) } if business.industry_alt_1.present? xml.tag!("Category") { xml.tag!("Type", "Alt1") xml.tag!("Name", business.industry_alt_1) } end if business.industry_alt_2.present? xml.tag!("Category") { xml.tag!("Type", "Alt2") xml.tag!("Name", business.industry_alt_2) } end } } } body = build_request(3700, 1510, query) response = send_to_localeze(body) xml_doc = respond_with_hash(Nokogiri::XML(response.to_xml).text) xml_doc['Error'] == '0' # success (returns true/false) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def posts; end", "def all_post\n end", "def get_posts(person)\n person.out_e(:POSTED).in_v(type: 'post')\nend", "def export_post(post) end", "def determine_post_element_xpath\n els = detect_post_element_xpaths\n els.first.andand[0]\n end", "def create_post\n post_title = parse_html.css('title')[0].text\n post_url = @url\n points = parse_html.search('.subtext > span:first-child').map { |span| span.inner_text}\n post_points = points[0]\n all_ids = parse_html.search('tr.athing td center a').map { |link| link['id']}\n post_id = all_ids[0].gsub(/[[a-z]_\" \"\"]/,\"\") # taken from the first upvote button\n @post = Post.new(post_title, post_url, post_points, post_id, parse_comments)\n end", "def read_post(post_list, id)\n post = post_list['data']['children'][id]['data']\nend", "def element; end", "def element; end", "def element; end", "def element; end", "def test_ID_25890_published_posts_01\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n postCount = count_post_current\n if (postCount < 5)\n i=1\n while i < 5\n $browser.goto($patch_note)\n \t$post_pick_group.when_present().click\n \t$browser.link(:text, Regexp.new(groupName)).click\n \t$post_compose_note.when_present().set(\"Note field populated by automated test.\")\n \t$post_now_button.when_present().click\n i = i+1\n end\n end \n end", "def postal; end", "def post\n doc = Nokogiri::XML(request.body)\n id= (doc/'id').text\n # p = Post.exists?(id) ? Post.find(id) : Post.new\n p= Post.find_or_create_by_intranet_id id\n p.update_attributes :subject => (doc/'subject').text,\n :body => (doc/'body').text, :post_type => (doc/'post-type').text,\n :pic => (doc/'pic') .text, :begin_on=>(doc/'begin-on').text,\n :pic_postimg => (doc/'pic-postimg').text,\n :video => (doc/'video').text, \n :end_on => (doc/'end-on').text, :stick => (doc/'stick').text \n render :text => \"ok\"\n end", "def post_read\n \n mark = ViewCountPost.new\n mark.post_id = params[:id]\n mark.ip_adress = request.remote_ip\n mark.save\n \n @post = Post.find(params[:id])\n @intab = Intab.where(:id => @post.intab_id).take\n @tab = Tab.where(:id => @intab.tab_id).take\n \n posts_same_intab = @intab.posts.all\n @pg = posts_same_intab.count/15\n \n @ppp = []\n posts_same_intab.each do |x|\n @ppp << x.id\n end\n \n end", "def element_subcategory; end", "def posts\n @browser.divs(:class, 'post').map { |div| PostSummary.new(div) }\n end", "def posts\n @browser.divs(:class, 'post').map { |div| PostSummary.new(div) }\n end", "def extract_posts(doc, t)\n doc.search('post').each do |post|\n post_url = post['url']\n small_image_url = post.search('photo-url[@max-width=\"400\"]').first\n if small_image_url\n small_image_url = small_image_url.content\n max_image_url = post.search('photo-url[@max-width=\"1280\"]').first\n if max_image_url\n max_image_url = max_image_url.content\n end\n\n # try to locate a possible original blog\n via = nil\n link = post.search('photo-link-url').first\n if link\n link = validate_url(link.content)\n if link =~ TEST_TUMBLR_REGEX\n via = root_url(link)\n end\n end\n if via\n caption = post.search('photo-caption').first\n if caption\n Nokogiri::HTML.fragment(caption.content).search('a').each do |a|\n unless via\n href = a['href']\n if href && (href =~ TEST_TUMBLR_REGEX)\n via = root_url(href)\n end\n end\n end\n end\n end\n t_via =via ? (Tumblr.filter(:url => via).first || Tumblr.create(:url => via)) : nil\n unless Post.filter(:url => post_url).first\n Post.create(:url => post_url,\n :small_image_url => small_image_url,\n :max_image_url => max_image_url,\n :tumblr => t,\n :timestamp => Time.at(post['unix-timestamp'].to_i).send(:to_datetime),\n :via => t_via)\n end\n else\n p post\n end\n end\n end", "def build_post_from_entry(entry)\n text = entry.text.gsub(/\\\\u([0-9a-zA-Z]{4})/) { |s| [$1.to_i(16)].pack(\"U\") }\n self.posts.build(\n :service_action => Service::SERVICE_ACTION_POST,\n :identifier => entry.id.to_s,\n :title => text,\n :markup => Post::HTML_MARKUP,\n :summary => text,\n :url => \"#{self.profile_url}/status/#{entry.id}\",\n :published_at => entry.created_at.to_time,\n :extra_content => {\n :original_tags => self.search_for_hashtags(text) # array de tags\n }\n )\n end", "def mp_business_trip(mp, page)\n doc = utf_page page\n #printf \"mp from db #{page.match(/(p_asm_id=)(\\d+)/)[2]} \\n\"\n trip_list = doc.at(\"//div[@id='divDesContent']\")\n (trip_list/:table).each do |trip|\n trip_desc = (trip/:td)[1].inner_text.gsub(\"\\n\", \" \") #ismest visus new line\n #1. backref istraukia sali - ?!.* reiskia rasti tik paskutini elementa, siuo atveju paskutini skliausteli\n #2. backref istraukia keliones pradzios data\n #3. backref istraukia keliones pabaigos data\n description = trip_desc.match(/(?!.*\\()(\\D+)\\), (\\d{4}-\\d{2}-\\d{2})–(\\d{4}-\\d{2}-\\d{2})/)\n # splitinti per kablelius nes kartais vizitas buna aprasytas ne kaip (Latvijos Respublika)\n # o kaip (Latvijos Respublika, Estijos Respublika)\n description[1].split(', ').each do |visited_state|\n printf \"#{visited_state}\\n\" \n st = StateLabel.find_by_label(visited_state).state\n if st\n t = Trip.create(\n :state => st,\n :kind => 'komandiruote',\n :politician => Politician.find_by_id_in_lrs(page.match(/(p_asm_id=)(\\d+)/)[2]),\n :start_date => Date.strptime(description[2], \"%Y-%m-%d\"),\n :end_date => Date.strptime(description[3], \"%Y-%m-%d\") )\n\n else\n printf \"KLAIDA #{mp.name_in_reports} '#{description[1]}' NERASTA !!!!!!!!!!!!!!!!!!\\n\"\n end\n end\n end\n end", "def elements; end", "def elements; end", "def elements; end", "def mambo_no_5; end", "def build_post_from_entry(entry, action)\n date = if (action == Service::SERVICE_ACTION_POST) || (self.posts.count == 0)\n entry[:pubDate]\n else\n Time.current\n end\n\n self.posts.build(\n :summary => (entry[:description].blank? ? '-' : entry[:description]),\n :service_action => action,\n :identifier => entry[:guid].to_s,\n :title => entry[:title],\n :markup => Post::PLAIN_MARKUP,\n :url => entry[:link],\n :published_at => date,\n :extra_content => {\n :author_name => entry[:author_name],\n :original_tags => entry[:categories] # array de tags\n }\n )\n end", "def build_post_from_entry(entry)\n self.posts.build(\n :summary => entry[:description],\n :service_action => Service::SERVICE_ACTION_POST,\n :identifier => entry[:guid].to_s,\n :title => entry[:title],\n :markup => Post::PLAIN_MARKUP,\n :url => entry[:link],\n :published_at => entry[:pubDate]\n )\n end", "def promotion\r\n\r\n end", "def output_post_model\n #post_doc\n out_post=\"\"\n #puts \"output_post_model:post doc\";p @post_doc\n unless @post_doc.empty?\n post_doc=\"\\n\"+@post_doc.join(\"\\n\")\n txt= post_doc \n parse(txt)\n end\n unless @post_model.empty?\n post_model=\"\\n\"+@post_model.join(\"\\n\")\n txt= post_model \n out_post << parse(txt)\n end\n#p out_post\n return out_post\n end", "def nodes\n state.post.post_nodes\n end", "def end_element(element)\n\t\t\t\t#puts \"End element: #{element}\"\n\t\t\t\t@tag = nil\n\t\t\t\tcase element\n\t\t\t\t\twhen \"vuln:cve-id\"\n\t\t\t\t\t\t@entry.attributes = { :cve => @vals[\"vuln:cve-id\"] }\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:published-datetime\"\n\t\t\t\t\t\t@entry.attributes = { :published_datetime => @vals[\"vuln:published-datetime\"]\t}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:last-modified-datetime\"\n\t\t\t\t\t\t@entry.attributes = { :last_modified_datetime => @vals[\"vuln:last-modified-datetime\"]\t}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:summary\"\n\t\t\t\t\t\t@entry.attributes = { :summary => @vals[\"vuln:summary\"] }\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:security-protection\"\n\t\t\t\t\t\t@entry.attributes = { :security_protection => @vals[\"vuln:security-protection\"]}\n\t\t\t\t\t\t@entry.save\n\n\t\t\t\t\twhen \"vuln:product\"\n\t\t\t\t\t\t@product = @entry.vulnerable_software_lists.create\n\t\t\t\t\t\t@product.attributes = { :product => @vals[\"vuln:product\"] }\n\t\t\t\t\t\t@product.save\n\n\t\t\t\t\twhen \"vuln:cvss\"\n\t\t\t\t\t\t@cvss.attributes = {\n\t\t\t\t\t\t\t:score => @vals[\"cvss:score\"],\n\t\t\t\t\t\t\t:access_vector => @vals[\"cvss:access-vector\"],\n\t\t\t\t\t\t\t:access_complexity => @vals[\"cvss:access-complexity\"],\n\t\t\t\t\t\t\t:authenication => @vals[\"cvss:authentication\"],\n\t\t\t\t\t\t\t:confidentiality_impact => @vals[\"cvss:confidentiality-impact\"],\n\t\t\t\t\t\t\t:integrity_impact => @vals[\"cvss:integrity-impact\"],\n\t\t\t\t\t\t\t:availability_impact => @vals[\"cvss:availability-impact\"],\n\t\t\t\t\t\t\t:source => @vals[\"cvss:source\"],\n\t\t\t\t\t\t\t:generated_on_datetime => @vals[\"cvss:generated-on-datetime\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@cvss.save\n\n\t\t\t\t\twhen \"vuln:references\"\n\t\t\t\t\t\t@reference.attributes = {\n\t\t\t\t\t\t\t:source => @vals[\"vuln:source\"],\n\t\t\t\t\t\t\t:reference => @vals[\"vuln:reference\"]\n\t\t\t\t\t\t}\n\t\t\t\t\t\t@reference.save\n\t\t\t\tend\n\t\t\tend", "def prapor_quest; end", "def test_ID_25890_published_posts_02\n login_as_user1\n go_to_edit_profile_page\n $profile_your_posts.click\n sleep 5\n $profile_published.when_present(60).click\n verify_text \"test_ID_25890_published_posts\",\"Your Posts\",\"Drafts\", \"Scheduled\", \"Published\",\"Submitted Drafts \",\"Published\"\n verify_elements_on_published_post \"test_ID_25890_published_posts\"\n end", "def cms_get_post cpid = 1, tpl = :cms_body_post\n\t\t@res = {}\n\t\tds = DB[:cms_post].filter(:cpid => cpid.to_i)\n\n\t\tunless ds.empty?\n\t\t\t@title \t\t\t= ds.get(:title) + \" - \" + @title\n\t\t\t@res \t\t\t= ds.first\n\t\t\t@description \t= ds.get(:title)\n\t\t\t_parser_init :no_intra_emphasis => true\n\t\tend\n\t\t_tpl tpl\n\tend", "def import_posts_to_li settings, posts, agent\n puts '********* Post to LinkedIn **************'\n\n posts.each do |post|\n agent.get (settings[:group_url])\n form = agent.page.forms_with(:action => '/groups').first\n form.postTitle = \"#{post[:link]} | #{post[:title]}\"\n form.postText =\"#{post[:link]} #{10.chr} #{post[:title]}\"\n form.field_with(:id => \"post-twit-account-select\").value = settings[:twitter_id]\n form.checkbox_with(:name => /tweet/).check\n form.submit\n ap '[LI]===> ' + post[:title]\n end\n\nend", "def scrape_individual_offer(offer_object, url)\n puts \"Pulling details from posting #{url}\"\n domain = 'https://www.indeed.com.mx/'\n html_content = open(domain + url).read\n doc = Nokogiri::HTML(html_content)\n description = doc.search('.jobsearch-jobDescriptionText')\n offer_object[:description] = description # unrefined but workable\n collect_posting_date(doc, offer_object)\n collect_job_type(description.text.downcase, offer_object)\n collect_tags_indeed(description.text.downcase, offer_object)\n sleep 0.7\n end", "def urgent\n @postings=Posting.page(params[:page]).per(12)\n\n end", "def eplore\n end", "def post_to_ssml(post)\n read_more_text = \"The remainder of this post cannot be read due to it's length, however you can read the rest at spin.atomicobject.com!\"\n result = OPENING_TAG\n result = OPENING_TAG + \"#{post[:title]}<break strength=\\\"medium\\\"/> by #{post[:author]}<break time=\\\"1s\\\"/>\"\n result = post[:body_sections].inject(result) do |memo, section|\n next_section = \"#{section}<break time=\\\"1s\\\"/>\"\n if ((PADDING_LEN + memo.length + next_section.length + read_more_text.length + CLOSING_TAG.length) > MAX_RESPONSE_LEN)\n puts \"Truncating post\"\n break memo << read_more_text\n end\n memo << next_section\n memo\n end\n result << CLOSING_TAG\n puts \"Result json length: #{result.to_json.length}\" \n result\nend", "def set_post\n @post = current_unit.posts.find(params[:post_id])\n end", "def fetch_create_post\n end", "def post\n array = []\n Post.post.each do |element|\n if element.user_id == self.user_id\n array << element\n end\n end\n array.each do |post|\n puts post.title\n end\n end", "def raw_post; end", "def total_posts; end", "def post_ad\n # the post_ad method is defined in lib/post_o_matic.rb. the method creates a new listing on kingsnake.com\n # and returns true or false, depending on whether or not it was posted.\n is_posted = super\n if is_posted\n update_posted_ad!\n end\n is_posted\n end", "def dom_id; end", "def dom_id; end", "def dom_id; end", "def dom_id; end", "def element?; end", "def element?; end", "def upc_e; end", "def publication_place\n end", "def post_type; model_name; end", "def post_type; model_name; end", "def post\n @post ||= Post[post_id]\n end", "def initialize(name) #new\n @name = name\n @@posts << self #post has many posts pt2\n end", "def process_post\n\t\traise \"Ehh, What's up Doc?\"\n\tend", "def entity content\n end", "def entities; end", "def feed_explanation\n end", "def index\n #@posts = Post.all\n @posts = Post.getVisible('t')\n all_invisible_posts = Post.getVisible('f')\n @scheduled_posts = []\n\n @invisible_posts = []\n\n all_invisible_posts.each do |inv_post|\n job = @@scheduler.find_by_tag(inv_post.id.to_s)\n puts \"job class: \"+job[0].class.to_s\n\n if !job[0].nil?\n puts \"scheduled job: \"+job[0].inspect\n inv_post.scheduled_job = job[0]\n @scheduled_posts << inv_post\n else\n @invisible_posts << inv_post\n end\n\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "def collect_posting_date(doc, offer_object)\n puts \"Mining posting date\"\n meta = doc.at('script:contains(\"localeData\")')\n # extract CDATA\n meta = meta.children[0].content\n date = meta.match(/Creation-Date:([^\\\\]+)/)[1]\n date[0] = ''\n offer_object[:posting_date] = date.to_datetime\n end", "def formation; end", "def condition_summary(label, post)\n burdens = post.conditions.order(:category).limit(5)\n burden_point = 0\n burdens.each do |burden|\n burden_point += burden.point\n end\n burden_result = \"\"\n burden_class = \"\"\n if burden_point >= 20 && burden_point <= 36\n burden_result = \"注意\"\n burden_class = \"danger\"\n elsif burden_point >= 37 && burden_point <= 84\n burden_result = \"ふつう\"\n burden_class = \"warning\"\n elsif burden_point >= 85 && burden_point <= 100\n burden_result = \"良好\"\n burden_class = \"info\"\n else\n burden_result = \"なし\"\n end\n\n motivations = post.conditions.order(:category).reverse_order.limit(5)\n motivation_point = 0\n motivations.each do |motivation|\n motivation_point += motivation.point\n end\n motivation_result = \"\"\n motivation_class = \"\"\n if motivation_point >= 20 && motivation_point <= 44\n motivation_result = \"低\"\n motivation_class = \"danger\"\n elsif motivation_point >= 45 && motivation_point <= 76\n motivation_result = \"中\"\n motivation_class = \"warning\"\n elsif motivation_point >= 77 && motivation_point <= 100\n motivation_result = \"高\"\n motivation_class = \"info\"\n else\n motivation_result = \"なし\"\n end\n\n result = {}\n\n if label == \"detail\"\n result = {\n burden: { class: burden_class, title: burden_result },\n motivation: { class: motivation_class, title: motivation_result }\n }\n return result\n end\n\n if burden_result == \"注意\" && motivation_result == \"低\"\n result = {\n class: \"exhausted\",\n title: \"ヘトヘト\",\n image: \"danger.png\",\n subtitle: \"心身ともに限界の状態\",\n description: \"\"\n }\n elsif burden_result == \"注意\" && (motivation_result == \"中\" || motivation_result == \"低\")\n result = {\n class: \"aggressive\",\n title: \"ギリギリ\",\n image: \"warning.png\",\n subtitle: \"ギリギリな状態\",\n description: \"\"\n }\n elsif (burden_result == \"ふつう\" || burden_result == \"良好\") && motivation_result == \"低\"\n result = {\n class: \"gloomy\",\n title: \"モヤモヤ\",\n image: \"warning.png\",\n subtitle: \"モヤモヤな状態\",\n description: \"\"\n }\n elsif (burden_result != \"注意\" && motivation_result != \"低\") &&\n (burden_result != \"なし\" && motivation_result != \"なし\")\n result = {\n class: \"vivacious\",\n title: \"イキイキ\",\n image: \"info.png\",\n subtitle: \"仕事に打ち込めている状態\",\n description: \"\"\n }\n else\n result = {\n class: \"nothing\",\n title: \"未回答\",\n image: \"blank.png\",\n subtitle: \"こころチェックは行われておりません\",\n description: \"質問に回答して自分のこころの状態を確認しましょう。\"\n }\n end\n\n case label\n when \"class\"\n return result[:class]\n when \"title\"\n return result[:title]\n when \"image\"\n return result[:image]\n when \"subtitle\"\n return result[:subtitle]\n when \"description\"\n return result[:description]\n else\n end\n end", "def footnote_content; end", "def getPosts()\n\t\tself.post\n\tend", "def test02_post_closed_blog_250RepostNote\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_blogs_post_closed_note)\n\t\t\n \t\trepostPopulate250\n \t\tsleep 3\n\t\t\n\t\tassert $repost_confirmation.exists?\n\tend", "def process_article(art)\n this_pub = {}\n \n # if not table of figure or equation remove reference\n # a.zip(b) zipped lists\n both = art.xpath('//xref/@ref-type').zip(art.xpath('//xref'))\n both.each do |tag,elem| \n if tag.text != 'table' || tag.text != 'fig' || tag.text != 'fn' || tag.text != 'sec' || tag.text != 'disp-formula'\n elem.remove\n end\n end\n\n jrn_meta = art / \"article/front/journal-meta\"\n this_pub[:jrn_id] = (jrn_meta / \"journal-id[journal-id-type='nlm-ta']\").text\n art_meta = art / \"/article/front/article-meta\"\n\n this_pub[:pmid] = (art_meta / \"article-id[pub-id-type='pmid']\").text\n\n this_pub[:pmcid] = (art_meta / \"article-id[pub-id-type='pmc']\").text\n# this_pub[:doi] = (art_meta / \"article-id[pub-id-type='doi']\").text\n\n # title\n title_node = (art_meta / \"title-group/article-title\")\n \n # SDB Note 8/2016\n # Turns out that some of the article titles include footnotes or super/subscripts which occurred at the end of a title, \n # which are represented by embedded tags (e.g. <fn> or something like that),and calling .text on the title node was \n # including those (and messing stuff up in the process).\n # We thought that we only needed to worry about tags at the end of titles, and so for trec CDS 2016 we just used the first child node and called it good.\n # This turned out to be insufficient- in the latest PMC release, there are titles with italic text (cf. PMC1079931),\n # and the approach below fails in these cases. \n # TODO: a more robust title-parsing algorithm\n \n if title_node.children.size > 1\n this_pub[:title] = title_node.children.first.text.strip\n else\n this_pub[:title] = title_node.text.strip\n end\n\n # pub_year\n # if ppub, use that; else use collection\n ppub = (art_meta / \"pub-date[pub-type='ppub']/year\").text\n epub = (art_meta / \"pub-date[pub-type='epub']/year\").text\n year = nil\n if ppub.strip.length > 0\n year = ppub.strip\n else\n year = epub.strip\n end\n this_pub[:year] = year \n\n # abstract (if present)\n abst_node = art_meta / \"abstract\"\n \n this_pub[:abstract] = {}\n if abst_node.length == 0\n this_pub[:abstract][:full] = \"\"\n elsif (abst_node / \"sec\").size > 0 # structured abstract (inc. section headings)\n abstract_full = \"\" \n # go through each section, and get the parts out in some kind of order\n (abst_node / \"sec\").each do |s|\n # rm furmulas\n s.search('//p/disp-formula').each do |node|\n node.remove\n end \n s.search('//p/inline-formula').each do |node|\n node.remove\n end\n s.search('//title/disp-formula').each do |node|\n node.remove\n end\n s.search('//title/inline-formula').each do |node|\n node.remove\n end\n ti = (s / \"title\").text.strip\n body = (s / \"p\").text.strip\n # clean leftovers of xref\n body = body.gsub(/\\(-*\\)/, \"\")\n body = body.gsub(/\\[,*\\]/, \"\")\n body = body.gsub(/\\[-*\\]/, \"\")\n body = body.gsub(/\\(,*\\)/, \"\")\n ti = ti.gsub(/\\[-*\\]/, \"\")\n ti = ti.gsub(/\\(,*\\)/, \"\")\n ti = ti.gsub(/\\(-*\\)/, \"\")\n ti = ti.gsub(/\\[,*\\]/, \"\")\n abstract_full << ti << \"\\n\"\n abstract_full << body << \"\\n\"\n end\n this_pub[:abstract][:full] = abstract_full.strip\n end\n if (abst_node / \"p\").size > 0 # unstructured abstract\n abstract_full = this_pub[:abstract][:full].to_s\n (abst_node / \"p\").each do |s|\n s.search('//disp-formula').each do |node|\n node.remove\n end\n s.search('//inline-formula').each do |node|\n node.remove\n end\n abs = s.text.strip\n abs = abs.gsub(/\\[-*\\]/, \"\")\n abs = abs.gsub(/\\(,*\\)/, \"\")\n abs = abs.gsub(/\\(-*\\)/, \"\")\n abs = abs.gsub(/\\[,*\\]/, \"\")\n abstract_full << abs << \"\\n\"\n end\n this_pub[:abstract][:full] = abstract_full\n else\n STDERR.puts \"Other format found: \" + (art_meta / \"article-id[pub-id-type='pmc']\").text\n this_pub[:abstract][:full] = \"\"\n end\n \n # now do body- similar deal\n this_pub[:body] = {}\n body_node = art / \"/article/body\"\n \n if (body_node / \"sec\").size > 0\n body_full = \"\"\n (body_node / \"sec\").each do |s|\n # rm xref\n # rm furmulas\n s.search('//p/disp-formula').each do |node|\n node.remove\n end\n s.search('//p/inline-formula').each do |node|\n node.remove\n end\n s.search('//title/disp-formula').each do |node|\n node.remove\n end\n s.search('//title/inline-formula').each do |node|\n node.remove\n end\n s.search('//fig/caption/p/disp-formula').each do |node|\n node.remove\n end\n s.search('//fig/caption/p/inline-formula').each do |node|\n node.remove\n end\n s.search('//table-wrap/table-wrap-foot/p/disp-formula').each do |node|\n node.remove\n end\n s.search('//table-wrap/table-wrap-foot/p/inline-formula').each do |node|\n node.remove\n end\n s.search('//table-wrap/table-wrap-foot/fn/disp-formula').each do |node|\n node.remove\n end\n s.search('//table-wrap/table-wrap-foot/fn/inline-formula').each do |node|\n node.remove\n end\n\n ti = (s / \"title\").text.strip\n body = (s / \"p\").text.strip\n fig_cap = (s / \"fig/caption/p\").text.strip\n tbl_cap = (s / \"table-wrap/table-wrap-foot/p\").text.strip\n tbl_fn = (s / \"table-wrap/table-wrap-foot/fn\").text.strip\n\n # clean leftovers of xref\n ti = ti.gsub(/\\[-*\\]/, \"\")\n ti = ti.gsub(/\\(,*\\)/, \"\")\n ti = ti.gsub(/\\(-*\\)/, \"\")\n ti = ti.gsub(/\\[,*\\]/, \"\")\n body = body.gsub(/\\[-*\\]/, \"\")\n body = body.gsub(/\\(,*\\)/, \"\")\n body = body.gsub(/\\(-*\\)/, \"\")\n body = body.gsub(/\\[,*\\]/, \"\")\n fig_cap = fig_cap.gsub(/\\[-*\\]/, \"\")\n fig_cap = fig_cap.gsub(/\\(,*\\)/, \"\")\n fig_cap = fig_cap.gsub(/\\(-*\\)/, \"\")\n fig_cap = fig_cap.gsub(/\\[,*\\]/, \"\")\n tbl_cap = tbl_cap.gsub(/\\[-*\\]/, \"\")\n tbl_cap = tbl_cap.gsub(/\\(,*\\)/, \"\")\n tbl_cap = tbl_cap.gsub(/\\(-*\\)/, \"\")\n tbl_cap = tbl_cap.gsub(/\\[,*\\]/, \"\")\n tbl_fn = tbl_fn.gsub(/\\[-*\\]/, \"\")\n tbl_fn = tbl_fn.gsub(/\\(,*\\)/, \"\")\n tbl_fn = tbl_fn.gsub(/\\(-*\\)/, \"\")\n tbl_fn = tbl_fn.gsub(/\\[,*\\]/, \"\")\n body_full << ti << \"\\n\"\n body_full << body << \"\\n\"\n body_full << fig_cap << \"\\n\"\n body_full << tbl_cap << \"\\n\"\n body_full << tbl_fn << \"\\n\"\n end\n this_pub[:body][:full] = body_full.strip\n end\n\n if (body_node / \"p\").size > 0 # found the sec and p can coexist 2660466.nxml\n body_full = this_pub[:body][:full].to_s\n (body_node / \"p\").each do |s|\n s.search('//disp-formula').each do |node|\n node.remove\n end\n s.search('//inline-formula').each do |node|\n node.remove\n end\n body = s.text.strip\n body = body.gsub(/\\[-*\\]/, \"\")\n body = body.gsub(/\\(,*\\)/, \"\")\n body = body.gsub(/\\(-*\\)/, \"\")\n body = body.gsub(/\\[,*\\]/, \"\")\n body_full << body << \"\\n\"\n end\n this_pub[:body][:full] = body_full \n else\n STDERR.puts \"Serious weirdness in body: \"+ (art_meta / \"article-id[pub-id-type='pmc']\").text\n end\n \n \n return this_pub\nend", "def posti_disponibili\n self.vehicle.posti - self.n_passeggeri\n end", "def post_params\n params.require(:post).permit(:title, :body, :body2, :published, :start_date, :end_date, :post_type, :image, :is_event, :on_homepage,\n :event_date, :event_time, :event_location, :event_link, :image1, :image2, :image3, :imagewidth1, :imagewidth2, :imagewidth3,\n watanprogram_ids: [], institute_ids: [],\n )\n end", "def post\n discussion.post\n end", "def donizetti; end", "def parse (node, oeCount)\n\t\thash = {}\n\t\tpid = node['id'].split('_').last\n\t\thash[:pid] = pid\n\t\thash[:quantity] = node.css('#'+pid.to_s).text\n\t\thash[:title] = node.css('.itemTitle').text\n\t\thash[:price] = node.css('.normalprice').text\n\t\thash[:sale] = node.css('.productSalePrice').text\n\t\treturn hash\n\tend", "def view_post\n content \n end", "def index\n @page_elements = @page.page_elements\n if (@page)\n @mainelements = @page.page_elements.where(visible: true,sidebar: false)\n @sidebarelements = @page.page_elements.where(visible:true,sidebar: true)\n end\n if(@mainelemnents) && (@mainelements.count > 1)\n @mainelements = @mainelements.sort_by{ |x| x[:displayIndex]}\n end\n @poster = @council.posts\n @rest = @page.page_elements.where(visible: false)\n end", "def get_comments(post_or_comment)\n post_or_comment.in_e(:IS_ABOUT).out_v(type: 'comment')\nend", "def related_posts; end", "def list_posts(api_object)\r\n puts \"Current Post:\"\r\n doc = Nokogiri::XML.parse api_object.read\r\n contents= doc.xpath('posts/post/content').collect {|e| e.text }\r\n puts contents.join(\", \")\r\n puts \"\"\r\nend", "def extract_related_content\n end", "def bizet; end", "def render_article(p)\n r = \"\"\n r += p.authors.map {|a| a.abbreviated_name}.joined_by_comma_and_and + \". \"\n r += p.title.detex.titlecase + \". \"\n\n r += text_for_field(\"Journal\", p, :postfix => \", \").detex\n r += text_for_field(\"Volume\", p)\n r += text_for_field(\"Number\", p, :prefix => \"(\", :postfix => \")\").detex\n\n # TODO simplify this complex nested if structures that result from the conversion\n # from BibDesks abbrv template\n if field(p,\"Pages\") then # <$fields.Pages?>\n if field(p,\"Volume\") then # <$fields.Volume?>\n r += \":\"\n else # <?$fields.Volume?>\n if field(p,\"Number\") then #<$fields.Number?>\n r+= \":\"\n else # <?$fields.Number?>\n r += \"page \"\n end # </$fields.Number?>\n end # </$fields.Volume?>\n\n r += text_for_field(\"Pages\", p, :postfix => \", \").detex # <$fields.Pages/>,\n else # <?$fields.Pages?>\n if field(p,\"Volume\") then #<$fields.Volume?>\n r += \", \"\n else # <?$fields.Volume?>\n if field(p,\"Number\") then #<$fields.Number?>\n r += \", \"\n end #</$fields.Number?>\n end\n end #</$fields.Pages?>\n\n r += month_for_field(\"Month\", p, :postfix => \" \").detex\n r += text_for_field(\"Year\", p, :postfix => \". \").detex\n r += text_for_field(\"Note\", p, :postfix => \". \")\n return r\nend", "def malts; end", "def manufacture; end", "def entry; end", "def entry; end", "def entry; end", "def entry; end", "def is_post?\n is_entry? && params[:_entry_type_] == 'post'\n end", "def recent_posts(posts)\n # last 10 posts of offers and inquiries\n @offers = posts.where(type: \"Offer\").take(10)\n @inquiries = posts.where(type: \"Inquiry\").take(10)\n\n @organization_name = posts.take.organization.name\n\n mail(bcc: emails_newsletter(posts))\n end", "def page_struct; end", "def ask_post\n page(MorePage).select_more_actions(\"Ask HN\")\n page(MorePage).page_handler(\"Ask HN\")\n page(FeedDetailsPage).touch_row\n page(NavTabBarPage).select_storytab(\"Reply\")\n page(SubmissionPage).create_post(\"reply post\")\n page(NavTabBarPage).flag_handler(\"Cancel\")\n page(SubmissionPage).touch_discard\n page(SubmissionPage).await\n page(MorePage).backpage\n page(MorePage).page_handler(\"Ask HN\")\n page(MorePage).backpage\n end", "def enhance_referent(body, request) \n doc = Nokogiri::XML(body)\n return unless cite = doc.at(\"PubmedArticleSet/PubmedArticle/MedlineCitation\") # Nothing of interest here\n \n return unless article = cite.at(\"Article\") # No more useful metadata \n if abstract = article.at(\"Abstract/AbstractText\")\n request.add_service_response( \n :service=>self,\n :display_text => \"Abstract from #{@display_name}\",\n :content => abstract.inner_text,\n :service_type_value => 'abstract') unless abstract.inner_text.blank? \n end\n \n if journal = article.at(\"Journal\")\n if issn = journal.at('ISSN')\n if issn.attributes['issntype']==\"Print\" \n request.referent.enhance_referent('issn', issn.inner_html)\n else \n request.referent.enhance_referent('eissn', issn.inner_html) \n end\n end\n if jrnlissue = journal.at('JournalIssue')\n if volume = jrnlissue.at('Volume')\n request.referent.enhance_referent('volume', volume.inner_text)\n end\n if issue = jrnlissue.at('Issue')\n request.referent.enhance_referent('issue', issue.inner_text)\n end \n if date = jrnlissue.at('PubDate') \n \n request.referent.enhance_referent('date', openurl_date(date))\n \n end \n end\n \n if jtitle = journal.at('Title')\n request.referent.enhance_referent('jtitle', jtitle.inner_text) \n end\n if stitle = journal.at('ISOAbbreviation')\n request.referent.enhance_referent('stitle', stitle.inner_text)\n end \n \n if atitle = article.at('ArticleTitle')\n request.referent.enhance_referent('atitle', atitle.inner_text)\n end \n \n if pages = article.at('Pagination/MedlinePgn')\n page_str = pages.inner_text\n request.referent.enhance_referent('pages', page_str)\n if spage = page_str.split(\"-\")[0]\n request.referent.enhance_referent('spage', spage.strip)\n end\n end \n \n if author = article.at('AuthorList/Author')\n if last_name = author.at('LastName')\n request.referent.enhance_referent('aulast', last_name.inner_text)\n end\n if first_name = author.at('ForeName')\n request.referent.enhance_referent('aufirst', first_name.inner_text)\n end \n if initials = author.at('Initials')\n request.referent.enhance_referent('auinit', initials.inner_text)\n end \n end \n end \n \n end", "def skips_post \n @skips_post\n end", "def post #:doc:\n end", "def element_state; end", "def parse_facts(elem)\n para = elem.following_siblings()[0]\n values = para.search(\"strong\")\n launchdate = nil\n launchvehicle = nil\n launchsite = nil\n values.each { |value| \n field_name = value.inner_html\n field_value = value.next.to_plain_text.gsub /^\\s/, \"\"\n # substrings are a hack for presence of &nbsp; at the start of some values\n if field_name == \"Launch Date:\"\n launchdate = field_value \n elsif field_name == \"Launch Vehicle:\"\n launchvehicle = field_value\n elsif field_name == \"Launch Site:\" \n launchsite = field_value\n elsif field_name == \"Mass:\"\n @mass = field_value.gsub /\\skg/, \"\"\n elsif field_name == \"Nominal Power:\"\n #\"Nominal Power: 375.0 W\", 1966-073A.html \n @nominalPower = clean_ws( field_value.gsub(/\\sW/, \"\") ).gsub /\\s/, \"\"\n else\n puts \"Unknown field: #{field_name}\"\n end\n \n }\n @launch = Launch.new(launchdate, launchsite, @id, launchvehicle)\n end", "def business_decision_support \n end", "def elementsToJSON(oldData, elemPubID, submitterEmail, metaHash, ark, feedFile)\n\n # eSchol ARK identifier (provisional ID minted previously for new items)\n data = oldData ? oldData.clone : {}\n data[:id] = ark\n\n # Identify the source system\n data[:sourceName] = 'elements'\n data[:sourceID] = elemPubID\n data[:sourceFeedLink] = \"#{$submitServer}/bitstreamTmp/#{feedFile}\"\n\n # Object type, flags, status, etc.\n elementsPubType = metaHash.delete('object.type') || raise(\"missing object.type\")\n elementsPubStatus = metaHash['publication-status'] || nil\n elementsIsReviewed = metaHash.delete('is-reviewed') || nil\n \n data[:isPeerReviewed] = getDefaultPeerReview(elementsIsReviewed, elementsPubType, elementsPubStatus)\n\n data[:type] = convertPubType(elementsPubType)\n data[:isPeerReviewed] = true # assume all Elements items are peer reviewed\n if (elementsPubType == 'preprint' ||\n (elementsPubType == 'journal-article' &&\n (elementsPubStatus == 'In preparation' ||\n elementsPubStatus == 'Submitted' ||\n elementsPubStatus == 'Unpublished') ) ) \n data[:isPeerReviewed] = false # assume preprints are not peer reviewed\n end \n data[:pubRelation] = convertPubStatus(metaHash.delete('publication-status'))\n data[:embargoExpires] = assignEmbargo(metaHash)\n\n # Author and editor metadata.\n metaHash['authors'] && data[:authors] = transformPeople(metaHash.delete('authors'), nil)\n if metaHash['editors'] || metaHash['advisors']\n contribs = []\n metaHash['editors'] and contribs += (transformPeople(metaHash.delete('editors'), 'EDITOR') || [])\n metaHash['advisors'] and contribs += (transformPeople(metaHash.delete('advisors'), 'ADVISOR') || [])\n !contribs.empty? and data[:contributors] = contribs\n end\n\n # Other top-level fields\n metaHash.key?('title') and data[:title] = sanitizeHTML(metaHash.delete('title')).gsub(/\\s+/, ' ').strip\n metaHash.key?('abstract') and data[:abstract] = sanitizeHTML(metaHash.delete('abstract'))\n data[:localIDs] = []\n metaHash.key?('doi') and data[:localIDs] << { id: metaHash.delete('doi'), scheme: 'DOI' }\n data[:localIDs] << {id: elemPubID, scheme: 'OA_PUB_ID'}\n metaHash.key?('fpage') and data[:fpage] = metaHash.delete('fpage')\n metaHash.key?('lpage') and data[:lpage] = metaHash.delete('lpage')\n metaHash.key?('keywords') and data[:keywords] = convertKeywords(metaHash.delete('keywords'))\n if metaHash.key?('requested-reuse-licence.short-name')\n if metaHash['requested-reuse-licence.short-name'] != \"No Licence\"\n ccCode = metaHash.delete('requested-reuse-licence.short-name')\n data[:rights] = \"https://creativecommons.org/licenses/#{ccCode.sub(\"CC \", \"\").downcase}/4.0/\"\n end\n end\n metaHash.key?('funder-name') and data[:grants] = convertFunding(metaHash)\n #metaHash.key?('funder-type-display-name')\n\n # Context\n assignSeries(data, getCompletionDate(data, metaHash), metaHash)\n lookupRepecID(elemPubID) and data[:localIDs] << { scheme: 'OTHER_ID', subScheme: 'repec', id: lookupRepecID(elemPubID) }\n metaHash.key?(\"report-number\") and data[:localIDs] << {\n scheme: 'OTHER_ID', subScheme: 'report', id: metaHash.delete('report-number')\n }\n metaHash.key?(\"issn\") and data[:issn] = metaHash.delete(\"issn\")\n metaHash.key?(\"isbn-13\") and data[:isbn] = metaHash.delete(\"isbn-13\") # for books and chapters\n metaHash.key?(\"journal\") and data[:journal] = metaHash.delete(\"journal\")\n metaHash.key?(\"proceedings\") and data[:proceedings] = metaHash.delete(\"proceedings\")\n metaHash.key?(\"volume\") and data[:volume] = metaHash.delete(\"volume\")\n metaHash.key?(\"issue\") and data[:issue] = metaHash.delete(\"issue\")\n metaHash.key?(\"parent-title\") and data[:bookTitle] = metaHash.delete(\"parent-title\") # for chapters \n metaHash.key?(\"oa-location-url\") and convertOALocation(ark, metaHash, data)\n data[:ucpmsPubType] = elementsPubType\n\n # History\n data[:published] = convertPubDate(metaHash.delete('publication-date'))\n data[:submitterEmail] = submitterEmail\n\n # Custom Citation Field\n metaHash.key?(\"custom-citation\") and data[:customCitation] = metaHash.delete(\"custom-citation\")\n\n # All done.\n return data\nend", "def feed_elements\n elements.named(definition['feed_elements'])\n end" ]
[ "0.5836325", "0.5753537", "0.5716009", "0.57122976", "0.55392325", "0.5490149", "0.5441593", "0.5418324", "0.5418324", "0.5418324", "0.5418324", "0.53666687", "0.5302566", "0.52677894", "0.526177", "0.52064645", "0.51930887", "0.51930887", "0.51759267", "0.516956", "0.5141989", "0.51305926", "0.51305926", "0.51305926", "0.5123609", "0.51007926", "0.50936717", "0.5075576", "0.5073102", "0.5055587", "0.505153", "0.50450194", "0.50230014", "0.5010487", "0.49922964", "0.49875104", "0.49759796", "0.49586686", "0.49578968", "0.49566093", "0.4950973", "0.49469495", "0.49454537", "0.4940207", "0.49388593", "0.4931861", "0.4931861", "0.4931861", "0.4931861", "0.49300465", "0.49300465", "0.491384", "0.4912015", "0.4909954", "0.4909954", "0.4903338", "0.49028516", "0.49019974", "0.4896703", "0.489584", "0.48928678", "0.489113", "0.48902506", "0.48890522", "0.4886417", "0.48845595", "0.48828438", "0.48828125", "0.48818377", "0.48807028", "0.48796925", "0.48783883", "0.48757973", "0.48733243", "0.48724824", "0.48694387", "0.4868739", "0.48603296", "0.48536325", "0.4852156", "0.48491788", "0.48397666", "0.4838026", "0.4835499", "0.48328745", "0.48328745", "0.48328745", "0.48328745", "0.48299667", "0.48269323", "0.48265043", "0.48259407", "0.4825909", "0.4820774", "0.48188618", "0.48179755", "0.48147252", "0.48073223", "0.4803968", "0.48022223" ]
0.5385723
11
core methods (resource wrappers use these to connect to Localeze)
def send_to_localeze(xml) client = Savon::Client.new(WSDL_URL) # raise xml.inspect response = client.call(:query, message: xml) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def apply_locale; end", "def locale; end", "def locale; end", "def locale; end", "def locale; end", "def locale; end", "def locale; end", "def locale; end", "def verificar_locale\n \n end", "def locale_backend; end", "def use_i18n; end", "def init_translations; end", "def language_client; end", "def locale=(_arg0); end", "def translations; end", "def language_server; end", "def set_locale\n end", "def default_locale; end", "def available_locales_set; end", "def read_locale\n raise \"Override me\"\n end", "def available_locales; end", "def available_locales; end", "def lookup_chain = locale(true).lookup", "def locale=(locale); end", "def init_linguistics\n Linguistics::use(:en)\nend", "def with_locale(tmp_locale = T.unsafe(nil), &block); end", "def available_locales_initialized?; end", "def with_locale(tmp_locale = T.unsafe(nil)); end", "def setup(resources) ; end", "def available_locales\n resource.translations.all(:fields => [:locale_tag], :unique => true).map { |t| t.locale }\n end", "def initialize(args)\n super\n @languages = {\"af\" => \"Afrikaans\", \"sq\" => \"Albanian\",\n \"ar\"=>\"Arabic\",\"be\"=>\"Belarusian\",\"bg\"=>\"Bulgarian\",\"ca\"=>\"Catalan\",\"zh-CN\"=>\"Simplified Chinese\",\n \"zh-TW\"=>\"Traditional Chinese\",\"hr\"=>\"Croatian\",\"cs\"=>\"Czech\",\"da\"=>\"Danish\",\"nl\"=>\"Dutch\",\"en\"=>\"English\",\n \"et\"=>\"Estonian\",\"tl\"=>\"Filipino\",\"fi\"=>\"Finnish\",\"fr\"=>\"French\",\"gl\"=>\"Galician\",\"de\"=>\"German\",\"el\"=>\"Greek\",\n \"iw\"=>\"Hebrew\",\"hi\"=>\"Hindi\",\"hu\"=>\"Hungarian\",\"is\"=>\"Icelandic\",\"id\"=>\"Indonesian\",\"ga\"=>\"Irish\",\"it\"=>\"Italian\",\n \"ja\"=>\"Japanese\",\"ko\"=>\"Korean\",\"lv\"=>\"Latvian\",\"lt\"=>\"Lithuanian\",\"mk\"=>\"Macedonian\",\"ms\"=>\"Malay\",\"mt\"=>\"Maltese\",\n \"no\"=>\"Norwegian\",\"fa\"=>\"Persian\",\"pl\"=>\"Polish\",\"pt\"=>\"Portuguese\",\"ro\"=>\"Romanian\",\"ru\"=>\"Russian\",\"sr\"=>\"Serbian\",\n \"sk\"=>\"Slovak\",\"sl\"=>\"Slovenian\",\"es\"=>\"Spanish\",\"sw\"=>\"Swahili\",\"sv\"=>\"Swedish\",\"th\"=>\"Thai\",\"tr\"=>\"Turkish\",\n \"uk\"=>\"Ukranian\",\"vi\"=>\"Vietnamese\",\"cy\"=>\"Welsh\",\"yi\"=>\"Yiddish\"}\n end", "def __with_locale__(locale, &block)\n yield\n end", "def configure(&block)\n block.call @locale\n end", "def load_current_resource; end", "def set_locale_resource\n @locale = Locale.find(params[:id])\n end", "def locale\n @grpc.locale\n end", "def locale\n @grpc.locale\n end", "def initialize_defaults(method_name)\r\n super\r\n @template = \"#{I18n.locale}_#{method_name}\"\r\n end", "def initialize_defaults(method_name)\r\n super\r\n @template = \"#{I18n.locale}_#{method_name}\"\r\n end", "def method_missing(method, *args)\n\t\tif self.respond_to?(method)\n\t\t\tlocalized_method = \"#{method}_#{I18n.locale}\"\n\t\t\tself.send(localized_method)\n\t\telse\n\t\t\tsuper\n\t\tend\n\tend", "def initialize_defaults(method_name)\r\n super\r\n @template = \"#{I18n.locale}_#{method_name}\"\r\n end", "def lang; end", "def lang; end", "def lang; end", "def lang; end", "def default_locale=(locale); end", "def locale\n @locale || YodleeApi.locale\n end", "def l(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end", "def explicit_locale? = @explicit_locale", "def initialize_i18n\n trusty_locale_paths = Dir[File.join(TRUSTY_CMS_ROOT, 'config', 'locales', '*.{rb,yml}')]\n configuration.i18n.load_path = trusty_locale_paths + extension_loader.paths(:locale)\n super\n end", "def fetch_translations(locale)\n self.translations ||= {}\n return if self.translations[locale]\n\n # Tml.logger.debug(\"Fetching translations for #{label}\")\n\n results = self.application.api_client.get(\n \"translation_keys/#{self.key}/translations\",\n {:locale => locale, :per_page => 10000},\n {:cache_key => Tml::TranslationKey.cache_key(locale, self.key)}\n ) || []\n\n update_translations(locale, results)\n\n self\n rescue Tml::Exception => ex\n self.translations = {}\n self\n end", "def locale\n @locales = Ramaze::Tool::Localize.languages.map{ |lang|\n [\n Ramaze::Tool::Localize.localize('locale_menu_descrition', lang),\n Ramaze::Tool::Localize.localize('locale_name', lang),\n lang\n ]\n }\n end", "def initialize_defaults(method_name)\n super\n @template = \"#{I18n.locale}_#{method_name}\"\n end", "def load_localization!\n reset_l10n_data\n\n # Load the rails localization\n if rails_localization_files\n rails_localization_files.each do |file|\n lang = File.basename(file, '.*')[0,2].downcase.to_sym\n # if a country is defined\n if File.basename(file, '.*')[3,5]\n country = File.basename(file, '.*')[3,5].upcase.to_sym\n @@countries << country if ( country != :* && !@@countries.include?(country) )\n if locales.include?(\"#{lang}-#{country}\".to_sym)\n @@locales[\"#{lang}-#{country}\".to_sym].merge(YAML.load_file(file).symbolize_keys)\n else\n @@locales[\"#{lang}-#{country}\".to_sym] = YAML.load_file(file).symbolize_keys\n @@rails_locales[locale_name(\"#{lang}-#{country}\")] = \"#{lang}-#{country}\".to_sym\n end\n @@languages << lang unless @@languages.include? lang\n else\n @@languages << lang unless @@languages.include? lang\n @f_locale = \"#{lang}-*\".to_sym\n @@locales[@f_locale] = @@locales[@f_locale].merge(YAML.load_file(file).symbolize_keys) if locales.include?(@f_locale)\n @@locales[@f_locale] = YAML.load_file(file).symbolize_keys unless locales.include?(@f_locale)\n end\n end\n end\n alias :load_translations! :load_localization!\n alias :load_localizations! :load_localization!\n\n # Load the UI localization\n if ui_localization_files\n ui_localization_files.each do |file|\n lang = File.basename(file, '.*')[0,2].downcase.to_sym\n if File.basename(file, '.*')[3,5]\n country = File.basename(file, '.*')[3,5].upcase.to_sym\n else\n country = '*'.to_sym\n end\n @@languages << lang unless @@languages.include? lang\n @@countries << country if ( country != :* && !@@countries.include?(country) )\n @file_locale = \"#{lang}-#{country}\".to_sym\n if locales.include?(@file_locale)\n @@locales[@file_locale] = @@locales[@file_locale].merge(YAML.load_file(file).symbolize_keys)\n @@ui_locales[locale_name(\"#{lang}-#{country}\")] = \"#{lang}-#{country}\".to_sym\n else\n @@locales[@file_locale] = YAML.load_file(file).symbolize_keys\n @@ui_locales[locale_name(\"#{lang}-#{country}\")] = \"#{lang}-#{country}\".to_sym\n end\n end\n end\n localize_rails\n # Return the path of the localization files\n return \"#{ui_localization_files} | #{rails_localization_files}\".to_s\n end", "def init_i18n\n I18n.backend.class.send(:include, I18n::Backend::Pluralization)\n I18n.load_path.unshift(*locale_files)\n end", "def language; end", "def language; end", "def language; end", "def language; end", "def resources()\n end", "def initialize\n self.namespace = \"i18n_languages\"\n self.custom = false\n self.available_locales_only = true\n end", "def GetLocale id\n\n APICall(path: \"locales/#{id}.json\")\n\n end", "def locales\n EnvironmentLocaleMethodsFactory.new(self)\n end", "def lang=(_arg0); end", "def lang=(_arg0); end", "def current_locale\n Thread.current[:\"localite:locale\"] || base\n end", "def locale\n favored_locale\n end", "def translatable\n self._translatable[base_name]\n end", "def enforce_available_locales!(locale); end", "def set_locale\n I18n.locale = params[:locale] \n end", "def set_locale\n I18n.locale = params[:locale] || I18n.default_locale\nend", "def set_locale\n I18n.locale = params[:locale] || I18n.default_locale\nend", "def set_locale\n \tI18n.locale = params[:locale] if params[:locale].present? \n end", "def locale_available?(locale); end", "def locale=(value); end", "def init_i18n\n I18n.backend.class.send(:include, I18n::Backend::Pluralization)\n I18n.load_path.unshift(*locale_files)\n\n I18n.reload!\n end", "def initialize(locale, &blk)\n @locale = locale\n configure &blk if block_given?\n end", "def resources; end", "def resources; end", "def resolve_entry(locale, object, subject, options = T.unsafe(nil)); end", "def i18n_set_locale(locale, &blk)\n locale = ::R18n::I18n.default.to_s if locale.nil?\n \n i18n = ::R18n::I18n.new(\n locale, \n ::R18n.default_places, \n off_filters: :untranslated, \n on_filters: :untranslated_html\n )\n ::R18n.set(i18n)\n yield if block_given?\n # return # NB!! needed to enable routes below to work\n end", "def resource; end", "def setup_language_resources\n I18n.load_path = ['features/resources/localisation/english.yml']\n\n case ENV['Language']\n when 'english'\n I18n.locale = :en\n when 'spanish'\n I18n.locale = :es\n when 'italian'\n I18n.locale = :it\n else\n abort(\"Incorrect language set, cannot continue the test run: supported are 'english', 'italian' or 'spanish'\")\n end\nend", "def available_locales=(locales); end", "def setup\n I18n.locale = I18n.default_locale\n end", "def available_locales\r\n ::LinguaFranca.available_locales\r\n end", "def resource(*resources, &block); end", "def rtl_locales\n %i[ar]\n end", "def localize(object, locale: T.unsafe(nil), format: T.unsafe(nil), **options); end", "def get_translations\n I18n.translate(:foo) # Need to do this to force I18n init\n I18n.backend.send(:translations)\n end", "def set_locale\n # This requires a user model to work. I'm assuming there will be a \"current_user\" helper.\n # If we decide to use Devise, that will be default.\n # I18n.locale = current_user.language || I18n.default_locale\n end", "def index\n @title = \"Indonesian Language Resources\"\n @resources = Resource.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @resources }\n end\n end", "def getLangs\r\n result = self.class.get '/getLangs', { query:{ key:@@api_key } }\r\n check_result result\r\n end", "def set_locale\n #I18n.locale = params[:lang] ? params[:lang] : I18n.default_locale\n end", "def lookup_context; end", "def lookup_context; end", "def lookup_context; end", "def locale_idx; end", "def default_locale\n AppConfig.default_locale\n end", "def localeList\n\t\t\t@locales = []\n\t\t\tbasedir = Dir.new(@basepath)\n\t\t\tbasedir.each do |fn|\n\t\t\t\tif File.file?(@basepath + \"/\" + fn) && fn.split('.')[1] == 'sllf'\n\t\t\t\t\t@locales << File.basename(fn, \".sllf\")\n\t\t\t\tend\n\t\t\tend\n\t\t\t@locales\n\t\tend", "def set_locale\r\n I18n.locale = extract_locale_from_request\r\n end" ]
[ "0.70833105", "0.6754446", "0.6754446", "0.6754446", "0.6754446", "0.6754446", "0.6754446", "0.6754446", "0.66449016", "0.6607934", "0.65544283", "0.65278107", "0.6454502", "0.6435958", "0.6418554", "0.6392355", "0.6365142", "0.63400996", "0.6316087", "0.62578976", "0.62335527", "0.62335527", "0.6182612", "0.6033767", "0.5952341", "0.59397614", "0.5934278", "0.5852955", "0.5813149", "0.5795158", "0.5780802", "0.57740295", "0.57669806", "0.5762417", "0.5746794", "0.57365924", "0.57365924", "0.5713915", "0.5713915", "0.57115436", "0.57092613", "0.57055116", "0.57055116", "0.57055116", "0.57055116", "0.56924546", "0.56789553", "0.56565726", "0.5631406", "0.5624012", "0.56174517", "0.561665", "0.5615233", "0.5591977", "0.55816334", "0.55753505", "0.55753505", "0.55753505", "0.55753505", "0.55661184", "0.5559056", "0.55578506", "0.5554708", "0.5539785", "0.5539785", "0.5532464", "0.55279547", "0.5525629", "0.5524947", "0.552235", "0.5491489", "0.5491489", "0.5488929", "0.5467727", "0.5463515", "0.5456738", "0.54545116", "0.54542565", "0.54542565", "0.5450212", "0.5424546", "0.5423343", "0.5420848", "0.54195964", "0.54136616", "0.54017216", "0.5401437", "0.54001945", "0.53975236", "0.5387691", "0.53839463", "0.5381018", "0.53747976", "0.53709155", "0.53623366", "0.53623366", "0.53623366", "0.53612846", "0.536015", "0.53566486", "0.5349343" ]
0.0
-1
checks given textpassword against hashedsalted password in db should be is_password?
def is_password?(password) BCrypt::Password.new(password_digest).is_password?(password) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def password_match?(password=\"\")\n hashed_password == User.hash_with_salt(password, salt)\n end", "def password_match?(password=\"\")\n hashed_password == User.hash_with_salt(password, salt)\n end", "def password_match?(password=\"\")\n hashed_password == AdminUser.hash_with_salt(password, salt)\n end", "def password_match?(password=\"\")\n hashed_password == AdminUser.hash_with_salt(password, salt)\n end", "def password_match?( password=\"\")\n hashedPassword == Admin.hash_with_salt(password, salt)\n end", "def match_password(login_password=\"\")\n password == BCrypt::Engine.hash_secret(login_password, salt)\n end", "def password_match?(entered_password = '')\n password == User.hash_with_salt(entered_password, salt)\n end", "def password_is?(password)\n ENCRYPT.hexdigest(password + self.salt) == self.encrypted_password\n end", "def password_check\n return self.encrypted_password==BCrypt::Engine.hash_secret(self.password_verify, self.salt)\n end", "def valid_password?(password); end", "def matches_password(login_password)\n passhash == BCrypt::Engine.hash_secret(login_password, salt)\n end", "def valid_password?(password)\n begin\n super(password)\n rescue BCrypt::Errors::InvalidHash\n type, salt, enc_pass = encrypted_password.split('$')\n Digest::SHA1.hexdigest(\"#{salt}#{password}\") == enc_pass\n end\n end", "def authenticate password\n hash = BCrypt::Engine.hash_secret password, password_salt\n hash == password_hash\n end", "def valid_password?(plain)\n password == hash_crypt(plain.to_s) \n end", "def matching_password?(pass)\n self.password_hash == encrypt_password(pass)\n end", "def password? (plain_text_password)\n # don't allow logging in with blank passwords\n return false if plain_text_password.blank?\n return false if self.password_hash.blank?\n\n salt = self.password_salt\n pass = self.password_hash\n Rauth::Encode.mkpasswd(plain_text_password, salt) == pass\n end", "def check_password(password_provided)\n BCrypt::Engine.hash_secret(password_provided, self.password_salt) == self.password\n end", "def validate_password?(plain_password)\n unless salt.nil?\n encrypt(plain_password, salt) == self.password\n else\n false\n end\n end", "def password_is?(pw)\n Digest::MD5.hexdigest(pw + password_salt) == password_hash\n end", "def check_pw pw\n (encrypt pw) == (self[:password])\n end", "def hasSamePassword?(submittedPassword)\n encrypted_password == encryptUsingSalt(submittedPassword)\n end", "def passwords_match?\n context.user.password == context.password\n end", "def has_password?(submitted_password)\n\tpassword == encrypt(submitted_password) \n end", "def is_password?(password_hash)\n # Given a hash of password information, determines whether or not this is\n # password information we can act on.\n password_hash.has_key?(\"text\")\nend", "def password_match?(login_password)\n\t\tencrypted_password == encrypt(login_password)\t\n\tend", "def check_password(password, hash)\n BCrypt::Password.new(hash) == password\n end", "def has_password?( submitted_password )\n encrypted_password == encrypt( submitted_password )\n end", "def password_match? password\n\t\tBCrypt::Password.new(@password) == password\n\tend", "def is_valid_password?(password)\n\t\tself.password == BCrypt::Engine.hash_secret(password, self.password)\n\tend", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n password == encrypt(submitted_password)\n end", "def has_password? pass\n WodaHash.digest(self.pass_salt + pass).to_hex.downcase == pass_hash.downcase\n end", "def has_password?(submitted_password)\r\n encrypted_password == encrypt(submitted_password)\r\n end", "def has_password?(password_soumis)\n # Compare encrypted_password avec la version cryptée de password_soumis.\n encrypted_password == encrypt(password_soumis)\n end", "def password_compare(password, user_id)\n password_digest = db.execute(\"SELECT password_digest FROM users WHERE user_id=?\", user_id)[0][0]\n if BCrypt::Password.new(password_digest) == password\n return true\n else\n return false\n end\n\nend", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(password)\n encrypted_password == encrypt(password)\n end", "def auth_pass(password)\n BCrypt::Password.create(password) == self.hash_pass\n end", "def has_password?(password_soumis)\n\t\t# Compare encrypted_password avec la version cryptée de password_soumis.\n encrypted_password == encrypt(password_soumis)\n end", "def authenticate(user, password)\n salt = user.password_salt \n\n hash = PBKDF2.new do |p|\n p.password = password.unpack(\"B*\").first\n p.salt = salt\n p.iterations = 10000\n end\n\n pass_hash = hash.hex_string\n \n pass_hash == user.password_hash \n end", "def has_password?(submitted_password)\n self.password == encrypt(submitted_password)\n end", "def check_password?(clear_password)\n User.hash_password(\"#{salt}#{User.hash_password clear_password}\") == hashed_password\n end", "def is_password?(password)\n BCrypt::Password.new(self.password_digest) == password\n end", "def authenticate(password)\n hashed_password == BCrypt::Engine.hash_secret(password, salt)\n end", "def compare_pass (pass)\r\n return self.encrypted_password == sha_hash(\"#{pass}--#{self.salt}\")\r\n end", "def has_password?(submitted_password)\n\tencrypted_password == encrypt(submitted_password)\nend", "def check_password(pass, hash)\n DjangoHash.parse(hash).check_password(pass)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def authenticate!(psw)\n User.encrypt_token(psw, password_salt) == encrypted_password\n end", "def valid_password?; end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # compare encrypted_password with the encrypted version of\n # the submitted password.\n\tencrypted_password == encrypt(submitted_password)\n end", "def valid_password?(password)\n if encrypted_password.present?\n super\n else\n \n old_password == Digest::SHA1.hexdigest(LAGACY_SALT + password)\n end\n end", "def validate_password(email, password)\n password_for_email = $db.execute(\"SELECT password_digest FROM users WHERE email = ?\", email)[0][\"password_digest\"]\n p \"validating password\"\n if BCrypt::Password.new(password_for_email) == password\n p \"password match\"\n return true\n else\n p \"password not match\"\n return false\n end\nend", "def using_password?\n\t\t\t\t!send(crypted_password_field).blank?\n\t\t\tend", "def has_password?(password)\n user_password = self.password_digest\n encrpyted_password = BCrypt::Password.new(user_password)\n encrpyted_password.is_password?(password)\n end", "def is_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end", "def is_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end", "def check_password(password)\n return false unless key\n key == self.class.hash_password(password, key.split('|', 2).first)\n end", "def has_password?(submitted_password)\n # compare encrypted_password with the encrypted version of submitted_password\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Return true if the user's password matches the submitted password.\n # Compare encrypted_password with the encrypted version of submitted_password\n encrypted_password == encrypt(submitted_password) \n end", "def has_password?(submitted_password)\n #compare encrypted_password with the encrypted version of submitted password.\n password == submitted_password\n end", "def check(password, crypted)\n hash, salt = unserialize(crypted)\n\n self.hash(password, salt) == hash\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n\t encrypted_password == encrypt(submitted_password)\n end", "def has_password? (submitted_password)\n password_digest == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n self.encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n #Compare encrypted_password with the encrypted version of \n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def is_password(password)\n BCrypt::Password.new(password_digest).is_password?(password)\n end", "def hasPassword?(passwordSoumis)\n\t\tself.encrypted_password == encrypt(passwordSoumis)\n\tend", "def check_password_contents\n if /[a-zA-Z]+/.match(@password) && /\\d+/.match(@password) && /[[:punct:]]/.match(@password)\n else\n generate\n end\n end", "def check_password?(clear_password)\n # User.hash_password(\"#{salt}#{User.hash_password clear_password}\") == hashed_password\n # TODO: encrypt password\n self.password == clear_password\n end", "def has_password?(submitted_password)\n # Compare encrypted password with the encrypted version of\n # Submitted password\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(a_password)\n self.encrypted_password == encrypt(a_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n # Compare encrypted_password with the encrypted version of\n # submitted_password.\n encrypted_password == encrypt(submitted_password)\n end", "def has_password?(submitted_password)\n\t # Compare encrypted_password with the encrypted version of\n\t # submitted_password.\n\t encrypted_password == encrypt(submitted_password)\n\tend", "def valid_password?(password)\n begin\n super(password)\n rescue BCrypt::Errors::InvalidHash\n sha1_password = Digest::SHA1.hexdigest(\"--#{password_salt}--#{password}--\")\n return false unless sha1_password == encrypted_password\n logger.info \"User #{email} is using the old password hashing method, updating attribute.\"\n self.password = password # = BCrypt::Password.create(sha1_password)\n true\n end\n end", "def is_password?(password_attempt)\n\t\tBCrypt::Password.new(password_digest).is_password?(password_attempt)\n\tend", "def valid_password?(password)\n true\n end", "def valid_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end", "def valid_password?(password)\n BCrypt::Password.new(self.password_digest).is_password?(password)\n end" ]
[ "0.76571256", "0.76571256", "0.7594609", "0.7594609", "0.7580744", "0.75578564", "0.75374705", "0.7493638", "0.746282", "0.7456505", "0.73946065", "0.73697543", "0.73637515", "0.7322672", "0.7316799", "0.7295636", "0.72945386", "0.7293174", "0.7275872", "0.72423446", "0.7188413", "0.71828383", "0.7171455", "0.71516657", "0.7143842", "0.7120714", "0.7120421", "0.71188533", "0.7112725", "0.7093711", "0.7093711", "0.7089804", "0.70842797", "0.70800036", "0.70762795", "0.7073092", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70639634", "0.70633125", "0.70626235", "0.70508206", "0.7045759", "0.70359975", "0.7021497", "0.70208615", "0.7020291", "0.7014319", "0.70079315", "0.6992223", "0.69884044", "0.69565266", "0.6941635", "0.69355696", "0.69355696", "0.69182324", "0.69182026", "0.69107485", "0.6902208", "0.6897361", "0.689197", "0.689197", "0.6887499", "0.68868816", "0.6879848", "0.687736", "0.6874584", "0.6871876", "0.6868951", "0.68685085", "0.68517435", "0.6851078", "0.6840547", "0.6837296", "0.68353176", "0.6828762", "0.6823173", "0.6792215", "0.6792215", "0.6792215", "0.6792215", "0.6792215", "0.6792215", "0.6792215", "0.67894983", "0.6786474", "0.6784417", "0.67717934", "0.67703646", "0.67703646" ]
0.6847518
82
TODO: check that dependency follows format (i.e. >= 1.0.0)
def validateDependencies params[:dependencies].split("&").each do |dependency| dependency_values = dependency.split("=") versions = Version.where(:part_name => dependency_values[0]) if versions.empty? render :text => "Part: #{dependency_values[0]} does not exist.", status: 400 return else part = versions.where(:version => dependency_values[1]).first if part.nil? render :text => "Part: #{dependency_values[0]} with version: #{dependency_values[1]} does not exist", status: 400 return end end end render :nothing => true, status: 200 end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def version_required(gem_def)\n return Gem::Dependency.instance_methods.map(&:to_sym).include?(:requirement) ? gem_def.requirement : gem_def.version_requirements\nend", "def require_matched_dependency_version\n false\n end", "def version\n @dependency.requirement\n end", "def dependencies; end", "def dependencies; end", "def dependencies; end", "def depend_on( name, version = nil )\n spec = Gem::Specification.find_by_name(name)\n version = spec.version.to_s if version.nil? and !spec.nil?\n\n PROJ.gem.dependencies << case version\n when nil; [name]\n when %r/^\\d/; [name, \">= #{version}\"]\n else [name, version] end\nend", "def depend_on( name, version = nil )\n spec = Gem.source_index.find_name(name).last\n version = spec.version.to_s if version.nil? and !spec.nil?\n\n PROJ.gem.dependencies << case version\n when nil; [name]\n when %r/^\\d/; [name, \">= #{version}\"]\n else [name, version] end\nend", "def version_dependency\n source_options[:from_dependency]\n end", "def required_version\n versions.find { |v| dependency.match?(name, v) } ||\n raise(Informative, \"Required version (#{dependency}) not found for `#{name}'.\\nAvailable versions: #{versions.join(', ')}\")\n end", "def requirement\n @dependency.requirement\n end", "def dependency_met?\n true\n end", "def direct_dependencies; end", "def get_requirement_version(package_name)\n requirement = File.read(\"requirements/#{package_name}.txt\").strip\n requirement.delete_prefix(\"#{package_name}==\")\nend", "def dependencies=(_arg0); end", "def version_constraint(gem_name); end", "def bower_version(library)\n BOWER[\"dependencies\"][library] || BOWER[\"devDependencies\"][library]\nend", "def version_mismatch_detected\n end", "def parse_dependency(name, op) # :nodoc:\n return Gem::Dependency.new name, op unless peek[0] == :text\n\n version = get(:text).value\n\n requirements = [\"#{op} #{version}\"]\n\n while peek.type == :comma do\n get :comma\n op = get(:requirement).value\n version = get(:text).value\n\n requirements << \"#{op} #{version}\"\n end\n\n Gem::Dependency.new name, requirements\n end", "def dependencies(version = nil)\n validation_deps =\n %w(javax.validation:validation-api:jar:1.0.0.GA javax.validation:validation-api:jar:sources:1.0.0.GA)\n v = version || self.version\n gwt_dev_jar = \"com.google.gwt:gwt-dev:jar:#{v}\"\n if v <= '2.6.1'\n [gwt_dev_jar] + validation_deps\n elsif v == '2.7.0'\n [\n gwt_dev_jar,\n 'org.ow2.asm:asm:jar:5.0.3'\n ] + validation_deps\n elsif v == '2.8.0'\n %w(\n com.google.jsinterop:jsinterop-annotations:jar:1.0.1\n com.google.jsinterop:jsinterop-annotations:jar:sources:1.0.1\n org.w3c.css:sac:jar:1.3\n com.google.gwt:gwt-dev:jar:2.8.0\n com.google.gwt:gwt-user:jar:2.8.0\n com.google.code.gson:gson:jar:2.6.2\n org.ow2.asm:asm:jar:5.0.3\n org.ow2.asm:asm-util:jar:5.0.3\n org.ow2.asm:asm-tree:jar:5.0.3\n org.ow2.asm:asm-commons:jar:5.0.3\n colt:colt:jar:1.2.0\n ant:ant:jar:1.6.5\n commons-collections:commons-collections:jar:3.2.2\n commons-io:commons-io:jar:2.4\n com.ibm.icu:icu4j:jar:50.1.1\n tapestry:tapestry:jar:4.0.2\n\n javax.annotation:javax.annotation-api:jar:1.2\n javax.servlet:javax.servlet-api:jar:3.1.0\n org.eclipse.jetty:jetty-annotations:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-continuation:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-http:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-io:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-jndi:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-plus:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-security:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlet:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlets:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-util:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-webapp:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-xml:jar:9.2.14.v20151106\n org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0\n ) + validation_deps\n elsif v == '2.8.1'\n %w(\n com.google.jsinterop:jsinterop-annotations:jar:1.0.1\n com.google.jsinterop:jsinterop-annotations:jar:sources:1.0.1\n org.w3c.css:sac:jar:1.3\n com.google.gwt:gwt-dev:jar:2.8.1\n com.google.gwt:gwt-user:jar:2.8.1\n com.google.code.gson:gson:jar:2.6.2\n org.ow2.asm:asm:jar:5.0.3\n org.ow2.asm:asm-util:jar:5.0.3\n org.ow2.asm:asm-tree:jar:5.0.3\n org.ow2.asm:asm-commons:jar:5.0.3\n colt:colt:jar:1.2.0\n ant:ant:jar:1.6.5\n commons-collections:commons-collections:jar:3.2.2\n commons-io:commons-io:jar:2.4\n com.ibm.icu:icu4j:jar:50.1.1\n tapestry:tapestry:jar:4.0.2\n\n javax.annotation:javax.annotation-api:jar:1.2\n javax.servlet:javax.servlet-api:jar:3.1.0\n org.eclipse.jetty:jetty-annotations:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-continuation:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-http:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-io:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-jndi:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-plus:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-security:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlet:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlets:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-util:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-webapp:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-xml:jar:9.2.14.v20151106\n org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0\n ) + validation_deps\n elsif v == '2.8.2'\n %w(\n com.google.jsinterop:jsinterop-annotations:jar:1.0.2\n com.google.jsinterop:jsinterop-annotations:jar:sources:1.0.2\n org.w3c.css:sac:jar:1.3\n com.google.gwt:gwt-dev:jar:2.8.2\n com.google.gwt:gwt-user:jar:2.8.2\n com.google.code.gson:gson:jar:2.6.2\n org.ow2.asm:asm:jar:5.0.3\n org.ow2.asm:asm-util:jar:5.0.3\n org.ow2.asm:asm-tree:jar:5.0.3\n org.ow2.asm:asm-commons:jar:5.0.3\n colt:colt:jar:1.2.0\n ant:ant:jar:1.6.5\n commons-collections:commons-collections:jar:3.2.2\n commons-io:commons-io:jar:2.4\n com.ibm.icu:icu4j:jar:50.1.1\n tapestry:tapestry:jar:4.0.2\n\n javax.annotation:javax.annotation-api:jar:1.2\n javax.servlet:javax.servlet-api:jar:3.1.0\n org.eclipse.jetty:jetty-annotations:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-continuation:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-http:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-io:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-jndi:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-plus:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-security:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlet:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlets:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-util:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-webapp:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-xml:jar:9.2.14.v20151106\n org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0\n ) + validation_deps\n elsif v == '2.8.2-v20191108'\n %w(\n org.realityforge.com.google.jsinterop:jsinterop-annotations:jar:2.8.2-v20191108\n org.realityforge.com.google.jsinterop:jsinterop-annotations:jar:sources:2.8.2-v20191108\n org.w3c.css:sac:jar:1.3\n org.realityforge.com.google.gwt:gwt-dev:jar:2.8.2-v20191108\n org.realityforge.com.google.gwt:gwt-user:jar:2.8.2-v20191108\n com.google.code.gson:gson:jar:2.6.2\n\n org.ow2.asm:asm:jar:7.1\n org.ow2.asm:asm-util:jar:7.1\n org.ow2.asm:asm-tree:jar:7.1\n org.ow2.asm:asm-commons:jar:7.1\n\n colt:colt:jar:1.2.0\n ant:ant:jar:1.6.5\n commons-collections:commons-collections:jar:3.2.2\n commons-io:commons-io:jar:2.4\n com.ibm.icu:icu4j:jar:63.1\n tapestry:tapestry:jar:4.0.2\n\n javax.annotation:javax.annotation-api:jar:1.2\n javax.servlet:javax.servlet-api:jar:3.1.0\n org.eclipse.jetty:jetty-annotations:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-continuation:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-http:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-io:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-jndi:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-plus:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-security:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-server:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlet:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-servlets:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-util:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-webapp:jar:9.2.14.v20151106\n org.eclipse.jetty:jetty-xml:jar:9.2.14.v20151106\n org.eclipse.jetty.toolchain:jetty-schemas:jar:3.1.M0\n ) + validation_deps\n else\n raise \"Unknown GWT version #{v}\"\n end\n end", "def external_dependency_checksum; end", "def dep_check\n $gems_required.each do |current_gem|\n begin\n if current_gem.include? \",\"\n tokens = current_gem.split(\",\")\n gem tokens[0], tokens[1]\n else\n gem current_gem\n end\n rescue Gem::LoadError\n if current_gem.include? \",\"\n $gems_missing_version << current_gem\n else\n $gems_missing << current_gem\n end\n end\n end\n if $gems_missing.length == 0 && $gems_missing_version.length == 0\n return true\n else\n return false\n end\nend", "def satisfies_requirement?(dependency)\n return @name == dependency.name &&\n dependency.requirement.satisfied_by?(@version)\n end", "def dependency name, version, type = :runtime\n raise \"Unknown dependency type: #{type}\" unless\n [:runtime, :dev, :development, :developer].include? type\n\n ary = if type == :runtime then\n extra_deps\n else\n extra_dev_deps\n end\n\n ary << [name, version]\n end", "def has_version?; end", "def conscientious_require; end", "def require_dependency_with_check(dependency)\n begin\n require dependency\n rescue LoadError => e\n puts \"You need to install #{dependency} before we can proceed\"\n end\nend", "def required_by(dependency, dependent_name)\n dependencies_by_requirer_name[dependent_name] ||= []\n dependencies_by_requirer_name[dependent_name] << dependency\n dependencies << dependency\n\n if acceptable_versions.empty?\n message = \"Unable to satisfy the following requirements:\\n\\n\"\n dependencies_by_requirer_name.each do |name, dependencies|\n dependencies.each do |dep|\n message << \"- `#{dep}` required by `#{name}`\\n\"\n end\n end\n raise Informative, message\n end\n end", "def validate_dependencies # :nodoc:\n warning_messages = []\n @specification.dependencies.each do |dep|\n prerelease_dep = dep.requirements_list.any? do |req|\n Gem::Requirement.new(req).prerelease?\n end\n\n warning_messages << \"prerelease dependency on #{dep} is not recommended\" if\n prerelease_dep && !@specification.version.prerelease?\n\n open_ended = dep.requirement.requirements.all? do |op, version|\n not version.prerelease? and (op == '>' or op == '>=')\n end\n\n if open_ended\n op, dep_version = dep.requirement.requirements.first\n\n segments = dep_version.segments\n\n base = segments.first 2\n\n recommendation = if (op == '>' || op == '>=') && segments == [0]\n \" use a bounded requirement, such as '~> x.y'\"\n else\n bugfix = if op == '>'\n \", '> #{dep_version}'\"\n elsif op == '>=' and base != segments\n \", '>= #{dep_version}'\"\n end\n\n \" if #{dep.name} is semantically versioned, use:\\n\" \\\n \" add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}\"\n end\n\n warning_messages << [\"open-ended dependency on #{dep} is not recommended\", recommendation].join(\"\\n\") + \"\\n\"\n end\n end\n if warning_messages.any?\n warning_messages.each {|warning_message| warning warning_message }\n end\n end", "def dependencies( *args )\n names = args # note: for now assume all args are just names\n # e.g. 'pluto-models', 'pluto-update', etc.\n deps = @versions.select do |rec| names.include?( rec[0] ) end\n .map do |rec| [rec[0], rec[1]] end\n\n ## todo/fix: throw exception if dependency is missing!\n ## names.size == deps.size\n puts \"names.size == deps.size #{names.size} == #{deps.size}\"\n deps\n end", "def check_dependencies\n fetch_module_dependencies.map do |dependency, constraint|\n dependency = dependency.sub('-', '/')\n current = dependency == @updated_module ? SemanticPuppet::Version.parse(@updated_module_version) : @forge.get_current_version(dependency)\n [dependency, constraint, current, constraint.include?(current)]\n end\n end", "def depends_on(package, *version)\n dependencies << [ package, *version ]\n end", "def from_dependency?\n source_options && version_dependency\n end", "def dependency\n @dependency ||= Bundler.load.gems.find { |dep| dep.name == @name }\n end", "def dependencies\n\t\t0\n\tend", "def requirement\n Gem::Requirement.new('~>' + pharos_version.segments.first(2).join('.') + (pharos_version.prerelease? ? '.0-a' : '.0'))\n end", "def bower_resolve(modspec)\n mod, verspec = if modspec.kind_of?(Array)\n modspec\n else\n [modspec, '>=0.0.0']\n end\n raise DashboardException.new(\"Missing Asset Module #{mod} version #{verspec}\") if bower_packages[mod].nil?\n bower_packages[mod] # FIXME: must check for version match too!!!\n end", "def gem_dep_matches?(what, version, *deps)\n # always match if we have no chef_version at all\n return true unless deps.length > 0\n\n # match if we match any of the chef_version lines\n deps.any? { |dep| dep.match?(what, version) }\n end", "def massage_version(tags,dependency)\n case dependency\n when :node\n tags.map {|tag| tag.gsub(/v/,\"\")}\n else\n tags\n end\n end", "def dependency_respects_ordering?; @dependency_respects_ordering; end", "def requirement\n \"~> #{major}\"\n end", "def earliest_version_matching(dep)\n version = versions_matching(dep).collect { |v| ::Gem::Version.new v }.min\n version.nil? ? nil : version.to_s\n end", "def add_dependency(path, dependency); end", "def require_gems; end", "def requires\n req_str = StringIO.new\n # get ruby dependency\n req_str << \"ruby #{@spec.required_ruby_version || \">= 0\" }\"\n # get rubygems dependency\n req_str << \", rubygems #{@spec.required_rubygems_version}\" unless @spec.required_rubygems_version.nil?\n # get runtime dependencies\n req_str << \", #{@spec.runtime_dependencies.join(', ').gsub(', runtime', '').gsub(')', '').gsub('(', '').gsub('~>', '>=')}\" unless @spec.runtime_dependencies.empty?\n # return string with dependencies\n return req_str.string\n end", "def test_bad_chicken_deps\n check_deps_fail \"notapackage\" => :chicken if which('csc')\n end", "def test_bad_chicken_deps\n check_deps_fail \"notapackage\" => :chicken if which('csc')\n end", "def requires\n self.class::Requirements[@version] || self.class::Requirements[:all] || {}\n end", "def test_normalization\n require 'yaml'\n yamldep = %{--- !ruby/object:Gem::Version::Requirement\n nums: \n - 1\n - 0\n - 4\n op: \">=\"\n version: \">= 1.0.4\"}\n dep = YAML.load(yamldep)\n dep.normalize\n assert_equal \">= 1.0.4\", dep.to_s\n end", "def find_dependency_versions(dependency)\n versions = []\n specs = Dir[File.join(gem_dir, 'specifications', \"#{dependency.name}-*.gemspec\")]\n unless specs.empty?\n specs.inject(versions) do |versions, gemspec_path|\n versions << gemspec_path[/-([\\d\\.]+)\\.gemspec$/, 1]\n end\n end\n versions.sort.reverse\n end", "def missing_deps_for(gem)\n # Comparison by name here assuming if it is in existing spec,\n # spec author will have ensured versions are correct for their purposes\n gem.deps.select { |dep| requirements_for_gem(dep.name).empty? }\n end", "def parse_deps(input)\n matches = input.scan(/\\s+-\\s+\\[ \\]\\s+(\\S+)\\s+(\\S+\\s+[0-9.]+)/) || []\n\n gemspecs = matches.map do |match|\n {:name => match[0], :version => match[1]}\n end\n\n # NOTE: These gemspecs are gems that are not yet loaded. We don't know if\n # they are installed or not, so we don't know for sure if the\n # dependency will be met at runtime. So, we'll execute a gem command\n # to check to see if these are installed and ignore the ones that\n # already are.\n gemspecs.delete_if do |gemspec|\n cmd = \"gem list #{gemspec[:name]} -i -l\"\n if gemspec[:version]\n cmd << \" -v '#{gemspec[:version]}'\"\n end\n `#{cmd}` =~ /true/\n end\n\n return gemspecs\n end", "def compare(upstream_source)\n same = {}\n diff = {}\n upstream_source.deps.each do |d|\n spec_reqs = self.requirements_for_gem(d.name)\n spec_reqs_specifier = spec_reqs.empty? ? nil :\n spec_reqs.collect { |req| req.specifier }\n\n if spec_reqs.nil?\n diff[d.name] = {:spec => nil,\n :upstream => d.requirement.to_s}\n\n elsif !spec_reqs.any? { |req| req.matches?(d) } ||\n !self.has_all_requirements_for?(d)\n diff[d.name] = {:spec => spec_reqs_specifier,\n :upstream => d.requirement.to_s}\n\n elsif !diff.has_key?(d.name)\n same[d.name] = {:spec => spec_reqs_specifier,\n :upstream => d.requirement.to_s }\n end\n end\n\n @metadata[:requires].each do |req|\n next unless req.gem?\n\n upstream_dep = upstream_source.deps.find { |d| d.name == req.gem_name }\n\n if upstream_dep.nil?\n diff[req.gem_name] = {:spec => req.specifier,\n :upstream => nil}\n\n elsif !req.matches?(upstream_dep)\n diff[req.gem_name] = {:spec => req.specifier,\n :upstream => upstream_dep.requirement.to_s }\n\n elsif !diff.has_key?(req.gem_name)\n same[req.gem_name] = {:spec => req.specifier,\n :upstream => upstream_dep.requirement.to_s }\n end\n end unless @metadata[:requires].nil?\n\n {:same => same, :diff => diff}\n end", "def requirements; end", "def requirements; end", "def requirements; end", "def requirements; end", "def require_version(name, current, required)\n print \"Checking for #{name} >= #{required}... \"\n\n if version_greater_than(current, required)\n puts 'yes'\n else\n abort 'no'\n end\n end", "def updated_gemfile_requirement(req)\n return req unless latest_resolvable_version\n return req if existing_version && no_change_in_version?\n return req if !existing_version && new_version_satisfies?(req)\n\n requirements =\n req[:requirement].split(\",\").map { |r| Gem::Requirement.new(r) }\n\n new_req =\n if requirements.any?(&:exact?)\n \"= #{latest_resolvable_version}\"\n elsif requirements.any? { |r| r.to_s.start_with?(\"~>\") }\n tw_req = requirements.find { |r| r.to_s.start_with?(\"~>\") }\n update_twiddle_version(tw_req, latest_resolvable_version).to_s\n else\n update_gemfile_range(requirements).map(&:to_s).join(\", \")\n end\n\n req.merge(requirement: new_req)\n end", "def set_dep(requested_version, whitelisted_repo_key, sha)\n if requested_version.include?(\"git+ssh\") # Preserve URL\n return \"#{ requested_version.split(\"#\").first }##{ sha }\"\n else\n return \"#{ whitelisted_repo_key }##{ sha }\"\n end\nend", "def get_version_req(dep)\n req = get_key_or_sym(dep, :version_requirement)\n req ||= get_key_or_sym(dep, :version_range)\n req\n end", "def valid_gemspec?; end", "def gemspec?; end", "def install_dependencies\n raise 'Not implemented'\n end", "def package_depends_on\n depends_on\n end", "def ignore_conditions_for(options, dependency)\n # Find where the name matches then get an array of version requirements, e.g. [\"4.x\", \"5.x\"]\n found = options.find { |ig| dependency.name.match?(ig['name']) }\n found ? found['versions'] || [] : []\nend", "def dependency_versions(args = {}, &bl)\n versions = args[:versions] || {}\n check_deps = args[:dev] ? dev_deps : deps\n\n check_deps.each do |dep|\n unless versions.key?(dep.name)\n begin\n gem = Polisher::Gem.retrieve(dep.name)\n versions.merge! gem.versions(args, &bl)\n rescue\n unknown = Polisher::VersionChecker.unknown_version(:all, dep.name, &bl)\n versions.merge! dep.name => unknown\n end\n end\n\n args[:versions] = versions\n end\n\n versions\n end", "def test_bad_rubinius_deps\n check_deps_fail \"notapackage\" => :rbx if which('rbx')\n end", "def test_bad_rubinius_deps\n check_deps_fail \"notapackage\" => :rbx if which('rbx')\n end", "def check_for_requirements; end", "def gem_requirements_from_array(what, array)\n array.map do |dep|\n Gem::Dependency.new(what, *dep)\n end\n end", "def gem(name, *reqs)\n if dep = @dependency_names[name]\n dep.requirement.concat reqs\n else\n dep = Gem::Dependency.new name, *reqs\n @dependency_names[name] = dep\n @dependencies << dep\n end\n end", "def version_string(dependency, is_purl_version = false)\n # If the dependency is specified in a unlocked dependency file and an absolute version\n # is needed for the purl return empty\n if dependency[:dependency_file] == self.class::UNLOCKED_DEPENDENCY_FILE && is_purl_version\n return \"\"\n end\n\n dependency[:version]\n end", "def dependencies\n []\n end", "def requirement\n return @requirement if defined?(@requirement) and @requirement\n\n # @version_requirements and @version_requirement are legacy ivar\n # names, and supported here because older gems need to keep\n # working and Dependency doesn't implement marshal_dump and\n # marshal_load. In a happier world, this would be an\n # attr_accessor. The horrifying instance_variable_get you see\n # below is also the legacy of some old restructurings.\n #\n # Note also that because of backwards compatibility (loading new\n # gems in an old RubyGems installation), we can't add explicit\n # marshaling to this class until we want to make a big\n # break. Maybe 2.0.\n #\n # Children, define explicit marshal and unmarshal behavior for\n # public classes. Marshal formats are part of your public API.\n\n # REFACTOR: See above\n\n if defined?(@version_requirement) && @version_requirement\n version = @version_requirement.instance_variable_get :@version\n @version_requirement = nil\n @version_requirements = Gem::Requirement.new version\n end\n\n @requirement = @version_requirements if defined?(@version_requirements)\n end", "def dependency_versions(args = {}, &bl)\n versions = args[:versions] || {}\n check_deps = args[:dev] ? dev_deps : deps\n\n check_deps.each do |dep|\n unless versions.key?(dep.name)\n begin\n gem = Polisher::Gem.retrieve(dep.name)\n versions.merge! gem.versions(args, &bl)\n rescue\n unknown = Polisher::VersionChecker.unknown_version(:all, dep.name, &bl)\n versions.merge! dep.name => unknown\n end\n end\n\n args[:versions] = versions\n end\n\n versions\n end", "def resolve(dependency)\n if from_dependency? && version_dependency == dependency.name\n construct_build_version(dependency)\n log.info(log_key) { \"Build Version is set to '#{build_version}'\" }\n end\n end", "def name\n @dependency.name\n end", "def name\n @dependency.name\n end", "def touch_dependency source, specfile\n expect( cover_source_by( source, specfile)).to be_true\nend", "def requires_for(source)\n requires.select { |r| r.first == source }.first.last\n end", "def latest_version?\n @requirement.none?\n end", "def latest_version?\n @requirement.none?\n end", "def gemfile_requirement(name)\n @original_gemfile ||= IO.read('Gemfile')\n req = @original_gemfile[/gem\\s+['\"]#{name}['\"]\\s*(,[><~= \\t\\d\\.\\w'\"]*)?.*$/, 1]\n req && req.tr(\"'\", %(\")).strip.sub(/^,\\s*\"/, ', \"')\nend", "def dependency_target\n self.name == \"hoe\" ? extra_deps : extra_dev_deps\n end", "def dependencies\n []\n end", "def to_ruby\n%{Gem::Specification.new do |s|\n s.name = \"#{@gem_spec.name}\"\n s.version = \"#{@gem_spec.version}\"\n\n s.specification_version = #{ ivar_get(:specification_version) || 2 } if s.respond_to? :specification_version=\n s.required_rubygems_version = Gem::Requirement.new(\"#{ivar_get(:required_rubygems_version) || '>= 0'}\") if s.respond_to? :required_rubygems_version=\n\n#{gem_spec_variables.map { |k,v| \" s.#{k} = #{v.inspect}\" }.join(\"\\n\") }\n\n#{@gem_spec.dependencies.map { |dep| \" s.add_dependency(\\\"#{dep.name}\\\", [\\\"#{dep.version_requirements.to_s}\\\"])\" }.join(\"\\n\") }\nend}\n end", "def gemspec( * )\n\t\traise \"Circular dependency: can't depend on the gemspec to build itself\"\n\tend", "def depend_upon(match_name) #, constraint)\n list = []\n each do |name, libs|\n case libs\n when Library\n list << libs if libs.requirements.any?{ |r| match_name == r['name'] } \n else\n libs.each do |lib|\n list << lib if lib.requirements.any?{ |r| match_name == r['name'] } \n end\n end\n end\n list\n end", "def dependencies\n []\n end", "def gemfile_requirement(name)\n @original_gemfile ||= IO.read('Gemfile')\n req = @original_gemfile[/gem\\s+['\"]#{name}['\"]\\s*(,[><~= \\t\\d\\.\\w'\"]*)?.*$/, 1]\n req && req.gsub(\"'\", %(\")).strip.sub(/^,\\s*\"/, ', \"')\nend", "def check_version(version, requirement)\n Gem::Requirement.new( requirement ).satisfied_by? Gem::Version.new( version )\n end", "def requirements(requirements); end", "def require_convert(k, v, prefix, klass)\n\n # package type/name maps\n map = { FPM::Package::RPM => :rpm, FPM::Package::Deb => :deb, FPM::Package::Phar => :phar }\n typ = map.include?(klass) ? map[klass] : :deb\n pn = {\n :php => { :phar => \"php\", :deb => \"php5-common\", :rpm => \"php(language)\" },\n :ext => { :phar => \"ext:\", :deb => \"php5-\", :rpm => \"php-\" },\n :lib => { :phar => \"sys:lib\", :deb => \"lib\", :rpm => \"lib\" },\n :bin => { :phar => \"bin:\", :deb => \"\", :rpm => \"/usr/bin/\" }\n }\n\n # package names, magic values\n case k = k.strip.gsub(/\\W+/, \"-\")\n when /^php(-32bit|-64bit)?|^hhvm|^quercus/\n k = pn[:php][typ]\n @architecture = ($1 == \"-32bit\") ? \"x86\" : \"amd64\" if $1\n when /^(ext|lib|bin)-(\\w+)$/\n k = pn[$1.to_sym][typ] + $2\n else\n k = prefix + k\n end\n\n # expand version specifiers (this is intentionally incomplete)\n if attributes[:no_depends_given?]\n v = \"\"\n else\n v = v.split(\",\").map {\n |v|\n case v = ver(v, typ)\n when \"*\"\n \"\"\n when /^[\\d.-]+~*$/ # 1.0.1\n \" = #{v}\"\n when /^((\\d+\\.)*(\\d+))\\.\\*/ # 1.0.*\n [\" >= #{$1}.0\", \" <= #{$1}.999\"]\n when /^([!><=]*)([\\d.-]+~*)$/ # >= 2.0 # debianize_op() normalizes >, <, = anyway\n \" #{$1} #{$2}\"\n when /^~\\s*([\\d.-]+~*)$/ # ~2.0 # deb.fix_dependency translates that into a range [\"pkg(>=1)\", \"pkg(<<2)\"]\n \" ~> #{$1}\"\n else\n \"\"\n end\n }\n end\n return k ? v.flatten.map { |v| k + v } : nil\n end", "def deps(pkg) # FIXME: \"*** PACKAGE MAY NOT BE DELETED *** \"\n if pkg.status != :available\n components = `#{@cmd} -n #{pkg.name}`.split(\"Requires:\\n\")\n if components.size > 1\n return components[1].strip\n else\n return \"[No depends]\"\n end\n else\n if File.exist?(File.expand_path(\"~/Library/Application Support/Guigna/pkgsrc/INDEX\"))\n # TODO: parse INDEX\n end\n \"[Not available]\"\n end\n end", "def dependency(dep, ver = nil)\n @dep_loader.add_dependency dep, ver\n end", "def target_version; end", "def version_string(dependency, is_purl_version = false)\n # If the dependency is specified in the Gemfile and an absolute version is needed for\n # the purl return empty\n return \"\" if dependency[:dependency_file] == 'Gemfile' && is_purl_version\n\n prefix = is_purl_version ? \"@\" : \"\"\n \"#{prefix}#{dependency[:version]}\"\n end", "def dependency_to_jar(dependency)\n group, artifact, version = dependency.split(\"/\")\n \"#{artifact}-#{version}.jar\"\nend", "def dependency?(software)\n name = if software.respond_to?(:name)\n software.send(:name)\n else\n software\n end\n @dependencies.include?(name)\n end", "def validate_gemspec; end" ]
[ "0.7204709", "0.7188479", "0.70727587", "0.6977271", "0.6977271", "0.6977271", "0.68683034", "0.68212616", "0.67924845", "0.6753469", "0.6749332", "0.6637892", "0.65562665", "0.6455662", "0.642381", "0.6410759", "0.6410342", "0.6379445", "0.63411283", "0.62965703", "0.6295484", "0.62829393", "0.62766194", "0.6273117", "0.62680995", "0.6251015", "0.62462664", "0.62369984", "0.6235304", "0.62239695", "0.6221134", "0.62203306", "0.6195884", "0.61933106", "0.6184596", "0.6177659", "0.6138566", "0.6110511", "0.6093687", "0.6066763", "0.6049503", "0.60401297", "0.60336727", "0.60324126", "0.6028382", "0.6024224", "0.6024224", "0.602301", "0.60178876", "0.600772", "0.6003771", "0.60031193", "0.59982187", "0.59944177", "0.59944177", "0.59944177", "0.59944177", "0.597855", "0.5971734", "0.59695995", "0.59566873", "0.5946293", "0.59414697", "0.5931392", "0.5930097", "0.5929383", "0.592674", "0.59053594", "0.59053594", "0.58948934", "0.5893864", "0.5891982", "0.58905923", "0.5890182", "0.58886516", "0.5884057", "0.5883325", "0.58765924", "0.58765924", "0.5876148", "0.58610976", "0.5860652", "0.5860652", "0.5843719", "0.58423465", "0.58384496", "0.5837788", "0.5835193", "0.582378", "0.58084106", "0.58079773", "0.5805774", "0.5800746", "0.57907367", "0.5785043", "0.5769714", "0.5763209", "0.5760341", "0.57450336", "0.5743398", "0.57379484" ]
0.0
-1
Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
def additional_data return @additional_data end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[]
[]
0.0
-1
Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well.
def additional_data=(value) @additional_data = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[]
[]
0.0
-1
Instantiates a new numberColumn and sets the default values.
def initialize() @additional_data = Hash.new end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def default_values\r\n self.column_position = number_of_columns\r\n end", "def initialize_defaults\n %w(show_first_column show_last_column show_row_stripes show_column_stripes).each do |attr|\n send(\"#{attr}=\", 0)\n end\n end", "def columns=(integer); end", "def initialize(num)\n @number = num\n end", "def initialize(*args)\n set(*args)\n @cell_order = self.class.default_cell_order\n end", "def defaults # :nodoc:\n self.columns.length.times { |idx|\n }\n end", "def initialize(value, *cells)\n @cells = cells # Need a set\n @value = value.to_i\n end", "def initialize\n @generators = {\n Fixnum => FixnumGenerator.new,\n Float => FloatGenerator.new,\n Date => DateGenerator.new,\n Time => TimeGenerator.new,\n String => StringGenerator.new,\n Object => BooleanGenerator.new,\n }\n @column_generators = {}\n end", "def initialize(number)\n @num = number\n end", "def initialize(name, default, count=0)\n\n # We need to store the name and default for later.\n @name = name\n @default = default\n\n # This will contain all of our column data\n @storage = []\n\n # We need to populate our storage array with default data until it is as long as our count\n while @storage.length < count\n @storage.push(default)\n end\n\n end", "def initialize(number)\n @number = number\n end", "def initialize(columns, size_or_array=nil)\n size_or_array ||= columns.size \n\n case size_or_array\n when Integer\n @arr = Array.new(size_or_array)\n when Array\n @arr = size_or_array\n else\n raise TypeError, \"parameter must be either Integer or Array\"\n end\n\n # The '@column_map' is used to map column names to integer values so\n # that users can reference row values by name or number.\n\n @column_map = {}\n @column_names = columns\n columns.each_with_index { |c,i| @column_map[c] = i }\n super(@arr)\n end", "def initialize\n @money = STARTING_MONEY\n @grid = Grid.new(WIDTH, LENGTH)\n end", "def initialize(number)\r\n @number = number.to_i #.to_i to perform the math as an integer so there are no discrepancies\r\n end", "def initialize\r\n @cells = *(0..9) # Splat operator creates an array of ten items, zero to nine\r\n @cells[0] = nil # Ignore the 0th element\r\n end", "def augment_column_config(c)\n super\n set_default_data_index(c)\n set_default_xtype c\n end", "def define_num\n self.num ||= from.new_num_message\n end", "def creat_board_num(pos)\n mines_count = self.count_mines(pos)\n self[pos] = Num.new(mines_count)\n end", "def initialize(number)\n \n @@all << self\n end", "def initialize(rows = 0, columns = 0)\n resize_field rows, columns\n end", "def initialize_blanks\n each_with_index do |blank_space, row, col|\n next unless blank_space == '-'\n blank_space = Element.new\n blank_space.possibleNumbers = []\n blank_space.relativeNumbers = []\n self[row, col] = blank_space\n end\n end", "def initialize(n, hilite, col=nil)\n @name = n\n @pcol = -1\n @betacol = -1\n @colorstr = col\n @mafcafcol = -1\n @values = Hash.new\n @values['num'] = 0\n @values['pheno_avg'] = 0\n @Ncol = -1\n @subgroups = Hash.new\n @orcol = -1\n @ucicol = -1\n @lcicol = -1\n @casescol = -1\n @controlscol = -1\n @cafcasescol = -1\n @cafcontrolscol = -1\n @powercol = -1\n @studycol = -1\n @highlighted = hilite\n @betaucicol = -1\n @betalcicol = -1\n\t\t@rankcol = -1\n @additional_cols = Hash.new\n end", "def active_scaffold_input_number(column, options)\n active_scaffold_number_input :number_field, column, options, :format\n end", "def initialize(num)\n fail unless num.is_a?(Numeric)\n @x = num\n end", "def use_default_attributes\n self.name = \"element#{column}\"\n self.units = ''\n self.default_min = nil\n self.default_max = nil\n self.scale_factor = 1.0\n self.offset = 0.0\n self.display_type = 'continuous'\n end", "def initialize(id: , number:)\n @id = id\n @number = number\n end", "def colnum; @options.fetch(:colnum, 0); end", "def initialize(columns, options = {})\n super\n \n @sortable = options[:sortable] || false\n @infixes = options[:infixes] || false\n @prefixes = options[:prefixes] || false\n end", "def initialize(number, color)\n @number = number\n @color = color\n end", "def initialize (num=200)\n @num = num\n end", "def initialize(human_number)\n @human_number = human_number\n @number = to_number(@human_number)\n end", "def initialize_axis_numbers\n axis = \"\"\n (entry_size + 1).times { axis.concat(\" \")}\n axis.concat(\"0\")\n end", "def initialize( names, specs )\n super( names, specs )\n set_bounds( specs[ :min ], specs[ :max ] )\n set_default( specs[ :df_int ] )\n end", "def number(placeholder = nil)\n generate(placeholder, NUMBER_CHARACTERS)\n end", "def initialize(number)\n raise ArgumentError unless number.between?(0,40)\n @value = number\n super()\n end", "def set_default_number\n self.number ||= self.class.next_number repository\n end", "def initialize(number, kind) # Definiendo el metodo constructor\n get_number(number) # Definiendo un metodo de instancia, esto con el objetivo de validar el numero que se ingrese\n @kind = kind # @ Variable de instancia o variable local\n end", "def new_column_definition(base, name, type)\n definition = ColumnDefinition.new base, name, type\n @columns << definition\n @columns_hash[name] = definition\n definition\n end", "def initialize(num_rows,num_columns)\n @num_rows = num_rows\n @num_columns = num_columns\n @rows = []\n for x in 1..num_rows\n fresh_row = Row.new(num_columns)\n @rows << fresh_row\n end\n end", "def initialize(nRow, nCol)\n\t\t@rows = (1..nRow).map {\n\t\t\t(1..nCol).map { Cell.new }\n\t\t}\n\n\t\t@cols = @rows.transpose\n\tend", "def sql_number\n NumericExpression.new(:NOOP, self)\n end", "def sql_number\n NumericExpression.new(:NOOP, self)\n end", "def initialize(fact_class, column_definition, strategy_name = :sum, field_options = {})\r\n super(fact_class, column_definition.name, column_definition.type, field_options)\r\n @column_definition = column_definition\r\n @limit = column_definition.limit\r\n @scale = column_definition.scale\r\n @precision = column_definition.precision\r\n @strategy_name = strategy_name\r\n end", "def initialize(file, cell_width = 5, cell_height = 3)\n self.cell_width = cell_width\n self.cell_height = cell_height\n @lines = file.read.split(\"\\n\").map{ |line| line.scan(/[_X]/).map{|cell| Cell.new(cell == '_')} }\n remove_empty_border\n number_cells\n end", "def initialize\n super(0, 0, window_width, window_height) \n @item = nil\n @max = 1\n @number = 1\n end", "def initialize(number = 0, size = DEFAULT_SIZE)\n @number, @size = number, size\n raise ArgumentError, \"number must be =< #{max_number}\" if number > max_number\n end", "def columns=(n)\n @columns = n\n end", "def initialize(table_size_x, table_size_y)\n self.table_size_x = table_size_x.to_i - 1 || 4\n self.table_size_y = table_size_y.to_i - 1 || 4\n end", "def initialize name, number\n @name = name\n @number = number\n end", "def initialize(window, rect, value, pattern=nil, min=0, max=99, step=1, align=0, \n font=nil, active=true, visible=true)\n super(active, visible)\n @cLabelNumber = CLabel.new(window, rect, nil, align, font)\n @cLabelNumber.active = active\n @cLabelNumber.visible = visible\n @value = value\n self.pattern = pattern\n self.min = min\n self.max = max\n self.step = step\n end", "def initialize(cols, *args)\n @using = cols \n super(*args)\n end", "def init_board(n, def_val)\n\t\tArray.new(n) { Array.new(n) { def_val } }\n\tend", "def initialize(*columns)\n @columns = columns\n end", "def initialize cols=nil, *args, &block\n @chash = [] # hash of column info, not used\n @_skip_columns = {} # internal, which columns not to calc width of since user has specified\n @separ = @columns = @numbering = nil\n @y = '|'\n @x = '+'\n @use_separator = false\n @_hidden_columns_flag = false\n self.columns = cols if cols\n if !args.empty?\n self.data = args\n end\n yield_or_eval(&block) if block_given?\n end", "def initialize(cell)\n super(cell)\n end", "def default_columns\n [{\n :name => :id,\n :attr_type => :integer\n },{\n :name => :name,\n :attr_type => :string\n },{\n :name => :position,\n :attr_type => :integer\n }]\n end", "def make_new_cell()\n c = Cell.new\n c.onset = 0\n c.offset = 0\n c.ordinal = 0\n c.set_args(\"\", @arglist)\n @cells << c\n return c\n end", "def initialize\n @colspan = 1\n @rowspan = 1\n end", "def initialize(filas, columnas)\n super(filas, columnas)\n @container = Hash.new(zero)\n end", "def initialize\n @col_specs = []\n end", "def test_mysql_integer_not_null_defaults\n klass = Class.new(ActiveRecord::Base)\n klass.table_name = 'test_integer_not_null_default_zero'\n klass.connection.create_table klass.table_name do |t|\n t.column :zero, :integer, :null => false, :default => 0\n t.column :omit, :integer, :null => false\n end\n\n assert_equal 0, klass.columns_hash['zero'].default\n assert !klass.columns_hash['zero'].null\n # 0 in MySQL 4, nil in 5.\n assert [0, nil].include?(klass.columns_hash['omit'].default)\n assert !klass.columns_hash['omit'].null\n\n assert_raise(ActiveRecord::StatementInvalid) { klass.create! }\n\n assert_nothing_raised do\n instance = klass.create!(:omit => 1)\n assert_equal 0, instance.zero\n assert_equal 1, instance.omit\n end\n ensure\n klass.connection.drop_table(klass.table_name) rescue nil\n end", "def initialize(height = AppConfig.default_height, width = AppConfig.default_width)\n @table = Table.new height, width\n end", "def create_columns\n (column_count.to_i - columns.size).times { columns.create(position: columns.size) }\n end", "def initialize(rows=0, columns=0)\n @data = Data.new(rows, columns)\n end", "def initialize(digits)\n @digits = digits\n end", "def initialize(column_models_count, *args, &block)\n super(*args, &block)\n\n @column_models_count = column_models_count\n end", "def column(name, type, options = {})\n def_accessors(name)\n set_attribute_default(name, options[:default])\n end", "def initialize(numbers)\n @board = SudokuBoard.new(numbers)\n @board.define_listener(:set_number) do |i,j,n|\n remove_obvious_candidates(i, j, n)\n end\n @removed_first_obvious_candidates = false\n initialize_listeners\n end", "def initialize(number, per_page)\n @number = number\n @per_page = per_page\n end", "def initialize(name, type, length, decimal)\n @name, @type, @length, @decimal = strip_non_ascii_chars(name), type, length, decimal\n \n raise ColumnLengthError, \"field length must be greater than 0\" unless length > 0\n raise ColumnNameError, \"column name cannot be empty\" if @name.length == 0\n end", "def insert_columns( before, number=1 )\n a = Array.new( number, nil )\n before = col_index( before ) - 1\n @data.map! { |row| row.insert( before, *a ) }\n calc_dimensions\n end", "def empty_col\n # We need the :order parameter here because self.cols uses this as a hash\n # key\n col(nil, SecureRandom.hex)\n end", "def initialize(rows = self.class.blank_grid)\n @rows = rows\n end", "def initialize(table = Table.new([4, 4]))\n @table = table\n end", "def initialize\n\t\t@cells = []\n\n\t\t9.times { @cells << Cell.new }\t\n\tend", "def initialize(type, number)\n type = type.to_s.downcase.intern\n number = number.to_i\n raise UnsupportedType unless TYPES.include?(type)\n raise MustBePositive if number < 1\n @type, @number = type, number.to_i\n end", "def initialize\n @columns = []\n @columns_lookup = []\n @rows = []\n @newline = \"\\r\\n\"\n end", "def initialize()\n grid = BOARD_NUMBERS.map{ |x| BOARD_ALPHABET.map{ |y| y + x}}.flatten\n @board = Hash[grid.collect { |k| [k, EMPTY]} ]\n end", "def initialize(x, y, width, height, actor, equip_type)\n @actor = actor\n @equip_type = equip_type\n super(x, y, width, height, nil)\n @column_max = 1\n end", "def initialize( table, columns, opts = {} )\n @table = table\n @columns = [ *columns ]\n @opts = opts\n end", "def initialize(table, ext=nil)\n @table=table\n @ext=Hash.new\n @ext=ext if ext.kind_of?(Hash)\n @columns=@table[:default]\n end", "def cell_population(row, column, num)\n @number_grid[row][column] = num\n end", "def initialize\n @cells = Array.new(9,\" \")\n end", "def set_zeros\n return if competition.nil?\n\n self.thousands = 0 unless competition.data_entry_format.thousands? || competition.data_entry_format.hundreds?\n end", "def initialize(digits)\n @value = digits.to_s.to_i\n end", "def initialize(nfil, ncol)\n\t\t\t@nfil = nfil\n\t\t\t@ncol = ncol\n\t\tend", "def initialize(table=Table.new(5,5))\n @table = table # again, no accessor, we dont know if we need to expose this yet.\n end", "def number_hash_def(no1: ,no2: ,no3: 10 )\n\t\t@n1 = no1\n\t\t@n2 = no2\n\t\t@n3 = no3\n\tend", "def initialize(cell, rowOrColumn)\n @column = rowOrColumn\n @cell = cell\n @row = rowOrColumn\n super()\n end", "def create_number_window\n wy = @dummy_window.y\n wh = @dummy_window.height\n @number_window = Window_ShopNumber.new(0, wy, wh)\n @number_window.viewport = @viewport\n @number_window.hide\n @number_window.set_handler(:ok, method(:on_number_ok))\n @number_window.set_handler(:cancel, method(:on_number_cancel))\n end", "def initialize\n\t\t@grid = Array.new(10){Array.new(10)}\n\tend", "def set_num(user_number)\n self.num = user_number\n\n self\n end", "def initialize(val)\n super\n @val = val.to_i\n @years, @months = @val.abs.divmod 12\n if @val < 0\n @years = -@years\n @months = -@months\n end\n @fields = [ @years, @months ]\n end", "def initialize(xlimit, ylimit)\n\t\t@xlimit = xlimit.to_i\n\t\t@ylimit = ylimit.to_i\n\t\traise RangeError, \"Zero (0) is not acceptable as a grid\" if @xlimit <= 0 || @ylimit <= 0\n\tend", "def initialize(value)\n super(GDT_INT4, value)\n end", "def initialize(rows, cols, nz, label: nil)\n @rows = rows\n @cols = cols\n @label = label \n @nz = nz\n end", "def initialize(target_width = DEFAULT_TARGET_WIDTH)\n if target_width.is_a?(String)\n @columns, @rows = target_width.split('x').map(&:to_f)\n else\n @columns = target_width.to_f\n @rows = target_width.to_f * 0.75\n end\n @columns.freeze\n @rows.freeze\n\n initialize_graph_scale\n initialize_attributes\n initialize_store\n\n self.theme = Themes::KEYNOTE\n end", "def __column_data__\n ColumnData.new(@columns, @primary_keys, @to_avoid, @default_values, @associations)\n end", "def initialize(num, options = nil)\n # options[:format] ||= self.class.format\n super(num.is_a?(String) ? Quantity.convert(num) : num, options)\n end", "def force(number) \n @target_number = number\n if number % 15 == 0\n @column_number = (number/15) - 1\n else\n @column_number = (number/15)\n end \n check()\n end", "def initialize(row, col, content = :FREE)\n\t\t\t@content = content\n\t\t\t@row = row\n\t\t\t@col = col\n\t\t\t@flagged = false\n\t\t\t@bombs_count = 0\n\t\t\t@visible = false\n\t\tend" ]
[ "0.66636485", "0.6188842", "0.60418034", "0.5989763", "0.59230673", "0.5914368", "0.5881164", "0.5860243", "0.5813049", "0.5801569", "0.57819146", "0.57643604", "0.5744502", "0.5681385", "0.5670119", "0.5664885", "0.5638313", "0.56342304", "0.563242", "0.5619569", "0.56011343", "0.55711067", "0.55629736", "0.5544467", "0.5500808", "0.54921645", "0.54908746", "0.547775", "0.5469441", "0.54686946", "0.54497814", "0.54444903", "0.54416543", "0.54373753", "0.5436891", "0.54329735", "0.5420021", "0.541658", "0.53938115", "0.53759354", "0.5374648", "0.5374648", "0.53704745", "0.5356915", "0.5353932", "0.5352479", "0.53506404", "0.534111", "0.533284", "0.53313786", "0.5328136", "0.53149796", "0.5313859", "0.5313457", "0.53096426", "0.5300937", "0.529144", "0.5289747", "0.52874625", "0.5271613", "0.5264264", "0.52593696", "0.5255675", "0.5254512", "0.52344674", "0.52310157", "0.52308154", "0.5228136", "0.52160937", "0.5204109", "0.5196854", "0.51948404", "0.5179664", "0.5176773", "0.51692384", "0.5168963", "0.51679254", "0.51660824", "0.51660186", "0.5161503", "0.51598877", "0.51583016", "0.51567197", "0.5153326", "0.51521015", "0.51445806", "0.51436514", "0.5134092", "0.5133734", "0.51304984", "0.512179", "0.5120461", "0.5120417", "0.511207", "0.51109934", "0.5109951", "0.5101955", "0.5101205", "0.5098336", "0.5097836", "0.50970274" ]
0.0
-1
Gets the decimalPlaces property value. How many decimal places to display. See below for information about the possible values.
def decimal_places return @decimal_places end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decimal_places=(value)\n @decimal_places = value\n end", "def decimal_places; end", "def decimal_places\n self.class.decimal_places_cache[subunit_to_unit]\n end", "def decimal_places=(decimal_places)\n if !decimal_places.nil? && decimal_places < 0\n fail ArgumentError, 'invalid value for \"decimal_places\", must be greater than or equal to 0.'\n end\n\n @decimal_places = decimal_places\n end", "def decimal_places\n if subunit_to_unit == 1\n 0\n elsif subunit_to_unit % 10 == 0\n Math.log10(subunit_to_unit).to_s.to_i\n else\n Math.log10(subunit_to_unit).to_s.to_i+1\n end\n end", "def decimals; num_dec; end", "def round_to(decimal_places)\n (self * 10**decimal_places).round.to_f / 10**decimal_places\n end", "def decimal_places_suffix\n \"\"\n end", "def decimal_places_cache\n @decimal_places_cache ||= Hash.new { |h, k| h[k] = Math.log10(k).ceil }\n end", "def precision\n @precision ||= cells.map(&:to_f).map { |n| n.round(3) }.map { |n| n.to_s.split(\".\").last.gsub(/0+$/, \"\").length }.max\n end", "def precision\n self['precision']\n end", "def round_to(decimal_places)\n to_f.round(decimal_places)\n end", "def precision\n @precision = self.class::MAX_PRECISION unless @precision\n return @precision\n end", "def decimals(n, rounded=true)\n digits 10, n, rounded\n end", "def precision\n min.precision || max.precision\n end", "def precision\n @values.fetch(:tp) / Float(@values.fetch(:tp) + @values.fetch(:fp))\n end", "def decimal\n @decimal ||= implied_probability.decimal\n end", "def decimal\n @decimal ||= implied_probability.decimal\n end", "def fractional\n value = to_d * currency.subunit_to_unit\n if self.class.infinite_precision\n value\n else\n value.round(0, self.class.rounding_mode).to_i\n end\n end", "def formatPounds(value, decimal_places = 2)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn \"#{wholeNum}.#{decimal}\".to_f.round(decimal_places).to_s\n\t\tend", "def number_of_decimals(val)\n num = 0\n while (val != val.to_i)\n val *= 10\n num += 1\n end\n num\n end", "def conversion_precision; end", "def amount_cents\n properties['amount_cents'] || 0.0\n end", "def column_value_decimal\n column_value.to_f.to_s\n end", "def cents\n @cents\n end", "def get_precision_of(num)\n str_num = num.to_s\n str_num.include?('.') ? str_num.length - str_num.index('.') - 1 : 0\nend", "def field_precision(key)\n IBM_DB.field_precision(@stmt, key)\n end", "def decimal_limit; end", "def round(float, decimal_places)\n sprintf(\"%.#{decimal_places}f\", float)\n end", "def to_d\n BigDecimal(cents.to_s) / 10 ** precision\n end", "def precision=(val)\n self['precision'] = val\n end", "def precision(f)\n return (f * GeoRecord::SCALE).round.to_f / GeoRecord::SCALE\n end", "def eround(decimal_points = 0)\n (\"%.#{decimal_points}e\" % self).to_f\n end", "def places=(value)\n @places = value\n end", "def to_decimal\n @value.digits.map.with_index do |current, index|\n current * (3 ** index)\n end.sum\n end", "def precision(currency)\n (Mint::Currency.precisions || {}).fetch(to_key(currency), 2)\n end", "def decimal(name, options={})\n param(:decimal, name, options)\n end", "def to_dot_per_inch(**options) = convert_to('dot-per-inch', **options)", "def to_f\n return nil if value.nil?\n value.to_f.with_decimals decimals\n end", "def show_decimal_budget()\n return Money.convert_to_decimal_string(@budget)\n end", "def toDecimal\r\n self\r\n end", "def round_float(float, places); end", "def amount_cents \n (self.amount.to_f * 100).round.to_i\n end", "def decimal_total\n sprintf(\"%03d\", total).insert(-3, \".\")\n end", "def prec\r\n has_prec? ? parms[1].to_i : 0\r\n end", "def precision; end", "def decimal_mark; end", "def extract_precision(sql_type)\n if sql_type == 'money'\n self.class.money_precision\n else\n super\n end\n end", "def entries_per_page\n @entries_per_page\n end", "def to_i\n @value.round\n end", "def to_i\n @value.round\n end", "def to_i\n @value.round\n end", "def importance_fraction\n @grpc.importance_fraction\n end", "def to_s_significant(decimals: 3)\n # NOTE: Similar to something like '\"%g\" % self' in pure ruby but arguably\n # easier to understand. Moreover, it's not an overhead since we have\n # Rails available anyway.\n # SOURCE: http://stackoverflow.com/a/18592312\n # DOC: http://api.rubyonrails.org/v5.2.1/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_precision\n number_with_precision(self,\n precision: decimals,\n significant: false,\n strip_insignificant_zeros: true)\n end", "def cents\n @cents ||= interval_in_cents\n end", "def round_prec(digits)\n #This is a stub, used for indexing\n end", "def db_formatted_km_len( f, long = true )\n return if f.nil?\n if long\n number_with_precision( f, precision: 3, separator: '.', delimiter: ' ' )\n else\n number_with_precision( f, precision: 0, delimiter: ' ')\n end\n end", "def extract_precision(sql_type)\n if sql_type == 'money'\n self.class.money_precision\n else\n super\n end\n end", "def total_units\n return @total_units\n end", "def number_with_precision\n\t\t\"%.2f\" % number\n\tend", "def FLOOR(value, precision = 0)\n value.floor(precision)\n end", "def CEIL(value, precision = 0)\n value.ceil(precision)\n end", "def kilometers\n self.distance\n end", "def total_value_cents\n total_benefits_value\n end", "def meters_per_skein\n data[:meters_per_skein]\n end", "def numero(num, places = 0)\n num = num.to_f if num.is_a? String\n num = num.to_f if num.is_a? BigDecimal\n num = 0 if num.nil?\n places = [0, places].max\n # \"%.#{places}f\" % num.round(places)\n # sprintf(\"%#{places}f\", num.round(places))\n format(\"%.#{places}f\", num.round(places))\nend", "def get_precision\n # Prepare query url.\n _query_builder = config.get_base_uri\n _query_builder << '/response/precision'\n _query_url = APIHelper.clean_url _query_builder\n\n # Prepare and execute HttpRequest.\n _request = config.http_client.get(\n _query_url\n )\n _response = execute_request(_request)\n\n # Validate response against endpoint and global error codes.\n return nil if _response.status_code == 404\n validate_response(_response)\n\n # Return appropriate response type.\n _response.raw_body.to_f\n end", "def display_pct()\n\t sprintf('%0.3f', self.pct())\n\tend", "def fractional\n self\n end", "def type\n 'Edm.Decimal'\n end", "def amount_in_cents\r\n read_attribute(:amount) \r\n end", "def units_per_package\n unit_factor = self.service.displayed_pricing_map.unit_factor\n units_per_package = unit_factor || 1\n\n return units_per_package\n end", "def get_vat_decimal\n case company_business_type\n when 'Rekisteröity yhdistys'\n BigDecimal.new('0')\n else\n BigDecimal.new('0.10') # 10 %\n end\n end", "def get_vat_decimal\n case company_business_type\n when 'Rekisteröity yhdistys'\n BigDecimal.new('0')\n else\n BigDecimal.new('0.10') # 10 %\n end\n end", "def format_dominance(value)\n if value.class != Float\n return \"\"\n end\n dom = value * 100\n \"%E\" % dom\n end", "def currency_limit currency_float\n\t\t((currency_float * 100).round / 100.0).to_f\n\tend", "def deviating_rounding_amount\n self.EventLog.lines.last[/avvik: \\d\\.\\d\\d/][/\\d.\\d\\d/].to_f\n rescue\n 0\n end", "def formatted_number(decimal)\n decimal.truncate(NUM_DECIMAL_PLACES).to_s(FLOATING_POINT_NOTATION)\n end", "def to_s\n s = sprintf(\"%0.#{@currency.decimal_places}f\", amount)\n s.gsub(\".\", decimal_mark)\n end", "def precision_axis\n precision_axis_and_area.precision_axis\n end", "def number_f\n return @number_f\n end", "def decimal_latitude\n @ce.andand.latitude.to_s\n end", "def to_f\n (BigDecimal.new(cents.to_s) / currency.subunit_to_unit).to_f\n end", "def to_f\n (BigDecimal.new(cents.to_s) / currency.subunit_to_unit).to_f\n end", "def precision_at_fraction_recall val\n @p.each_index do |i|\n return actual_precision(i) if tpr(i) < val\n end\n 0.0\n end", "def format(precision) # :nodoc:\r\n (precision == nil || precision == 0) ? \"%s\" : \"%.#{precision}f\"\r\n end", "def price_in_cents\n (cart.total_price*100).round\n end", "def two_decimal_places(n)\n puts n.round(2)\n raise NotImplementedError.new \"TODO: two_decimal_places\"\nend", "def cents; end", "def fee_cents\n (fee.to_f * 100.0).round\n end", "def to_f\n @total\n end", "def to_f\n @total\n end", "def to_f\n @total\n end", "def to_f\n @total\n end", "def price_per_g\n\t\tself['price'].to_f / self['unit_weight'].to_f\n\tend", "def amount\n\n @amount_bigdecimal.to_f.round(2)\n\n end", "def prolificness\n # prolificness = num_paintings / years_experience\n paintings.size / years_experience.to_f\n end", "def decimal(s)\n BigDecimal.new(s)\n end", "def number_with_precision(number, options = {})\n SitemapGenerator::Utilities.symbolize_keys!(options)\n\n number = begin\n Float(number)\n rescue ArgumentError, TypeError\n if options[:raise]\n raise InvalidNumberError, number\n else\n return number\n end\n end\n\n defaults = {\n :separator => \".\",\n :delimiter => \",\",\n :precision => 3,\n :significant => false,\n :strip_insignificant_zeros => false\n }\n precision_defaults = {\n :delimiter => \"\"\n }\n defaults = defaults.merge(precision_defaults)\n\n options = SitemapGenerator::Utilities.reverse_merge(options, defaults) # Allow the user to unset default values: Eg.: :significant => false\n precision = options.delete :precision\n significant = options.delete :significant\n strip_insignificant_zeros = options.delete :strip_insignificant_zeros\n\n if significant and precision > 0\n if number == 0\n digits, rounded_number = 1, 0\n else\n digits = (Math.log10(number.abs) + 1).floor\n rounded_number = (SitemapGenerator::BigDecimal.new(number.to_s) / SitemapGenerator::BigDecimal.new((10 ** (digits - precision)).to_f.to_s)).round.to_f * 10 ** (digits - precision)\n digits = (Math.log10(rounded_number.abs) + 1).floor # After rounding, the number of digits may have changed\n end\n precision = precision - digits\n precision = precision > 0 ? precision : 0 #don't let it be negative\n else\n rounded_number = SitemapGenerator::Utilities.round(SitemapGenerator::BigDecimal.new(number.to_s), precision).to_f\n end\n formatted_number = number_with_delimiter(\"%01.#{precision}f\" % rounded_number, options)\n if strip_insignificant_zeros\n escaped_separator = Regexp.escape(options[:separator])\n formatted_number.sub(/(#{escaped_separator})(\\d*[1-9])?0+\\z/, '\\1\\2').sub(/#{escaped_separator}\\z/, '')\n else\n formatted_number\n end\n\n end", "def to_inches\n Inches.new(@val.to_f / 1440)\n end" ]
[ "0.79378015", "0.72057074", "0.6854736", "0.6664293", "0.6383574", "0.63156074", "0.59380436", "0.5906819", "0.5783315", "0.571241", "0.5590575", "0.5509442", "0.5485004", "0.54627514", "0.5427095", "0.53781307", "0.5353258", "0.5353258", "0.53439474", "0.53133315", "0.52757716", "0.5220031", "0.51830375", "0.51666045", "0.5161068", "0.5147914", "0.51451576", "0.5111416", "0.507961", "0.49856737", "0.49810544", "0.49366105", "0.49222344", "0.491779", "0.48753768", "0.4824488", "0.48008192", "0.47688347", "0.47265753", "0.47234982", "0.47017223", "0.46910587", "0.46842396", "0.46534967", "0.46417657", "0.4617231", "0.4604937", "0.4567195", "0.4541249", "0.45332208", "0.45332208", "0.45332208", "0.45324877", "0.45285976", "0.45227614", "0.45118505", "0.4500625", "0.44573426", "0.4428152", "0.44170815", "0.44015107", "0.43924642", "0.43912438", "0.43861696", "0.4364794", "0.43637422", "0.43565872", "0.43562737", "0.43523452", "0.43417838", "0.4330935", "0.43295604", "0.4327161", "0.4327161", "0.43195406", "0.43120828", "0.4307063", "0.430657", "0.42956796", "0.42867482", "0.42821437", "0.4277785", "0.42682627", "0.42682627", "0.42489693", "0.4244997", "0.42404968", "0.4233144", "0.42325714", "0.42313606", "0.42301008", "0.42301008", "0.42301008", "0.42301008", "0.42240682", "0.42237663", "0.42192775", "0.42175508", "0.4215107", "0.42135042" ]
0.8294227
0
Sets the decimalPlaces property value. How many decimal places to display. See below for information about the possible values.
def decimal_places=(value) @decimal_places = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def decimal_places=(decimal_places)\n if !decimal_places.nil? && decimal_places < 0\n fail ArgumentError, 'invalid value for \"decimal_places\", must be greater than or equal to 0.'\n end\n\n @decimal_places = decimal_places\n end", "def decimal_places\n return @decimal_places\n end", "def decimal_places; end", "def round_to(decimal_places)\n (self * 10**decimal_places).round.to_f / 10**decimal_places\n end", "def decimal_places\n self.class.decimal_places_cache[subunit_to_unit]\n end", "def precision=(val)\n self['precision'] = val\n end", "def set_precision(precision)\n @precision = precision\n end", "def round_to(decimal_places)\n to_f.round(decimal_places)\n end", "def places=(value)\n @places = value\n end", "def decimal_places_cache\n @decimal_places_cache ||= Hash.new { |h, k| h[k] = Math.log10(k).ceil }\n end", "def decimals; num_dec; end", "def round(float, decimal_places)\n sprintf(\"%.#{decimal_places}f\", float)\n end", "def decimals(n, rounded=true)\n digits 10, n, rounded\n end", "def decimal_places\n if subunit_to_unit == 1\n 0\n elsif subunit_to_unit % 10 == 0\n Math.log10(subunit_to_unit).to_s.to_i\n else\n Math.log10(subunit_to_unit).to_s.to_i+1\n end\n end", "def decimal(name, options={})\n param(:decimal, name, options)\n end", "def decimal_places_suffix\n \"\"\n end", "def formatPounds(value, decimal_places = 2)\n\t\t\twholeNum = value[1, 4] #Pulls the 2nd (A), 3rd (B), 4th (C) and 5th (D) digit from the format 0ABCDdddd where 'd' is the decimal portion of the eVS weight convention\n\t\t\tdecimal = value[5, 4] #Pulls the decimal portion\n\t\t\treturn \"#{wholeNum}.#{decimal}\".to_f.round(decimal_places).to_s\n\t\tend", "def round_float(float, places); end", "def tolerance=(val)\n @colt_property.setTolerance(val)\n end", "def field_precision(key)\n IBM_DB.field_precision(@stmt, key)\n end", "def decimal_limit; end", "def precision\n @precision ||= cells.map(&:to_f).map { |n| n.round(3) }.map { |n| n.to_s.split(\".\").last.gsub(/0+$/, \"\").length }.max\n end", "def price_in_cents=(cents)\n\t\t@price = cents / 100.0\n\tend", "def price_in_cents=(cents)\n\t\t@price = cents / 100.0\n\tend", "def apply_validations_for_decimal\n apply_validations_for_float\n end", "def coordinate_format=(*args)\n\t self.integer_places, self.decimal_places = args.flatten.map {|a| a.to_i }\n\t @total_places = self.decimal_places + self.integer_places\n\tend", "def conversion_precision; end", "def number_with_precision(number, options = {})\n SitemapGenerator::Utilities.symbolize_keys!(options)\n\n number = begin\n Float(number)\n rescue ArgumentError, TypeError\n if options[:raise]\n raise InvalidNumberError, number\n else\n return number\n end\n end\n\n defaults = {\n :separator => \".\",\n :delimiter => \",\",\n :precision => 3,\n :significant => false,\n :strip_insignificant_zeros => false\n }\n precision_defaults = {\n :delimiter => \"\"\n }\n defaults = defaults.merge(precision_defaults)\n\n options = SitemapGenerator::Utilities.reverse_merge(options, defaults) # Allow the user to unset default values: Eg.: :significant => false\n precision = options.delete :precision\n significant = options.delete :significant\n strip_insignificant_zeros = options.delete :strip_insignificant_zeros\n\n if significant and precision > 0\n if number == 0\n digits, rounded_number = 1, 0\n else\n digits = (Math.log10(number.abs) + 1).floor\n rounded_number = (SitemapGenerator::BigDecimal.new(number.to_s) / SitemapGenerator::BigDecimal.new((10 ** (digits - precision)).to_f.to_s)).round.to_f * 10 ** (digits - precision)\n digits = (Math.log10(rounded_number.abs) + 1).floor # After rounding, the number of digits may have changed\n end\n precision = precision - digits\n precision = precision > 0 ? precision : 0 #don't let it be negative\n else\n rounded_number = SitemapGenerator::Utilities.round(SitemapGenerator::BigDecimal.new(number.to_s), precision).to_f\n end\n formatted_number = number_with_delimiter(\"%01.#{precision}f\" % rounded_number, options)\n if strip_insignificant_zeros\n escaped_separator = Regexp.escape(options[:separator])\n formatted_number.sub(/(#{escaped_separator})(\\d*[1-9])?0+\\z/, '\\1\\2').sub(/#{escaped_separator}\\z/, '')\n else\n formatted_number\n end\n\n end", "def precision\n min.precision || max.precision\n end", "def to_dot_per_inch(**options) = convert_to('dot-per-inch', **options)", "def set_DistanceEstimate(value)\n set_input(\"DistanceEstimate\", value)\n end", "def round_prec(digits)\n #This is a stub, used for indexing\n end", "def set_Percentages(value)\n set_input(\"Percentages\", value)\n end", "def precision\n @values.fetch(:tp) / Float(@values.fetch(:tp) + @values.fetch(:fp))\n end", "def FLOOR(value, precision = 0)\n value.floor(precision)\n end", "def decimal\n @decimal ||= implied_probability.decimal\n end", "def decimal\n @decimal ||= implied_probability.decimal\n end", "def precision\n self['precision']\n end", "def precision= (f)\n\n raise 'precision must be 0.0 < p <= 1.0' \\\n if f <= 0.0 or f > 1.0\n\n @precision = f\n end", "def round_to(precision=0)\n mulitplier = 10.0 ** (precision)\n (((((self)*mulitplier).round).to_f)/mulitplier)\n end", "def ROUND(value, precision = 0)\n value.round(precision)\n end", "def format(precision) # :nodoc:\r\n (precision == nil || precision == 0) ? \"%s\" : \"%.#{precision}f\"\r\n end", "def decimal_mark; end", "def amount_cents\n properties['amount_cents'] || 0.0\n end", "def round(num, decimals=3)\n return \"\" unless num\n \"%.#{decimals}f\" % num\n end", "def precision(f)\n return (f * GeoRecord::SCALE).round.to_f / GeoRecord::SCALE\n end", "def initialize(options = {})\n @precision = options[:precision] || :none\n @separator = options[:separator] || '.'\n @delimiter = options[:delimiter] || ','\n @precision_limit = options[:precision_limit] || 4\n end", "def price=(dollars)\n self.price_in_cents = dollars.to_f * 100\n end", "def entries_per_page=(entries)\n @entries_per_page = entries\n end", "def set_FloorspaceEstimate(value)\n set_input(\"FloorspaceEstimate\", value)\n end", "def round(precision = nil)\n if precision\n magnitude = 10.0 ** precision\n (self * magnitude).round / magnitude\n else\n super()\n end\n end", "def round(value, decimal)\n round_to_significance(value, decimal_to_significance(decimal), :round)\n end", "def number_of_decimals(val)\n num = 0\n while (val != val.to_i)\n val *= 10\n num += 1\n end\n num\n end", "def formatted_number(decimal)\n decimal.truncate(NUM_DECIMAL_PLACES).to_s(FLOATING_POINT_NOTATION)\n end", "def set_millimeters\n\t @units = 'millimeters'\n\t current_layer.set_millimeters\n\tend", "def eround(decimal_points = 0)\n (\"%.#{decimal_points}e\" % self).to_f\n end", "def stop_tones=(value)\n @stop_tones = value\n end", "def initialize(cents, currency = default_currency, precision = 2)\n @cents, @currency, @precision = cents.round, currency, precision\n end", "def set_options\n if minimum.present? && maximum.present? && step.present? && step.to_f.nonzero?\n if default_value.present?\n decimal_minimum = BigDecimal(minimum.to_s)\n decimal_maximum = BigDecimal(maximum.to_s)\n decimal_step = BigDecimal(step.to_s)\n decimal_default = BigDecimal(default_value.to_s)\n\n # The default value is lower than the minimum value.\n if decimal_default < decimal_minimum\n errors.add(:default_value, _('must be a valid option'))\n end\n\n # The default value less than a step away from the maximum value.\n if ((decimal_maximum - decimal_default) / decimal_step).floor.zero?\n errors.add(:default_value, _('must be a step away from the maximum'))\n end\n\n # The default value less than a step away from the minimum value.\n steps = ((decimal_default - decimal_minimum) / decimal_step).floor\n if steps.zero?\n errors.add(:default_value, _('must be a step away from the minimum'))\n end\n\n self.options = ((decimal_default - decimal_step * steps)...decimal_default).step(decimal_step).map(&:to_f) + (decimal_default..decimal_maximum).step(decimal_step).map(&:to_f)\n unless options.first == minimum.to_f\n self.options.unshift(minimum.to_f)\n end\n unless options.last == maximum.to_f\n self.options << maximum.to_f\n end\n else\n errors.add(:default_value, :blank)\n end\n else\n self.options = []\n end\n end", "def number_with_precision\n\t\t\"%.2f\" % number\n\tend", "def precision\n @precision = self.class::MAX_PRECISION unless @precision\n return @precision\n end", "def store_decimal(key, process, options)\n store_numeric(key, process, options)\n if(options.has_key?(:round) and options[:round].kind_of?(Integer))\n filtered[key] = filtered[key].round(options[:round]) if filtered.has_key?(key)\n elsif(options.has_key?(:floor) and options[:floor] == true)\n filtered[key] = filtered[key].floor if filtered.has_key?(key)\n elsif(options.has_key?(:ceil) and options[:ceil] == true)\n filtered[key] = filtered[key].ceil if filtered.has_key?(key)\n end\n end", "def decimal_total\n sprintf(\"%03d\", total).insert(-3, \".\")\n end", "def CEIL(value, precision = 0)\n value.ceil(precision)\n end", "def price_string=(val)\n\t\tif val =~ /(\\d+(\\.\\d+)?)/\n\t\t\tself.price_cents = ($1.to_f * 100).to_i # convert to cents\n\t\telse\n\t\t\traise \"Couldn't turn this into a price: #{val.inspect}\"\n\t\tend\n\tend", "def number_with_delimiter(number, options = {})\n SitemapGenerator::Utilities.symbolize_keys!(options)\n\n begin\n Float(number)\n rescue ArgumentError, TypeError\n if options[:raise]\n raise InvalidNumberError, number\n else\n return number\n end\n end\n\n defaults = {\n :separator => \".\",\n :delimiter => \",\",\n :precision => 3,\n :significant => false,\n :strip_insignificant_zeros => false\n }\n options = SitemapGenerator::Utilities.reverse_merge(options, defaults)\n\n parts = number.to_s.to_str.split('.')\n parts[0].gsub!(/(\\d)(?=(\\d\\d\\d)+(?!\\d))/, \"\\\\1#{options[:delimiter]}\")\n parts.join(options[:separator])\n end", "def round(number, precision)\n ((number * 10**precision).round.to_f) / (10**precision)\n end", "def toDecimal\r\n self\r\n end", "def value=(new_value)\n validate(BigDecimal(new_value.to_s))\n @value = new_value.to_s\n end", "def column_value_decimal\n column_value.to_f.to_s\n end", "def precision(currency)\n (Mint::Currency.precisions || {}).fetch(to_key(currency), 2)\n end", "def spot_price_fraction(val=nil)\n if val\n spot_price( price.to_f * val )\n else\n spot_price / price rescue 0\n end\n end", "def to_precision(num)\n self.class.new(a, b, c, precision: num)\n end", "def tabsize=(value)\n\t\t\teditor.tabsize= value\n\t\tend", "def numero(num, places = 0)\n num = num.to_f if num.is_a? String\n num = num.to_f if num.is_a? BigDecimal\n num = 0 if num.nil?\n places = [0, places].max\n # \"%.#{places}f\" % num.round(places)\n # sprintf(\"%#{places}f\", num.round(places))\n format(\"%.#{places}f\", num.round(places))\nend", "def setScaleFactor(factor)\n if (!(Integer(factor) > 0))\n raise Error.new(Pdfcrowd.create_invalid_value_message(factor, \"setScaleFactor\", \"pdf-to-html\", \"Must be a positive integer number.\", \"set_scale_factor\"), 470);\n end\n \n @fields['scale_factor'] = factor\n self\n end", "def to_decimal(float_price)\n decimal.Decimal('%<float_price>.2f', float_price: float_price)\nend", "def set_zeros\n return if competition.nil?\n\n self.thousands = 0 unless competition.data_entry_format.thousands? || competition.data_entry_format.hundreds?\n end", "def setScaleFactor(factor)\n if (!(Integer(factor) >= 10 && Integer(factor) <= 500))\n raise Error.new(Pdfcrowd.create_invalid_value_message(factor, \"setScaleFactor\", \"html-to-pdf\", \"The value must be in the range 10-500.\", \"set_scale_factor\"), 470);\n end\n \n @fields['scale_factor'] = factor\n self\n end", "def precision; end", "def to_d\n BigDecimal(cents.to_s) / 10 ** precision\n end", "def set_Distance(value)\n set_input(\"Distance\", value)\n end", "def set_Distance(value)\n set_input(\"Distance\", value)\n end", "def set_Distance(value)\n set_input(\"Distance\", value)\n end", "def set_Distance(value)\n set_input(\"Distance\", value)\n end", "def set_Distance(value)\n set_input(\"Distance\", value)\n end", "def decimal(s)\n BigDecimal.new(s)\n end", "def round_float(fp_number, d_place)\n assert_nothing_raised do\n return (fp_number * 10**d_place).round.to_f / 10**d_place\n end\n end", "def set_DistanceClass(value)\n set_input(\"DistanceClass\", value)\n end", "def round(value)\n ( (value.to_f + @min_margin) / @multiple_of ).ceil * @multiple_of\n end", "def initialize(value)\n @cents = (Money.get_value(value)*100.0).round\n end", "def round(precision = nil)\n\t\tif precision\n\t\t\tmagnitude = 10.0 ** precision\n\t\t\t(self * magnitude).round / magnitude\n\t\telse\n\t\t\tprecisionless_round\n\t\tend\n\tend", "def to_s_significant(decimals: 3)\n # NOTE: Similar to something like '\"%g\" % self' in pure ruby but arguably\n # easier to understand. Moreover, it's not an overhead since we have\n # Rails available anyway.\n # SOURCE: http://stackoverflow.com/a/18592312\n # DOC: http://api.rubyonrails.org/v5.2.1/classes/ActionView/Helpers/NumberHelper.html#method-i-number_with_precision\n number_with_precision(self,\n precision: decimals,\n significant: false,\n strip_insignificant_zeros: true)\n end", "def set_margin_bottom(margin = 1.00)\n @margin_bottom = margin\n end", "def percentage(number, precision = 2)\n return if number.to_s.empty?\n\n ret = \"%02.#{ precision }f%\" % number\n ret.gsub(/\\.0*%$/, '%')\n end", "def ceil(value, decimal)\n round_to_significance(value, decimal_to_significance(decimal), :ceil)\n end", "def marginBottom=(value)\n\t\t\t@marginBottom = value\n\t\tend", "def leftPlaces=(leftPlaces)\n \t\t@leftPlaces = leftPlaces\n\t\tif (leftPlaces < 0)\n\t\t\t\"We ran out of space at this conference day\"\t\t\n\t\tend\n \tend", "def set_Price(value)\n set_input(\"Price\", value)\n end", "def setMarginBottom(bottom)\n unless /(?i)^0$|^[0-9]*\\.?[0-9]+(pt|px|mm|cm|in)$/.match(bottom)\n raise Error.new(Pdfcrowd.create_invalid_value_message(bottom, \"setMarginBottom\", \"html-to-pdf\", \"The value must be specified in inches \\\"in\\\", millimeters \\\"mm\\\", centimeters \\\"cm\\\", pixels \\\"px\\\", or points \\\"pt\\\".\", \"set_margin_bottom\"), 470);\n end\n \n @fields['margin_bottom'] = bottom\n self\n end" ]
[ "0.78652674", "0.6619695", "0.6260934", "0.5837648", "0.5775854", "0.57409495", "0.5514737", "0.5460927", "0.5347748", "0.53474444", "0.51275134", "0.5071308", "0.5048323", "0.504428", "0.50328684", "0.5009434", "0.49796298", "0.47458932", "0.474393", "0.45743322", "0.4556078", "0.45437294", "0.4543279", "0.4543279", "0.44787478", "0.44552878", "0.44473886", "0.44281787", "0.44100007", "0.4388131", "0.4327033", "0.43165407", "0.43099353", "0.42930734", "0.42691484", "0.42615265", "0.42615265", "0.42383444", "0.42365366", "0.42270684", "0.42163765", "0.4207188", "0.4196051", "0.4169617", "0.4162623", "0.41516477", "0.41493565", "0.41423947", "0.41328904", "0.4120683", "0.410861", "0.41000524", "0.40977806", "0.4092387", "0.40821552", "0.40650117", "0.405641", "0.4049048", "0.40438062", "0.40267295", "0.40166336", "0.3988897", "0.39837003", "0.3969171", "0.39462057", "0.39421913", "0.3931328", "0.3904764", "0.3895172", "0.38927713", "0.38844964", "0.38824493", "0.38800338", "0.3866761", "0.38642132", "0.38494742", "0.38478303", "0.383178", "0.3829648", "0.3827169", "0.3821346", "0.38108295", "0.38108295", "0.38108295", "0.38108295", "0.38108295", "0.38102794", "0.38084617", "0.3807398", "0.3806748", "0.37958962", "0.37877503", "0.37727854", "0.3772337", "0.37641084", "0.3759036", "0.37581664", "0.37355965", "0.37312979", "0.37152237" ]
0.84519744
0
Gets the displayAs property value. How the value should be presented in the UX. Must be one of number or percentage. If unspecified, treated as number.
def display_as return @display_as end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_as=(value)\n @display_as = value\n end", "def display_value\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n \"#{self.value} #{self.multiplier}(s) <span class='badge'>#{self.convert_value_by_type} bytes</span>\"\n else\n self.value\n end\n when 'Boolean'\n self.value == '1' ? 'Yes' : 'No'\n else\n self.value\n end\n end", "def display_value(value)\n return \"N/A\" if value.zero?\n number_to_currency(value, precision: 0)\n end", "def display\n @attributes[:display]\n end", "def show_percentage\n return @show_percentage\n end", "def display_format\n value = self.format_str ||\n I18n.t(self.format, :scope => [:bento_search, :format], :default => self.format.to_s.titleize)\n\n return value.blank? ? nil : value\n end", "def formatted_value\n @formatted_value\n end", "def display_as\n params[:display_as]\n end", "def compute_human_value\n case @value\n when :false\n 'No'\n when :true\n 'Yes'\n when :nil\n \"N/\\A\"\n else\n @value.to_s\n end\n end", "def display_number\n self['display_number'] ||= self.class.mask(number)\n self['display_number']\n end", "def get_value(owner)\n raw_value = owner.get_raw_property_value(name)\n\n if raw_value.nil?\n return nil\n else\n case type\n when 'string' then raw_value\n when 'integer' then raw_value\n when 'decimal' then raw_value\n when 'length' then \"#{raw_value}px\"\n when 'color' then sprintf('#%06x', raw_value)\n when 'percent' then \"#{(raw_value*100).to_i}%\"\n end\n end\n end", "def show_value\n return @show_value\n end", "def show_value_label_method\n value.to_s\n end", "def display_field\n current_field_values_with_field_type_id(field_types.first.id).first.try(:value) || 'no display field available'\n end", "def formatted_value\n return @value if @value.blank?\n\n set_type\n end", "def show_perc?\n @perc\n end", "def display\n to_h.fetch(:display)\n end", "def display\n to_h.fetch(:display)\n end", "def formatted_value\n value = params[:value].to_s\n case value\n when value.to_i.to_s\n value.to_i\n when value.to_f.to_s\n value.to_f\n when 'true', 'false'\n value == 'true'\n else\n value\n end\n end", "def display_number\n self.class.mask(number)\n end", "def human_value(attribute_name)\n value = send(attribute_name)\n self.class.human_attribute_value attribute_name, value\n end", "def descr_value\n @value.to_s\n end", "def to_s\n \"#{( \"%.f\" % @value )}#{'%'} \"\n end", "def display_number\n self.class.mask(number)\n end", "def humanized_rating\r\n rating.to_f > 0 ? sprintf(\"%.1f\", rating) : nil\r\n end", "def display_pct()\n\t sprintf('%0.3f', self.pct())\n\tend", "def rating_display(rating)\n rating = default_class(rating)\n return nil if rating.nil?\n if %w[fa ga fl].include? rating\n return rating\n else\n return rating[0] # use the first letter of the rating as the abbreviated version\n end\n end", "def showValue(quantity)\n ActionController::Base.helpers.number_to_currency(self.getValue(quantity), precision: 0, delimiter: \".\")\n end", "def show_percentage=(value)\n @show_percentage = value\n end", "def discount_display\n if unit == :percent\n \"-#{discount.to_i}%\"\n else\n \"-#{discount.in_euro.to_yuan.display}\"\n end\n end", "def display_label\n return Xref.find(self.display_xref_id).display_label\n end", "def display_label\n return Xref.find(self.display_xref_id).display_label\n end", "def display_label\n return Xref.find(self.display_xref_id).display_label\n end", "def describe\n return @magnitude.to_s if magnitude?\n u_descr = Units.units_descr(@units, true)\n \"#{@magnitude} #{u_descr}\"\n end", "def display\n return @display + \" Health:#{@health} Attack:#{@attack} Defense:#{@defense}\"\n end", "def polymorphic_value_for(resource)\n value_for(resource).send(polymorphic_display_value)\n end", "def display_name\n @attributes[:display_name]\n end", "def display(row)\n field_components = @display_field.split(\".\")\n field_components.inject(row) do |object, field|\n object.try(field) || \"n/a\"\n end\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 display_name\n @hash['display_name']\n end", "def value\n @value.to_f\n end", "def to_s\n display_name\n end", "def display_name\n return @display_name\n end", "def format_pct_value(ror)\n (ror * 100).round(1)\n end", "def display_price\n price = if respond_to?(:display_amount)\n display_amount\n else\n display_base_price\n end.to_s\n\n return price if ::Spree::Avatax::Config.tax_calculation\n return price if taxes.empty? || amount == 0\n\n tax_explanations = taxes.map(&:label).join(tax_label_separator)\n\n I18n.t :display_price_with_explanations,\n scope: 'spree.shipping_rate.display_price',\n price: price,\n explanations: tax_explanations\n end", "def describe_value(value)\r\n\t\t\tvalue\r\n\t\tend", "def display_name\n @display_name\n end", "def as_text\n @value.as_text\n end", "def display? attribute = true\n \"style=#{display(attribute)}\"\n end", "def display_text\n return @display_text\n end", "def user_display_name\n @attributes[:user_display_name]\n end", "def display_price\n price = if respond_to?(:display_amount)\n display_amount\n else\n display_base_price\n end.to_s\n\n return price if Spree::Avatax::Config.tax_calculation\n return price if taxes.empty? || amount == 0\n\n tax_explanations = taxes.map(&:label).join(tax_label_separator)\n\n Spree.t :display_price_with_explanations,\n scope: 'shipping_rate.display_price',\n price: price,\n explanations: tax_explanations\n end", "def display_value(count)\n return \"- \" if count.nil?\n return \"0 \" if count.zero?\n\n case Math.log10(count).floor\n when 1...4 then '%d ' % count\n when 4...7 then '%dk' % (count / 1000)\n when 7...10 then '%dM' % (count / 1000_000)\n when 10...13 then '%dG' % (count / 1000_000_000)\n when 13...16 then '%dT' % (count / 1000_000_000_000)\n else '%dP' % (count / 1000_000_000_000_000)\n end\n\n end", "def to_s\n @value.to_f.to_s\n end", "def get_display_name\n @display_name ||= self.user.display_name\n end", "def pretty_metric_value(value)\n case value\n when Float, BigDecimal\n \"#{number_with_delimiter(value.floor)}%\"\n when Integer\n number_with_delimiter value\n when Date, Time\n l value.to_date\n when Array\n value.to_sentence\n else\n value\n end\n end", "def display_name\n @data['display_name']\n end" ]
[ "0.6946745", "0.64114344", "0.6094438", "0.60136867", "0.594675", "0.5850479", "0.58494115", "0.5813908", "0.57994914", "0.5788746", "0.56153053", "0.5596943", "0.5496521", "0.5465239", "0.5362395", "0.5357115", "0.52523196", "0.52523196", "0.5213264", "0.51875585", "0.51766163", "0.51723784", "0.51618165", "0.5122921", "0.5117804", "0.5112088", "0.5102715", "0.5100481", "0.5099243", "0.50582486", "0.5046863", "0.5046863", "0.5046863", "0.50191134", "0.50177497", "0.49709284", "0.49696952", "0.49692696", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4960892", "0.4937677", "0.49242115", "0.49223307", "0.490964", "0.4909476", "0.49026287", "0.4884188", "0.4875123", "0.48748955", "0.48671094", "0.48471323", "0.483921", "0.48347723", "0.48269486", "0.4821275", "0.48194623", "0.48120126", "0.4805519" ]
0.67938846
1
Sets the displayAs property value. How the value should be presented in the UX. Must be one of number or percentage. If unspecified, treated as number.
def display_as=(value) @display_as = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def display_as\n return @display_as\n end", "def display_as\n params[:display_as]\n end", "def display_value(value)\n return \"N/A\" if value.zero?\n number_to_currency(value, precision: 0)\n end", "def display_value\n case self.value_type\n when 'Numeric'\n unless self.multiplier.nil? || self.multiplier.blank?\n \"#{self.value} #{self.multiplier}(s) <span class='badge'>#{self.convert_value_by_type} bytes</span>\"\n else\n self.value\n end\n when 'Boolean'\n self.value == '1' ? 'Yes' : 'No'\n else\n self.value\n end\n end", "def display_number\n self['display_number'] ||= self.class.mask(number)\n self['display_number']\n end", "def display\n @attributes[:display]\n end", "def show_percentage=(value)\n @show_percentage = value\n end", "def display_number\n self.class.mask(number)\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_name=(value)\n @display_name = value\n end", "def display_format\n value = self.format_str ||\n I18n.t(self.format, :scope => [:bento_search, :format], :default => self.format.to_s.titleize)\n\n return value.blank? ? nil : value\n end", "def display_number\n self.class.mask(number)\n end", "def display_name=(value)\n @display_name = value\n end", "def sort_show(value)\n @ole.SortShow = value\n nil\n end", "def display\n to_h.fetch(:display)\n end", "def display\n to_h.fetch(:display)\n end", "def show_percentage\n return @show_percentage\n end", "def show_value=(value)\n @show_value = value\n end", "def display_name=(name)\n @display_name ||= name\n end", "def only_display=(only_display)\n validator = EnumAttributeValidator.new('String', [\"DoNotDisplay\", \"Closed30Days\", \"Closed60Days\", \"Closed90Days\", \"Closed120Days\", \"AllClosed\"])\n unless validator.valid?(only_display)\n fail ArgumentError, \"invalid value for 'only_display', must be one of #{validator.allowable_values}.\"\n end\n @only_display = only_display\n end", "def display_blanks_as=(v) Axlsx.validate_display_blanks_as(v); @display_blanks_as = v; end", "def formatted_value\n return @value if @value.blank?\n\n set_type\n end", "def asu=(asu)\n if !asu.nil? && asu > 97\n fail ArgumentError, 'invalid value for \"asu\", must be smaller than or equal to 97.'\n end\n\n if !asu.nil? && asu < -5\n fail ArgumentError, 'invalid value for \"asu\", must be greater than or equal to -5.'\n end\n\n @asu = asu\n end", "def display_text=(value)\n @display_text = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def show_value_label_method\n value.to_s\n end", "def formatted_value=(obj)\n @formatted_value = obj\n end", "def inplace_editable_default_display_with(value); value; end", "def formatted_value\n @formatted_value\n end", "def displayalerts= displayalerts_value\n @displayalerts = displayalerts_value\n @ole_excel.DisplayAlerts = @displayalerts == :if_visible ? @ole_excel.Visible : displayalerts_value\n end", "def show_as(*args, &proc) # :yields: field_def or nil\n @view_control.show_as(*args, &proc)\n end", "def display(row)\n field_components = @display_field.split(\".\")\n field_components.inject(row) do |object, field|\n object.try(field) || \"n/a\"\n end\n end", "def setDisplayTitle(value)\n @fields['display_title'] = value\n self\n end", "def setDisplayTitle(value)\n @fields['display_title'] = value\n self\n end", "def setDisplayTitle(value)\n @fields['display_title'] = value\n self\n end", "def display_price\n price = if respond_to?(:display_amount)\n display_amount\n else\n display_base_price\n end.to_s\n\n return price if ::Spree::Avatax::Config.tax_calculation\n return price if taxes.empty? || amount == 0\n\n tax_explanations = taxes.map(&:label).join(tax_label_separator)\n\n I18n.t :display_price_with_explanations,\n scope: 'spree.shipping_rate.display_price',\n price: price,\n explanations: tax_explanations\n end", "def display\n @object.send(Innsights.user_display)\n end", "def show_value\n return @show_value\n end", "def display_type=(display_type)\n validator = EnumAttributeValidator.new('String', ['text', 'check', 'qrcode', 'barcode', 'image', 'shape'])\n unless validator.valid?(display_type)\n fail ArgumentError, 'invalid value for \"display_type\", must be one of #{validator.allowable_values}.'\n end\n @display_type = display_type\n end", "def show_as(*args, &proc)\n # RAILS_DEFAULT_LOGGER.debug('set show_as proc to ' + proc.inspect)\n opts = (args.last.is_a?(Hash) && args.pop) || {}\n if opts[:show_wrap_proc]\n if opts[:show_wrap_proc].is_a?(Proc)\n self.show_wrap_proc = opts[:show_wrap_proc]\n end\n else\n self.show_wrap_proc = nil\n end\n if block_given?\n self.show_as_proc = proc\n else\n if args.first\n self.show_as_proc = Proc.new do\n args.first.to_s\n end\n end\n end\n end", "def display? attribute = true\n \"style=#{display(attribute)}\"\n end", "def display_price\n price = if respond_to?(:display_amount)\n display_amount\n else\n display_base_price\n end.to_s\n\n return price if Spree::Avatax::Config.tax_calculation\n return price if taxes.empty? || amount == 0\n\n tax_explanations = taxes.map(&:label).join(tax_label_separator)\n\n Spree.t :display_price_with_explanations,\n scope: 'shipping_rate.display_price',\n price: price,\n explanations: tax_explanations\n end", "def show(value)\n @ole.Show = value\n nil\n end", "def full_display\n if displayName.blank? || netid.blank?\n short_display\n else\n \"#{displayName} (#{netid})\"\n end\n end", "def display_name=(value)\n @children['display-name'][:value] = value\n end", "def display_params\n params.require(:display).permit(:name, :active, :order, :resolution)\n end", "def display_name\n @attributes[:display_name]\n end", "def formatted_attributes\n Hash[display_key.downcase.to_sym, values.collect { |el| el[:displayValue] }]\n end", "def display_field\n current_field_values_with_field_type_id(field_types.first.id).first.try(:value) || 'no display field available'\n end", "def set_attribute_display\n @attribute_display = AttributeDisplay.find(params[:id])\n end", "def display_name(display_name)\n @display_name = display_name\n self\n end", "def display_boolean(value:)\n return 'Unspecified' if value.nil?\n\n value ? 'Yes' : 'No'\n end", "def display(attr)\n attr unless attr.nil?\n end", "def to_s\n display_name\n end", "def presentation_format=(v)\n Axlsx.validate_string v\n @presentation_format = v\n end" ]
[ "0.6043243", "0.5642977", "0.55330557", "0.54842114", "0.5449902", "0.54137105", "0.5237193", "0.49191257", "0.49078047", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.4905036", "0.48931372", "0.48661986", "0.4854206", "0.48191035", "0.48136127", "0.48136127", "0.48098463", "0.47768286", "0.4717151", "0.4698058", "0.46861872", "0.46815714", "0.46699128", "0.46646532", "0.46601933", "0.46601933", "0.46601933", "0.46557567", "0.46155202", "0.4607679", "0.46065098", "0.460559", "0.4602259", "0.45932105", "0.45858803", "0.45858803", "0.45858803", "0.45784977", "0.45762798", "0.45374352", "0.45333272", "0.45210472", "0.45204362", "0.45136708", "0.45073923", "0.44664845", "0.4457958", "0.44563684", "0.44509488", "0.4450918", "0.44370988", "0.44368973", "0.44273227", "0.44191068", "0.4392039", "0.4391502", "0.43788522" ]
0.7724298
0
The deserialization information for the current model
def get_field_deserializers() return { "decimalPlaces" => lambda {|n| @decimal_places = n.get_string_value() }, "displayAs" => lambda {|n| @display_as = n.get_string_value() }, "maximum" => lambda {|n| @maximum = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) }, "minimum" => lambda {|n| @minimum = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) }, "@odata.type" => lambda {|n| @odata_type = n.get_string_value() }, } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end", "def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"fileDetails\" => lambda {|n| @file_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n })\n end", "def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end", "def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"detectionType\" => lambda {|n| @detection_type = n.get_string_value() },\n \"method\" => lambda {|n| @method = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n \"weight\" => lambda {|n| @weight = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"maxImageSize\" => lambda {|n| @max_image_size = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"timeout\" => lambda {|n| @timeout = n.get_duration_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"applicationVersion\" => lambda {|n| @application_version = n.get_string_value() },\n \"headerValue\" => lambda {|n| @header_value = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"callEndSubReason\" => lambda {|n| @call_end_sub_reason = n.get_number_value() },\n \"callType\" => lambda {|n| @call_type = n.get_string_value() },\n \"calleeNumber\" => lambda {|n| @callee_number = n.get_string_value() },\n \"callerNumber\" => lambda {|n| @caller_number = n.get_string_value() },\n \"correlationId\" => lambda {|n| @correlation_id = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_number_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"failureDateTime\" => lambda {|n| @failure_date_time = n.get_date_time_value() },\n \"finalSipCode\" => lambda {|n| @final_sip_code = n.get_number_value() },\n \"finalSipCodePhrase\" => lambda {|n| @final_sip_code_phrase = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"inviteDateTime\" => lambda {|n| @invite_date_time = n.get_date_time_value() },\n \"mediaBypassEnabled\" => lambda {|n| @media_bypass_enabled = n.get_boolean_value() },\n \"mediaPathLocation\" => lambda {|n| @media_path_location = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"signalingLocation\" => lambda {|n| @signaling_location = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"successfulCall\" => lambda {|n| @successful_call = n.get_boolean_value() },\n \"trunkFullyQualifiedDomainName\" => lambda {|n| @trunk_fully_qualified_domain_name = n.get_string_value() },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"imageFile\" => lambda {|n| @image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n \"parentProcessCreationDateTime\" => lambda {|n| @parent_process_creation_date_time = n.get_date_time_value() },\n \"parentProcessId\" => lambda {|n| @parent_process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"parentProcessImageFile\" => lambda {|n| @parent_process_image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"processCommandLine\" => lambda {|n| @process_command_line = n.get_string_value() },\n \"processCreationDateTime\" => lambda {|n| @process_creation_date_time = n.get_date_time_value() },\n \"processId\" => lambda {|n| @process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"userAccount\" => lambda {|n| @user_account = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityUserAccount.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::OperationStatus) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"progress\" => lambda {|n| @progress = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DataPolicyOperationStatus) },\n \"storageLocation\" => lambda {|n| @storage_location = n.get_string_value() },\n \"submittedDateTime\" => lambda {|n| @submitted_date_time = n.get_date_time_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"completedUnits\" => lambda {|n| @completed_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"progressObservationDateTime\" => lambda {|n| @progress_observation_date_time = n.get_date_time_value() },\n \"totalUnits\" => lambda {|n| @total_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"units\" => lambda {|n| @units = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"provisioningStepType\" => lambda {|n| @provisioning_step_type = n.get_enum_value(MicrosoftGraph::Models::ProvisioningStepType) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ProvisioningResult) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"downloadUri\" => lambda {|n| @download_uri = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fulfilledDateTime\" => lambda {|n| @fulfilled_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodEndDateTime\" => lambda {|n| @review_history_period_end_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodStartDateTime\" => lambda {|n| @review_history_period_start_date_time = n.get_date_time_value() },\n \"runDateTime\" => lambda {|n| @run_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AccessReviewHistoryStatus) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end", "def read_object\n if @version == 0\n return amf0_deserialize\n else\n return amf3_deserialize\n end\n end", "def get_field_deserializers()\n return {\n \"destinationFileName\" => lambda {|n| @destination_file_name = n.get_string_value() },\n \"sourceFile\" => lambda {|n| @source_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return {\n \"newText\" => lambda {|n| @new_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"numBytes\" => lambda {|n| @num_bytes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"oldText\" => lambda {|n| @old_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"startNum\" => lambda {|n| @start_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"audioDeviceName\" => lambda {|n| @audio_device_name = n.get_string_value() },\n \"bookingType\" => lambda {|n| @booking_type = n.get_enum_value(MicrosoftGraph::Models::BookingType) },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"capacity\" => lambda {|n| @capacity = n.get_number_value() },\n \"displayDeviceName\" => lambda {|n| @display_device_name = n.get_string_value() },\n \"emailAddress\" => lambda {|n| @email_address = n.get_string_value() },\n \"floorLabel\" => lambda {|n| @floor_label = n.get_string_value() },\n \"floorNumber\" => lambda {|n| @floor_number = n.get_number_value() },\n \"isWheelChairAccessible\" => lambda {|n| @is_wheel_chair_accessible = n.get_boolean_value() },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"nickname\" => lambda {|n| @nickname = n.get_string_value() },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"videoDeviceName\" => lambda {|n| @video_device_name = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"targetType\" => lambda {|n| @target_type = n.get_enum_value(MicrosoftGraph::Models::FeatureTargetType) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"activationUrl\" => lambda {|n| @activation_url = n.get_string_value() },\n \"activitySourceHost\" => lambda {|n| @activity_source_host = n.get_string_value() },\n \"appActivityId\" => lambda {|n| @app_activity_id = n.get_string_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"contentInfo\" => lambda {|n| @content_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fallbackUrl\" => lambda {|n| @fallback_url = n.get_string_value() },\n \"historyItems\" => lambda {|n| @history_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ActivityHistoryItem.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::Status) },\n \"userTimezone\" => lambda {|n| @user_timezone = n.get_string_value() },\n \"visualElements\" => lambda {|n| @visual_elements = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VisualInfo.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"malwareIdentifier\" => lambda {|n| @malware_identifier = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"lastActionDateTime\" => lambda {|n| @last_action_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operation\" => lambda {|n| @operation = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"identityType\" => lambda {|n| @identity_type = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"dataLocationCode\" => lambda {|n| @data_location_code = n.get_string_value() },\n \"hostname\" => lambda {|n| @hostname = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Root.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return {\n \"address\" => lambda {|n| @address = n.get_string_value() },\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"relevanceScore\" => lambda {|n| @relevance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"selectionLikelihood\" => lambda {|n| @selection_likelihood = n.get_enum_value(MicrosoftGraph::Models::SelectionLikelihoodInfo) },\n }\n end", "def get_field_deserializers()\n return {\n \"hashes\" => lambda {|n| @hashes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Hashes.create_from_discriminator_value(pn) }) },\n \"mimeType\" => lambda {|n| @mime_type = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"processingMetadata\" => lambda {|n| @processing_metadata = n.get_boolean_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"configurationVersion\" => lambda {|n| @configuration_version = n.get_number_value() },\n \"errorCount\" => lambda {|n| @error_count = n.get_number_value() },\n \"failedCount\" => lambda {|n| @failed_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"notApplicableCount\" => lambda {|n| @not_applicable_count = n.get_number_value() },\n \"pendingCount\" => lambda {|n| @pending_count = n.get_number_value() },\n \"successCount\" => lambda {|n| @success_count = n.get_number_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"format\" => lambda {|n| @format = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookChartDataLabelFormat.create_from_discriminator_value(pn) }) },\n \"position\" => lambda {|n| @position = n.get_string_value() },\n \"separator\" => lambda {|n| @separator = n.get_string_value() },\n \"showBubbleSize\" => lambda {|n| @show_bubble_size = n.get_boolean_value() },\n \"showCategoryName\" => lambda {|n| @show_category_name = n.get_boolean_value() },\n \"showLegendKey\" => lambda {|n| @show_legend_key = n.get_boolean_value() },\n \"showPercentage\" => lambda {|n| @show_percentage = n.get_boolean_value() },\n \"showSeriesName\" => lambda {|n| @show_series_name = n.get_boolean_value() },\n \"showValue\" => lambda {|n| @show_value = n.get_boolean_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"errorDetails\" => lambda {|n| @error_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::GenericError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n \"targetId\" => lambda {|n| @target_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"contentSource\" => lambda {|n| @content_source = n.get_string_value() },\n \"hitId\" => lambda {|n| @hit_id = n.get_string_value() },\n \"isCollapsed\" => lambda {|n| @is_collapsed = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rank\" => lambda {|n| @rank = n.get_number_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resultTemplateId\" => lambda {|n| @result_template_id = n.get_string_value() },\n \"summary\" => lambda {|n| @summary = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"audioRoutingGroups\" => lambda {|n| @audio_routing_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AudioRoutingGroup.create_from_discriminator_value(pn) }) },\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_string_value() },\n \"callOptions\" => lambda {|n| @call_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallOptions.create_from_discriminator_value(pn) }) },\n \"callRoutes\" => lambda {|n| @call_routes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRoute.create_from_discriminator_value(pn) }) },\n \"callbackUri\" => lambda {|n| @callback_uri = n.get_string_value() },\n \"chatInfo\" => lambda {|n| @chat_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatInfo.create_from_discriminator_value(pn) }) },\n \"contentSharingSessions\" => lambda {|n| @content_sharing_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ContentSharingSession.create_from_discriminator_value(pn) }) },\n \"direction\" => lambda {|n| @direction = n.get_enum_value(MicrosoftGraph::Models::CallDirection) },\n \"incomingContext\" => lambda {|n| @incoming_context = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IncomingContext.create_from_discriminator_value(pn) }) },\n \"mediaConfig\" => lambda {|n| @media_config = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaConfig.create_from_discriminator_value(pn) }) },\n \"mediaState\" => lambda {|n| @media_state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallMediaState.create_from_discriminator_value(pn) }) },\n \"meetingInfo\" => lambda {|n| @meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MeetingInfo.create_from_discriminator_value(pn) }) },\n \"myParticipantId\" => lambda {|n| @my_participant_id = n.get_string_value() },\n \"operations\" => lambda {|n| @operations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CommsOperation.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Participant.create_from_discriminator_value(pn) }) },\n \"requestedModalities\" => lambda {|n| @requested_modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Modality.create_from_discriminator_value(pn) }) },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"source\" => lambda {|n| @source = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ParticipantInfo.create_from_discriminator_value(pn) }) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::CallState) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"targets\" => lambda {|n| @targets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InvitationParticipantInfo.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"toneInfo\" => lambda {|n| @tone_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ToneInfo.create_from_discriminator_value(pn) }) },\n \"transcription\" => lambda {|n| @transcription = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallTranscriptionInfo.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"teacherNumber\" => lambda {|n| @teacher_number = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"key\" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"usage\" => lambda {|n| @usage = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"allowMultipleLines\" => lambda {|n| @allow_multiple_lines = n.get_boolean_value() },\n \"appendChangesToExistingText\" => lambda {|n| @append_changes_to_existing_text = n.get_boolean_value() },\n \"linesForEditing\" => lambda {|n| @lines_for_editing = n.get_number_value() },\n \"maxLength\" => lambda {|n| @max_length = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"textType\" => lambda {|n| @text_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"assignCategories\" => lambda {|n| @assign_categories = n.get_collection_of_primitive_values(String) },\n \"copyToFolder\" => lambda {|n| @copy_to_folder = n.get_string_value() },\n \"delete\" => lambda {|n| @delete = n.get_boolean_value() },\n \"forwardAsAttachmentTo\" => lambda {|n| @forward_as_attachment_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"forwardTo\" => lambda {|n| @forward_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"markAsRead\" => lambda {|n| @mark_as_read = n.get_boolean_value() },\n \"markImportance\" => lambda {|n| @mark_importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"moveToFolder\" => lambda {|n| @move_to_folder = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"permanentDelete\" => lambda {|n| @permanent_delete = n.get_boolean_value() },\n \"redirectTo\" => lambda {|n| @redirect_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"stopProcessingRules\" => lambda {|n| @stop_processing_rules = n.get_boolean_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"acceptMappedClaims\" => lambda {|n| @accept_mapped_claims = n.get_boolean_value() },\n \"knownClientApplications\" => lambda {|n| @known_client_applications = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"oauth2PermissionScopes\" => lambda {|n| @oauth2_permission_scopes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PermissionScope.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preAuthorizedApplications\" => lambda {|n| @pre_authorized_applications = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PreAuthorizedApplication.create_from_discriminator_value(pn) }) },\n \"requestedAccessTokenVersion\" => lambda {|n| @requested_access_token_version = n.get_number_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdByAppId\" => lambda {|n| @created_by_app_id = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"level\" => lambda {|n| @level = n.get_number_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PageLinks.create_from_discriminator_value(pn) }) },\n \"order\" => lambda {|n| @order = n.get_number_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSection\" => lambda {|n| @parent_section = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"userTags\" => lambda {|n| @user_tags = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return {\n \"failedRuns\" => lambda {|n| @failed_runs = n.get_number_value() },\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulRuns\" => lambda {|n| @successful_runs = n.get_number_value() },\n \"totalRuns\" => lambda {|n| @total_runs = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_guid_value() },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"recommendedActions\" => lambda {|n| @recommended_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RecommendedAction.create_from_discriminator_value(pn) }) },\n \"resolvedTargetsCount\" => lambda {|n| @resolved_targets_count = n.get_number_value() },\n \"simulationEventsContent\" => lambda {|n| @simulation_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SimulationEventsContent.create_from_discriminator_value(pn) }) },\n \"trainingEventsContent\" => lambda {|n| @training_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TrainingEventsContent.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"hint\" => lambda {|n| @hint = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"secretText\" => lambda {|n| @secret_text = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"locations\" => lambda {|n| @locations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LocationConstraintItem.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"suggestLocation\" => lambda {|n| @suggest_location = n.get_boolean_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"activityType\" => lambda {|n| @activity_type = n.get_string_value() },\n \"chainId\" => lambda {|n| @chain_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"previewText\" => lambda {|n| @preview_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"recipient\" => lambda {|n| @recipient = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkNotificationRecipient.create_from_discriminator_value(pn) }) },\n \"templateParameters\" => lambda {|n| @template_parameters = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkActivityTopic.create_from_discriminator_value(pn) }) },\n }\n end", "def metadata\n self.class.metadata\n end", "def get_field_deserializers()\n return {\n \"activityIdentifier\" => lambda {|n| @activity_identifier = n.get_string_value() },\n \"countEntitled\" => lambda {|n| @count_entitled = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEntitledForProvisioning\" => lambda {|n| @count_entitled_for_provisioning = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowed\" => lambda {|n| @count_escrowed = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowedRaw\" => lambda {|n| @count_escrowed_raw = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExported\" => lambda {|n| @count_exported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExports\" => lambda {|n| @count_exports = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImported\" => lambda {|n| @count_imported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedDeltas\" => lambda {|n| @count_imported_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedReferenceDeltas\" => lambda {|n| @count_imported_reference_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::SynchronizationTaskExecutionResult) },\n \"timeBegan\" => lambda {|n| @time_began = n.get_date_time_value() },\n \"timeEnded\" => lambda {|n| @time_ended = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"transportKey\" => lambda {|n| @transport_key = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"activeDeviceCount\" => lambda {|n| @active_device_count = n.get_number_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"modelAppHealthScore\" => lambda {|n| @model_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceAccess\" => lambda {|n| @resource_access = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAccess.create_from_discriminator_value(pn) }) },\n \"resourceAppId\" => lambda {|n| @resource_app_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end", "def get_field_deserializers()\n return {\n \"anchor\" => lambda {|n| @anchor = n.get_boolean_value() },\n \"apiExpressions\" => lambda {|n| @api_expressions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::StringKeyStringValuePair.create_from_discriminator_value(pn) }) },\n \"caseExact\" => lambda {|n| @case_exact = n.get_boolean_value() },\n \"defaultValue\" => lambda {|n| @default_value = n.get_string_value() },\n \"flowNullValues\" => lambda {|n| @flow_null_values = n.get_boolean_value() },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },\n \"multivalued\" => lambda {|n| @multivalued = n.get_boolean_value() },\n \"mutability\" => lambda {|n| @mutability = n.get_enum_value(MicrosoftGraph::Models::Mutability) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"referencedObjects\" => lambda {|n| @referenced_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ReferencedObject.create_from_discriminator_value(pn) }) },\n \"required\" => lambda {|n| @required = n.get_boolean_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::AttributeType) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"averageBlueScreens\" => lambda {|n| @average_blue_screens = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"averageRestarts\" => lambda {|n| @average_restarts = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"blueScreenCount\" => lambda {|n| @blue_screen_count = n.get_number_value() },\n \"bootScore\" => lambda {|n| @boot_score = n.get_number_value() },\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceCount\" => lambda {|n| @device_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"diskType\" => lambda {|n| @disk_type = n.get_enum_value(MicrosoftGraph::Models::DiskType) },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"loginScore\" => lambda {|n| @login_score = n.get_number_value() },\n \"manufacturer\" => lambda {|n| @manufacturer = n.get_string_value() },\n \"model\" => lambda {|n| @model = n.get_string_value() },\n \"modelStartupPerformanceScore\" => lambda {|n| @model_startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCount\" => lambda {|n| @restart_count = n.get_number_value() },\n \"startupPerformanceScore\" => lambda {|n| @startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return {\n \"connectingIP\" => lambda {|n| @connecting_i_p = n.get_string_value() },\n \"deliveryAction\" => lambda {|n| @delivery_action = n.get_string_value() },\n \"deliveryLocation\" => lambda {|n| @delivery_location = n.get_string_value() },\n \"directionality\" => lambda {|n| @directionality = n.get_string_value() },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"messageFingerprint\" => lambda {|n| @message_fingerprint = n.get_string_value() },\n \"messageReceivedDateTime\" => lambda {|n| @message_received_date_time = n.get_date_time_value() },\n \"messageSubject\" => lambda {|n| @message_subject = n.get_string_value() },\n \"networkMessageId\" => lambda {|n| @network_message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"application\" => lambda {|n| @application = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preventsDownload\" => lambda {|n| @prevents_download = n.get_boolean_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"webHtml\" => lambda {|n| @web_html = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"uploadUrl\" => lambda {|n| @upload_url = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"attributeMappings\" => lambda {|n| @attribute_mappings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeMapping.create_from_discriminator_value(pn) }) },\n \"enabled\" => lambda {|n| @enabled = n.get_boolean_value() },\n \"flowTypes\" => lambda {|n| @flow_types = n.get_enum_value(MicrosoftGraph::Models::ObjectFlowTypes) },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectMappingMetadataEntry.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Filter.create_from_discriminator_value(pn) }) },\n \"sourceObjectName\" => lambda {|n| @source_object_name = n.get_string_value() },\n \"targetObjectName\" => lambda {|n| @target_object_name = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appHangCount\" => lambda {|n| @app_hang_count = n.get_number_value() },\n \"crashedAppCount\" => lambda {|n| @crashed_app_count = n.get_number_value() },\n \"deviceAppHealthScore\" => lambda {|n| @device_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"messageId\" => lambda {|n| @message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"replyChainMessageId\" => lambda {|n| @reply_chain_message_id = n.get_string_value() },\n \"threadId\" => lambda {|n| @thread_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end", "def get_field_deserializers()\n return {\n \"bargeInAllowed\" => lambda {|n| @barge_in_allowed = n.get_boolean_value() },\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"initialSilenceTimeoutInSeconds\" => lambda {|n| @initial_silence_timeout_in_seconds = n.get_number_value() },\n \"maxRecordDurationInSeconds\" => lambda {|n| @max_record_duration_in_seconds = n.get_number_value() },\n \"maxSilenceTimeoutInSeconds\" => lambda {|n| @max_silence_timeout_in_seconds = n.get_number_value() },\n \"playBeep\" => lambda {|n| @play_beep = n.get_boolean_value() },\n \"prompts\" => lambda {|n| @prompts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Prompt.create_from_discriminator_value(pn) }) },\n \"stopTones\" => lambda {|n| @stop_tones = n.get_collection_of_primitive_values(String) },\n }\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"response\" => lambda {|n| @response = n.get_enum_value(MicrosoftGraph::Models::ResponseType) },\n \"time\" => lambda {|n| @time = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"driveId\" => lambda {|n| @drive_id = n.get_string_value() },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"shareId\" => lambda {|n| @share_id = n.get_string_value() },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"siteId\" => lambda {|n| @site_id = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"activeMalwareDetectionCount\" => lambda {|n| @active_malware_detection_count = n.get_number_value() },\n \"category\" => lambda {|n| @category = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareCategory) },\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"distinctActiveMalwareCount\" => lambda {|n| @distinct_active_malware_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"servicePrincipalId\" => lambda {|n| @service_principal_id = n.get_string_value() },\n \"servicePrincipalName\" => lambda {|n| @service_principal_name = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"riskDetections\" => lambda {|n| @risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskDetection.create_from_discriminator_value(pn) }) },\n \"riskyServicePrincipals\" => lambda {|n| @risky_service_principals = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyServicePrincipal.create_from_discriminator_value(pn) }) },\n \"riskyUsers\" => lambda {|n| @risky_users = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyUser.create_from_discriminator_value(pn) }) },\n \"servicePrincipalRiskDetections\" => lambda {|n| @service_principal_risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ServicePrincipalRiskDetection.create_from_discriminator_value(pn) }) },\n }\n end", "def get_field_deserializers()\n return super.merge({\n })\n end", "def get_field_deserializers()\n return super.merge({\n })\n end", "def get_field_deserializers()\n return super.merge({\n })\n end", "def get_field_deserializers()\n return {\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"failedUsers\" => lambda {|n| @failed_users = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulUsers\" => lambda {|n| @successful_users = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"durationInSeconds\" => lambda {|n| @duration_in_seconds = n.get_number_value() },\n \"joinDateTime\" => lambda {|n| @join_date_time = n.get_date_time_value() },\n \"leaveDateTime\" => lambda {|n| @leave_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"actionName\" => lambda {|n| @action_name = n.get_string_value() },\n \"actionState\" => lambda {|n| @action_state = n.get_enum_value(MicrosoftGraph::Models::ActionState) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"azureAdUserId\" => lambda {|n| @azure_ad_user_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n \"userSid\" => lambda {|n| @user_sid = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n }\n end", "def get_field_deserializers()\n return {\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_guid_value() },\n \"cloudServiceDeploymentEnvironment\" => lambda {|n| @cloud_service_deployment_environment = n.get_string_value() },\n \"cloudServiceDeploymentId\" => lambda {|n| @cloud_service_deployment_id = n.get_string_value() },\n \"cloudServiceInstanceName\" => lambda {|n| @cloud_service_instance_name = n.get_string_value() },\n \"cloudServiceName\" => lambda {|n| @cloud_service_name = n.get_string_value() },\n \"deviceDescription\" => lambda {|n| @device_description = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"mediaLegId\" => lambda {|n| @media_leg_id = n.get_guid_value() },\n \"mediaQualityList\" => lambda {|n| @media_quality_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeleconferenceDeviceMediaQuality.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"participantId\" => lambda {|n| @participant_id = n.get_guid_value() },\n }\n end", "def _before_validation\n serialize_deserialized_values\n super\n end", "def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end", "def get_field_deserializers()\n return super.merge({\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"kind\" => lambda {|n| @kind = n.get_string_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n })\n end", "def get_field_deserializers()\n return {\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"criterion1\" => lambda {|n| @criterion1 = n.get_string_value() },\n \"criterion2\" => lambda {|n| @criterion2 = n.get_string_value() },\n \"dynamicCriteria\" => lambda {|n| @dynamic_criteria = n.get_string_value() },\n \"filterOn\" => lambda {|n| @filter_on = n.get_string_value() },\n \"icon\" => lambda {|n| @icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookIcon.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operator\" => lambda {|n| @operator = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end" ]
[ "0.6510734", "0.63224316", "0.6322254", "0.63094735", "0.62954384", "0.6238735", "0.6232461", "0.62155676", "0.6200175", "0.6199403", "0.6173917", "0.61733985", "0.61705345", "0.61631054", "0.61620396", "0.6158031", "0.6156071", "0.6142402", "0.613998", "0.6138061", "0.61200523", "0.6089013", "0.60869795", "0.6079146", "0.60785794", "0.6070405", "0.6063533", "0.60625833", "0.6061235", "0.60584134", "0.6055769", "0.6051312", "0.60465735", "0.6046329", "0.6031944", "0.6029311", "0.6028314", "0.60255736", "0.6022033", "0.60210633", "0.6009887", "0.5988654", "0.59844214", "0.59793943", "0.5975247", "0.5969614", "0.596824", "0.5966432", "0.5965554", "0.596292", "0.5951651", "0.5950895", "0.59456754", "0.59448177", "0.593984", "0.59362113", "0.5935833", "0.59319806", "0.59312665", "0.59307545", "0.5930406", "0.5926444", "0.5926136", "0.59240156", "0.5922303", "0.591605", "0.591336", "0.5913327", "0.59130335", "0.5910617", "0.5906052", "0.5906045", "0.59042066", "0.5903306", "0.5902868", "0.59027255", "0.5902389", "0.5902219", "0.5901496", "0.58978146", "0.5891392", "0.5890228", "0.5885622", "0.5885429", "0.5884738", "0.5883899", "0.5883899", "0.5883899", "0.58811784", "0.5878516", "0.5877111", "0.5869185", "0.5844199", "0.58430207", "0.58408237", "0.58383596", "0.58362466", "0.5836192", "0.5835942", "0.5834559", "0.583357" ]
0.0
-1
Gets the maximum property value. The maximum permitted value.
def maximum return @maximum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def maximum_value\n @maximum_value || store.max\n end", "def maxvalue\n MAXVALUE\n end", "def max\n if valid?\n max_value\n end\n end", "def get_max\n @max\n end", "def max\n @max\n end", "def max\n @max\n end", "def max\n @maxNumber\n end", "def get_max\n @max ||= calculate_max\n end", "def max\n\t\t@max || nil\n\tend", "def max\n @max ||= define_min_and_max && @max\n end", "def max\n self.class.max\n end", "def find_max()\r\n self.max\r\n end", "def get_max()\n end", "def maximum\n object.maximum.to_f\n end", "def get_max\n\t\t@max.last\n\tend", "def maximum (value = nil)\n\t\tif value\n\t\t\traise_if_error C.glyr_opt_number(to_native, value)\n\t\telse\n\t\t\tto_native[:number]\n\t\tend\n\tend", "def max\n data.max\n end", "def effective_maximum\n maximum_bound ? maximum_bound.value : Infinity\n end", "def maximum=(value)\n @maximum = value\n end", "def maximum\n return self[0]\n end", "def item_max\n @item_max\n end", "def get_max_range\n return @maxRange\n end", "def largest_value\n values.max\n end", "def item_max() @item_max end", "def max(value)\n opts[:max] = value\n end", "def max\n @n[0]\n end", "def maximum_capacity\n read_attribute(:maximum_capacity) || room.try(:capacity)\n end", "def max\n @data[0]\n end", "def max\r\n @range.max\r\n end", "def max\n\t\tm = self.valor[0]\n\t\tfor i in (0...self.valor.size.to_i)\n\t\t\t\tif (self.valor[i]> m)\n\t\t\t\t\tm = self.valor[i]\n\t\t\t\tend\n\t\tend\n\t\treturn m\n\tend", "def item_max=(value)\n @item_max = value\n end", "def max_element\n self.to_a.max\n end", "def get_max_value()\n temp = @symtable.values\n temp.keep_if { |x| x.to_i < 16384 }\n temp.max\n end", "def odb_max\n \"max(#{to_s})\"\n end", "def max_age\n\t\t\t\t\tfind_integer_value(MAX_AGE)\n\t\t\t\tend", "def max_uses\n @attributes[:max_uses]\n end", "def max_speed\n @max_speed ||= read_attribute('max_speed').to_i\n end", "def item_max\r\n @item_max || 0\r\n end", "def get_max_field()\n 0\n end", "def s_maxage\n\t\t\t\t\tfind_integer_value(S_MAXAGE)\n\t\t\t\tend", "def text_field_max\n return nil unless hidden_field_max\n hidden_field_max.divmod(hidden_field_step).first * text_field_step\n # fetch_options('max', text_field_name) # default)\n end", "def max=\n end", "def get_max\n return if is_empty?\n return @root.val\n end", "def max_population\n @store[:population].max\n end", "def max_gauge\n data[:max_gauge]\n end", "def max\n end", "def max\n end", "def max\n max = @storage[0]\n @size.times do |i|\n if @storage[i] > max\n max = @storage[i]\n end\n\n end\n return max\n end", "def max_price\n @set[\"PriceSet\"][\"maxPrice\"]\n end", "def max \n if max_element.kind_of? Array\n max_element.first\n else\n max_element\n end\n end", "def max; end", "def max; end", "def max\n @v.compact.max\n rescue\n nil\n end", "def max\n to_a.max\n end", "def maximo()\n\t\tmaximo = 0;\n\t\t@hash_no_nulos.each do |key,valor|\n\t\t\tif (valor > maximo)\n\t\t\t\tmaximo = valor\n\t\t\tend\n end\n\t\treturn maximo\n\tend", "def max=(value)\r\n @max = value\r\n shift while @store.length > @max\r\n end", "def wordMax\n @wordMax\n end", "def max\n @max ||= map {|a| a[0].length}.max\n end", "def max_length\n return @max_length\n end", "def validation_max\n validation = validations? && validations.find do |validation|\n validation.kind == :numericality\n end\n if validation\n # We can't determine an appropriate value for :greater_than with a float/decimal column\n raise IndeterminableMaximumAttributeError if validation.options[:less_than] && column? && [:float, :decimal].include?(column.type)\n\n if validation.options[:less_than_or_equal_to]\n return (validation.options[:less_than_or_equal_to].call(object)) if validation.options[:less_than_or_equal_to].kind_of?(Proc)\n return (validation.options[:less_than_or_equal_to])\n end\n\n if validation.options[:less_than]\n return ((validation.options[:less_than].call(object)) - 1) if validation.options[:less_than].kind_of?(Proc)\n return (validation.options[:less_than] - 1)\n end\n end\n end", "def max\n self.reduce('lambda{|memo, item| memo > item ? memo : item }')\n end", "def max\n MSPhysics::Newton::Hinge.get_max(@address)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def get_max_jump()\n # If there is no value set at the moment, set it to 6.\n if @metadata[:max_jump] == nil\n self.max_jump(6)\n end\n return @metadata[:max_jump]\n end", "def tempo_max\n @tempo_max ||= data[:tempo_max].to_i\n end", "def maximum_duration\n return @maximum_duration\n end", "def get_max()\n return @maxs_stack.peek()\n end", "def suggestedNumber\r\n return self.maxLength\r\n end", "def jugada_max\r\n movimiento.max_by{|x| x.nivel} #Devuelve el objeto de enumeración que da el valor máximo\r\n end", "def mmax\n @opened ? @mmax : nil\n end", "def maximal_length\n if !self.value.blank? && self.maxLength\n errors.add(:value, 'is too long!') if self.value.length > self.maxLength\n end\n end", "def max_fake_reader\n @max_fake\n end", "def max_value(value, pdef)\n if(value.to_i <= pdef['MaxValue'].to_i)\n true\n else\n \"Value must not be greater than #{pdef['MaxValue']}\"\n end\n end", "def max(attr)\n column(attr).max\n end", "def max\n empty? ? -Float::INFINITY : @list.head.value[2]\n end", "def max_value\n if @head.nil?\n return nil\n else\n if head.right\n max_value = max_search(head.right).data\n else\n max_value = head.data\n end\n end\n return max_value\n end", "def max\n @range.end\n end", "def maximum\n sides.map(&:value).max\n end", "def set_Maximum(value)\n set_input(\"Maximum\", value)\n end", "def max_point\n # generate the bounding box if not already done\n bounding_box\n # return the max\n @max\n end", "def max_value\n max = 0\n\n @matrix.each do |row|\n row_max = row.max\n max = row_max if row_max > max\n end\n\n max\n end", "def acceptable_max\n return unless min_max_validator\n\n min_max_validator.options[:in]&.max || type_related_acceptable_max\n end", "def max_level\r\r\n @note =~ /<max[-_ ]?level:\\s*(.*)\\s*>/i ? @max_level = $1.to_i : @max_level = TH_Instance::Equip::Default_Max_Level if @max_level.nil?\r\r\n @max_level\r\r\n end", "def max\n return -1 if @count == 0\n return @array[0]\n end", "def get_max_char_value(codegen)\n maxval = 255 # codegen.grammar.get????();\n if (maxval <= 255)\n return 255\n else\n return maxval\n end\n end", "def getSpecialValue\n maxBonus\n end", "def size\n @max\n end", "def max\n only_with('max', 'NilClass', 'Numeric', 'String', 'DateTime')\n items.compact.max\n end", "def max_attribute_value(selector, attr_name); end", "def max_attribute_value(selector, attr_name); end", "def max\n @keys[@keys.size-1]\n end", "def max_real_reader\n @max_real\n end" ]
[ "0.819768", "0.8125309", "0.8109553", "0.8096064", "0.7671543", "0.7671543", "0.7614712", "0.7528303", "0.75183874", "0.74943316", "0.7460003", "0.7408084", "0.7402146", "0.7368663", "0.7362322", "0.7266627", "0.7186584", "0.7139369", "0.71207774", "0.70551807", "0.7029055", "0.700682", "0.6995373", "0.6976182", "0.6969528", "0.69528055", "0.69472265", "0.69407916", "0.6939539", "0.69239074", "0.69218594", "0.6914663", "0.6913556", "0.6896171", "0.68785197", "0.6842282", "0.68318456", "0.6826105", "0.6819768", "0.6816112", "0.6809883", "0.68089855", "0.6807531", "0.6786041", "0.6769617", "0.67497027", "0.67497027", "0.67424774", "0.6734576", "0.6728417", "0.671093", "0.671093", "0.6701387", "0.6680909", "0.6651523", "0.664254", "0.6640609", "0.66381204", "0.6603872", "0.65990263", "0.6591338", "0.6584635", "0.65828544", "0.65828544", "0.65828544", "0.65828544", "0.65828544", "0.65828544", "0.65828544", "0.65828544", "0.65828544", "0.6581743", "0.65649015", "0.6556139", "0.6537207", "0.65289754", "0.652723", "0.65147656", "0.65083295", "0.6492035", "0.6491748", "0.6489564", "0.6463677", "0.6463274", "0.6460131", "0.64567316", "0.6449795", "0.6447659", "0.6446243", "0.6445961", "0.6427798", "0.64173615", "0.6414447", "0.640757", "0.6393696", "0.63927436", "0.63914216", "0.63914216", "0.6377144", "0.63754195" ]
0.8097301
3
Sets the maximum property value. The maximum permitted value.
def maximum=(value) @maximum = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Max(value)\n set_input(\"Max\", value)\n end", "def set_Maximum(value)\n set_input(\"Maximum\", value)\n end", "def set_max(max)\n self[:max] = (max > 0 ? max : 1)\n end", "def max(value)\n opts[:max] = value\n end", "def max=(value)\r\n @max = value\r\n shift while @store.length > @max\r\n end", "def set_max( max )\n if IntegerOption.bounds_ok?( @min, max )\n @max = max\n else\n @max = nil\n raise \"invalid upper bound: #{ max.to_s }\"\n end\n end", "def item_max=(value)\n @item_max = value\n end", "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end", "def set_MaxID(value)\n set_input(\"MaxID\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxId(value)\n set_input(\"MaxId\", value)\n end", "def set_MaxID(value)\n set_input(\"MaxID\", value)\n end", "def set_MaxEntries(value)\n set_input(\"MaxEntries\", value)\n end", "def max=(value)\n MSPhysics::Newton::Hinge.set_max(@address, value)\n end", "def max_length=(value)\n @max_length = value\n end", "def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end", "def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end", "def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def set_Limit(value)\n set_input(\"Limit\", value)\n end", "def maxbw=(value)\n @property_flush[:maxbw] = value\n end", "def set_MaxLongitude(value)\n set_input(\"MaxLongitude\", value)\n end", "def set_MaxLongitude(value)\n set_input(\"MaxLongitude\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def limit(val)\n @params[:retmax] = val\n self\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end", "def maximum_duration=(value)\n @maximum_duration = value\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end", "def set_MaxResults(value)\n set_input(\"MaxResults\", value)\n end" ]
[ "0.8507257", "0.8507257", "0.8507257", "0.8507257", "0.8507257", "0.8507257", "0.8507257", "0.8507257", "0.8507257", "0.84230936", "0.8355318", "0.81123376", "0.7893373", "0.77636725", "0.77093923", "0.7543677", "0.7543677", "0.7543677", "0.7543677", "0.75425154", "0.75410897", "0.75410897", "0.75410897", "0.75410897", "0.7541011", "0.7541011", "0.7541011", "0.7541011", "0.754083", "0.754083", "0.754083", "0.7540591", "0.7478582", "0.73416436", "0.7311959", "0.70925593", "0.70925593", "0.70925593", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70925176", "0.70263666", "0.7006535", "0.7006535", "0.69581026", "0.69581026", "0.69581026", "0.69581026", "0.69581026", "0.69581026", "0.69581026", "0.69581026", "0.6927558", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68862474", "0.68723875", "0.6829638", "0.6829638", "0.6829638", "0.6829638", "0.6829638", "0.6829638", "0.6829638", "0.6829638", "0.6829638", "0.6829638" ]
0.83837426
10
Gets the minimum property value. The minimum permitted value.
def minimum return @minimum end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def minimum_value\n @minimum_value || store.min\n end", "def get_min()\n @min\n end", "def get_min\n @min\n end", "def minvalue\n MINVALUE\n end", "def get_min()\n @min \n end", "def get_min()\n @data.min\n end", "def minimum\n object.minimum.to_f\n end", "def min\n @min || 0;\n end", "def min\n self.class.min\n end", "def min\n @store.peek[:min] unless empty?\n end", "def find_min()\r\n self.min\r\n end", "def min\n return @t_min\n end", "def minimum=(value)\n @minimum = value\n end", "def minimum\n Minimum.new(self)\n end", "def get_min\n @min ||= calculate_min\n end", "def min\n @v.compact.min\n rescue\n nil\n end", "def get_min()\n end", "def min\n\t\tm = self.valor[0]\n\t\tfor i in (0...self.valor.size.to_i)\n\t\t\t\tif (self.valor[i]< m)\n\t\t\t\t\tm = self.valor[i]\n\t\t\t\tend\n\t\tend\n\t\treturn m\n\tend", "def value\n min_stay = [prop_min_stay.to_i, cal_min_stay.to_i].max\n\n min_stay.zero? ? nil : min_stay\n end", "def min\r\n @range.min\r\n end", "def find_minimum_value\n if self.left_child\n self.left_child.find_minimum_value\n else\n self.value\n end\n end", "def getBasicValue\n minBonus\n end", "def final_minimum_rate\n # if blank just take property minimum\n if self.minimum_rate.blank?\n self.property.minimum_room_rate\n else\n # compare to property min rate, if smaller then take room type ones\n result = self.minimum_rate\n if result < self.property.minimum_room_rate\n result = self.property.minimum_room_rate\n end\n result\n end\n end", "def min(value)\n opts[:min] = value\n end", "def min_element\n self.to_a.min\n end", "def minimum_value\n current = self\n \n while current.left_child != nil do\n current = current.left_child\n end\n \n return current.data\n end", "def key_for_min_value\n end", "def min_price\n @set[\"PriceSet\"][\"minPrice\"]\n end", "def min\n to_a.min\n end", "def min\n if min_element.kind_of? Array\n min_element.first\n else\n min_element\n end\n end", "def get_min()\n # smallest = Float::INFINITY\n # @stack.each do |item|\n # if item < smallest\n # smallest = item\n # end\n # end\n # return smallest\n @stack.min\n end", "def min\n empty? ? Float::INFINITY : @list.head.value[1]\n end", "def min\n empty? ? Float::INFINITY : @list.head.value[1]\n end", "def min( value )\n if value < self\n value\n else\n self\n end\n end", "def min\n @keys[0]\n end", "def min_point\n # generate the bounding box if not already done\n bounding_box\n # return the min\n @min\n end", "def min\n MSPhysics::Newton::Hinge.get_min(@address)\n end", "def min() end", "def minimal_length\n if !self.value.blank? && self.minLength\n errors.add(:value, 'is too short!') if self.value.length < self.minLength\n end\n end", "def peekMin()\n @store[1]\n end", "def get_min\n minimum = @store.pop\n until @store.empty?\n element = @store.pop\n if minimum > element\n minimum = element\n end\n end\n minimum\n end", "def min_value\n if @head.nil?\n return nil\n else\n if head.left\n min_value = min_search(head.left).data\n else\n min_value = head.data\n end\n end\n return min_value\n end", "def validation_min\n validation = validations? && validations.find do |validation|\n validation.kind == :numericality\n end\n\n if validation\n # We can't determine an appropriate value for :greater_than with a float/decimal column\n raise IndeterminableMinimumAttributeError if validation.options[:greater_than] && column? && [:float, :decimal].include?(column.type)\n\n if validation.options[:greater_than_or_equal_to]\n return (validation.options[:greater_than_or_equal_to].call(object)) if validation.options[:greater_than_or_equal_to].kind_of?(Proc)\n return (validation.options[:greater_than_or_equal_to])\n end\n\n if validation.options[:greater_than]\n return (validation.options[:greater_than].call(object) + 1) if validation.options[:greater_than].kind_of?(Proc)\n return (validation.options[:greater_than] + 1)\n end\n end\n end", "def min\n only_with('min', 'NilClass', 'Numeric', 'String', 'DateTime')\n items.compact.min\n end", "def min_gauge\n data[:min_gauge]\n end", "def min()\n return stack.stack.last[:min]\n end", "def casted_minimum\n minimum.blank? ? nil : (qtype_name == \"decimal\" ? minimum : minimum.to_i)\n end", "def min_value(value, pdef)\n if(value.to_i >= pdef['MinValue'].to_i)\n true\n else\n \"Value must not be less than #{pdef['MinValue']}\"\n end\n end", "def minimo()\n\t\tminimo = 0;\n\t\t@hash_no_nulos.each do |key,valor|\n\t\t\tif (valor < minimo)\n\t\t\t\tminimo = valor\n\t\t\tend\n end\n\t\treturn minimo\n\tend", "def min\n end", "def min\n end", "def min\n return super if super.nil?\n (numeric_type == 'Integer') ? super.to_i : super.to_f\n end", "def min\n self.reduce('lambda{|memo, item| memo < item ? memo : item }')\n end", "def min\n @min ||= time_parts[1]\n end", "def min; end", "def min; end", "def acceptable_min\n return unless min_max_validator\n\n min_max_validator.options[:in]&.min || type_related_acceptable_min\n end", "def odb_min\n \"min(#{to_s})\"\n end", "def min(attr)\n column(attr).min\n end", "def min\n if @time\n @time.min\n elsif @datetime\n @datetime.min\n else\n to_time.min\n end\n end", "def min\n if @time\n @time.min\n elsif @datetime\n @datetime.min\n else\n to_time.min\n end\n end", "def min\n if @time\n @time.min\n elsif @datetime\n @datetime.min\n else\n to_time.min\n end\n end", "def minimum\n sides.map(&:value).min\n end", "def t_min\n @temp.min\n end", "def autosizedMinimumOutdoorAirFlowRate\n\n return self.model.getAutosizedValue(self, 'Minimum Outdoor Air Flow Rate', 'm3/s')\n \n end", "def least\n nil\n end", "def get_min()\n @array[-1][1]\n end", "def min\n\t\t\t@count\n\t\tend", "def get_min()\n return self.min_stack[-1]\n end", "def minimum(attribute_name, options = {})\n calculate(:min, attribute_name, options)\n end", "def min\n @nodes.first\n end", "def min\n @range.begin\n end", "def mmin\n @opened ? @mmin : nil\n end", "def get_min()\n # O(1) time\n @min.last\n end", "def tempo_min\n @tempo_min ||= data[:tempo_min].to_i\n end", "def set_Minimum(value)\n set_input(\"Minimum\", value)\n end", "def min_x\n @pos.x\n end", "def min\n @mini_stack.min\n end", "def min(cat)\n @categories[cat][:min]\n end", "def min?\n @number.zero?\n end", "def min(field, opts={})\n opts = ::Hashie::Mash.new(opts)\n all(opts).inject(nil) do |min, item|\n val = item.send(field)\n min = val if !val.nil? && (min.nil? || val < min)\n min\n end\n end", "def min\n return nil if @root.nil?\n\n min_node(@root).key\n end", "def smallest\n # self.compact.sort.first\n self.compact.min\n end", "def find_min\n loc = find_min_locator and loc.value\n end", "def min\n return self.to_a[IDX_MINUTE]\n end", "def min_length\n MIN_LENGTH\n end", "def min_latitude\n query_root_node(\"fao:hasMinLatitude/text()\", @@NAMESPACES).to_s\n end", "def min(field)\n determine(field, :<=)\n end", "def lowest\n @level_order.first\n end", "def minimum\n\t\tif course.users.length > 2 and worth > 0\n\t\t\treturn (grades.minimum(:grade).to_f / worth) * 100\n\t\tend\n\tend", "def find_minimum\n current = @root\n\n while current.left && !current.nil?\n current = current.left\n return current.value if current.left.nil?\n end\n end", "def better_my_min\n min = self.first\n self.each do |el|\n min = el if el < min\n end\n min\n end", "def minimum_lead_time\n return @minimum_lead_time\n end", "def peek_min\n if next_head = self.head.sibling\n current_head = self.head\n while next_head \n next_head < current_head ? @min = next_head : @min = current_head\n current_head = next_head\n next_head = next_head.sibling \n end\n else\n @min = self.head\n end\n @min\n end", "def min()\n return \"Stack is empty.\" if is_empty\n\n current = @head\n min = current.value\n\n while current != nil\n if current.value < min\n min = current.value\n end\n\n current = current.next\n end\n\n return min\n end", "def min()\n return \"Stack is empty.\" if is_empty\n\n min = @stack[-1]\n\n @stack.each do | i |\n min = i if i < min\n end\n\n return min\n end", "def min_record\n min = record(infimum.next)\n min if min != supremum\n end", "def get_min()\n @min_stack[-1]\n end", "def least()\n \"\"\n end", "def getminute()\n\t\treturn @min\n\tend" ]
[ "0.8171997", "0.7887271", "0.76492554", "0.7582714", "0.74359554", "0.7310375", "0.72689843", "0.7231755", "0.71982193", "0.71006185", "0.7017271", "0.70034164", "0.698863", "0.693419", "0.692787", "0.6889345", "0.6888529", "0.6815768", "0.67396724", "0.6707904", "0.67045254", "0.6664359", "0.6613044", "0.65977466", "0.6583546", "0.65710056", "0.65561616", "0.6529319", "0.64981693", "0.64967275", "0.6477361", "0.6473297", "0.6473297", "0.6464807", "0.64586973", "0.6409968", "0.63708436", "0.6324726", "0.63224614", "0.6322136", "0.63202715", "0.6308954", "0.6292165", "0.62861717", "0.628546", "0.62791616", "0.6268412", "0.6266617", "0.62382114", "0.62170684", "0.62170684", "0.62147045", "0.62063354", "0.62043816", "0.6184981", "0.6184981", "0.617398", "0.6154639", "0.6148", "0.6126066", "0.6126066", "0.6126066", "0.61141366", "0.610604", "0.60953856", "0.6067107", "0.6049993", "0.6040014", "0.60373276", "0.6013436", "0.600756", "0.59795874", "0.597857", "0.5976571", "0.59524256", "0.59510314", "0.5927677", "0.59208965", "0.5895665", "0.5894806", "0.5892996", "0.5888972", "0.5886906", "0.5875018", "0.5874864", "0.5869063", "0.5855873", "0.5855643", "0.58495873", "0.58478415", "0.58446896", "0.58371603", "0.58311766", "0.58163136", "0.57983106", "0.57849836", "0.577714", "0.57569045", "0.5753894", "0.57481927" ]
0.79085547
1
Sets the minimum property value. The minimum permitted value.
def minimum=(value) @minimum = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_Minimum(value)\n set_input(\"Minimum\", value)\n end", "def set_min(min)\n\n @min = min \n\n end", "def min(value)\n opts[:min] = value\n end", "def set_min( min )\n if IntegerOption.bounds_ok?( min, @max )\n @min = min\n else\n @min = nil\n raise \"invalid lower bound: #{ min.to_s }\"\n end\n end", "def min=(value)\n MSPhysics::Newton::Hinge.set_min(@address, value)\n end", "def set_MinLatitude(value)\n set_input(\"MinLatitude\", value)\n end", "def set_MinLatitude(value)\n set_input(\"MinLatitude\", value)\n end", "def set_MinCount(value)\n set_input(\"MinCount\", value)\n end", "def set_MinCount(value)\n set_input(\"MinCount\", value)\n end", "def minvalue\n MINVALUE\n end", "def set_MinEntries(value)\n set_input(\"MinEntries\", value)\n end", "def position_min=(new_position_min)\n Klass.setPositionMin(@handle, @index, new_position_min.to_f)\n new_position_min\n end", "def minimum_value\n @minimum_value || store.min\n end", "def min_position=(value)\n MSPhysics::Newton::Corkscrew.set_min_position(@address, value)\n end", "def set_MinLongitude(value)\n set_input(\"MinLongitude\", value)\n end", "def set_MinLongitude(value)\n set_input(\"MinLongitude\", value)\n end", "def earliest_limit=( value )\n @earliest_limit = to_date( value )\n end", "def min_value(value, pdef)\n if(value.to_i >= pdef['MinValue'].to_i)\n true\n else\n \"Value must not be less than #{pdef['MinValue']}\"\n end\n end", "def minimal_length\n if !self.value.blank? && self.minLength\n errors.add(:value, 'is too short!') if self.value.length < self.minLength\n end\n end", "def min=(newmin)\n newmin = newmin.to_i\n raise ArgumentError, \"Invalid minute: '#{newmin}'.\" if newmin < 0 or newmin > 60\n @t_min = newmin\n end", "def set_MinResult(value)\n set_input(\"MinResult\", value)\n end", "def os_minimum_version=(value)\n @os_minimum_version = value\n end", "def os_minimum_version=(value)\n @os_minimum_version = value\n end", "def set_MinUploadDate(value)\n set_input(\"MinUploadDate\", value)\n end", "def set_MinUploadDate(value)\n set_input(\"MinUploadDate\", value)\n end", "def set_MinUploadDate(value)\n set_input(\"MinUploadDate\", value)\n end", "def set_MinUploadDate(value)\n set_input(\"MinUploadDate\", value)\n end", "def set_MinUploadDate(value)\n set_input(\"MinUploadDate\", value)\n end", "def set_MinUploadDate(value)\n set_input(\"MinUploadDate\", value)\n end", "def min\n @min || 0;\n end", "def min_width=(min_width)\n @min_width = min_width\n end", "def minimum_attendee_percentage=(value)\n @minimum_attendee_percentage = value\n end", "def minimum_lead_time=(value)\n @minimum_lead_time = value\n end", "def minimum_price(price)\n set_limiting_value(:minimum, :price, price)\n end", "def min_count=(min_count)\n @active = (min_count > 0)\n end", "def min(lower_bound, inclusive = nil)\n @min = lower_bound\n @min_inclusive = inclusive\n end", "def min(lower_bound, inclusive = nil)\n @min = lower_bound\n @min_inclusive = inclusive\n end", "def reset()\n @value = self.min\n end", "def minimum_required_patch_version=(value)\n @minimum_required_patch_version = value\n end", "def small=(value)\n @small = value\n end", "def min( value )\n if value < self\n value\n else\n self\n end\n end", "def set_MinFaveDate(value)\n set_input(\"MinFaveDate\", value)\n end", "def set_MinFaveDate(value)\n set_input(\"MinFaveDate\", value)\n end", "def set_MinFaveDate(value)\n set_input(\"MinFaveDate\", value)\n end", "def set_MinFaveDate(value)\n set_input(\"MinFaveDate\", value)\n end", "def min_rate_must_be_over_minimum\n if !minimum_rate.blank? and minimum_rate < self.property.minimum_room_rate\n errors.add(:minimum_rate, I18n.t('room_types.validate.minimum_rate_must_be_over_minimum', :minimum => self.property.minimum_room_rate))\n end\n end", "def minimum\n Minimum.new(self)\n end", "def acceptable_min\n return unless min_max_validator\n\n min_max_validator.options[:in]&.min || type_related_acceptable_min\n end", "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "def password_minimum_length=(value)\n @password_minimum_length = value\n end", "def set_MinCommentDate(value)\n set_input(\"MinCommentDate\", value)\n end", "def set_MinCommentDate(value)\n set_input(\"MinCommentDate\", value)\n end", "def min_size\n @min_size ||= options[:min_size] || DEFAULT_MIN_SIZE\n end", "def minimum\n return @minimum\n end", "def set_min(fields)\n view.update_many(\"$min\" => collect_operations(fields))\n end", "def set_MinCorpus(value)\n set_input(\"MinCorpus\", value)\n end", "def set_MinCorpus(value)\n set_input(\"MinCorpus\", value)\n end", "def set_MinCorpus(value)\n set_input(\"MinCorpus\", value)\n end", "def set_MinCorpus(value)\n set_input(\"MinCorpus\", value)\n end", "def set_MinDictionaries(value)\n set_input(\"MinDictionaries\", value)\n end", "def set_MinDictionaries(value)\n set_input(\"MinDictionaries\", value)\n end", "def minimized(value)\n @ole.Minimized = value\n nil\n end", "def minimized(value)\n @ole.Minimized = value\n nil\n end", "def min_version=(version)\n unless MIN_MAX_VERSIONS.include? version\n raise ArgumentError, \"Invalid SSL min_version #{version.inspect}\\n\" +\n \"Please specify one of #{MIN_MAX_VERSIONS.inspect}\"\n end\n\n @min_version = version\n end", "def min\n move(0)\n end", "def set_MinTakenDate(value)\n set_input(\"MinTakenDate\", value)\n end", "def set_MinTakenDate(value)\n set_input(\"MinTakenDate\", value)\n end", "def set_MinTakenDate(value)\n set_input(\"MinTakenDate\", value)\n end", "def set_MinTakenDate(value)\n set_input(\"MinTakenDate\", value)\n end", "def set_MinTakenDate(value)\n set_input(\"MinTakenDate\", value)\n end", "def set_MinTakenDate(value)\n set_input(\"MinTakenDate\", value)\n end", "def min_angle=(value)\n MSPhysics::Newton::Corkscrew.set_min_angle(@address, value)\n end", "def set_minimum_price\n @minimum_price = MinimumPrice.find(params[:id])\n end", "def minimum_coverage(val)\n raise \"minimum_coverage requires a Float.\" unless val.is_a? Float\n raise \"minimum_coverage must be between 0 and 100\" unless val.between?(0, 100)\n @minimumCoverage = val\n self\n end", "def get_min()\n @min\n end", "def get_min\n @min\n end", "def set_Maximum(value)\n set_input(\"Maximum\", value)\n end", "def minimum\n object.minimum.to_f\n end", "def min_length(length)\n valid_for 'string'\n assert_numeric length, minimum: 0\n set minLength: length\n end", "def min_length(value, pdef)\n if(value.length >= pdef['MinLength'].to_i)\n true\n else\n \"Value must be at least #{pdef['MinLength']} characters\"\n end\n end", "def set_value( value )\n if value == nil\n return\n end\n \n value = value.to_i\n \n satisfying_min = ((get_min == nil) or ((get_min != nil) and (get_min <= value)))\n satisfying_max = ((get_max == nil) or ((get_max != nil) and (value <= get_max)))\n \n if satisfying_min and satisfying_max\n @value = value\n else\n raise \"integer value out of range: #{ value.to_s }\"\n end\n end", "def set_min_value(value_array)\n min = value_array[0]\n\n value_array.each do |value|\n min = value if value < min\n end\n min\nend", "def passcode_minimum_length=(value)\n @passcode_minimum_length = value\n end", "def minimum_beds(beds)\n set_limiting_value(:minimum, :beds, beds)\n end", "def required=(value)\n @required = value\n end", "def password_minimum_character_set_count=(value)\n @password_minimum_character_set_count = value\n end", "def class_min_is_valid\n errors.add(:class_min,'Invalid class min value.') unless class_min_is_valid?\n end", "def minweight(w)\n @weight = w if w<@weight\n end", "def lazy_min=(newmin)\n newmin = newmin.to_f\n \n #Add hours for every 60 minutes given.\n if newmin > 60 or newmin < 0\n hours = (newmin.to_f / 60.0).floor\n newmin -= (hours.to_f * 60.0)\n self.add_hours(hours)\n end\n \n #Convert any decimals to setting the second.\n diff = newmin - newmin.floor\n self.lazy_sec = diff * 60 if diff > 0.0\n \n #Set the actual minute.\n @t_min = newmin.floor\n \n self\n end", "def set_amps_min x\n if x<10\n x=10\n end\n @@amps=x\n end", "def min() end", "def minimum_warning_patch_version=(value)\n @minimum_warning_patch_version = value\n end", "def min\n self.class.min\n end", "def min\r\n @range.min\r\n end", "def work_profile_password_minimum_length=(value)\n @work_profile_password_minimum_length = value\n end", "def get_min()\n @min \n end", "def validate_limits(properties, value)\n # Minimum\n if properties[:min]\n min = limit_value properties, :min\n value = min if value < min\n end\n\n # Maximum\n if properties[:max]\n max = limit_value properties, :max\n value = max if value > max\n end\n\n value\n end", "def minT_c=(value)\n @min_t = { value: Float(value), unit: :celsius }\n end" ]
[ "0.819543", "0.7879908", "0.7622051", "0.74416244", "0.74145067", "0.7106753", "0.7106753", "0.70925885", "0.70925885", "0.6830137", "0.67900425", "0.67332417", "0.6639685", "0.6613037", "0.65425646", "0.65425646", "0.6509885", "0.6481013", "0.64481896", "0.6441025", "0.64242923", "0.6375314", "0.6375314", "0.6361411", "0.6361411", "0.6361411", "0.6361411", "0.6361411", "0.6361411", "0.6361383", "0.6352997", "0.629439", "0.6288076", "0.62677336", "0.6248586", "0.6247", "0.6247", "0.62400335", "0.6195207", "0.61673385", "0.61626107", "0.61350185", "0.61350185", "0.61350185", "0.61350185", "0.613262", "0.6125842", "0.6094414", "0.6067454", "0.6067454", "0.6067454", "0.6067454", "0.59704065", "0.59704065", "0.5965212", "0.5963347", "0.59586436", "0.5958083", "0.5958083", "0.5958083", "0.5958083", "0.59500664", "0.59500664", "0.5932283", "0.5932283", "0.5931876", "0.5904753", "0.5885834", "0.5885834", "0.5885834", "0.5885834", "0.5885834", "0.5885834", "0.5881463", "0.58141506", "0.5812082", "0.57984483", "0.5797579", "0.57791287", "0.57517636", "0.57490623", "0.5735317", "0.5730619", "0.5721992", "0.57095385", "0.56686336", "0.5661533", "0.564116", "0.5638084", "0.5636378", "0.5612371", "0.5587856", "0.55619735", "0.55538434", "0.5552951", "0.5548903", "0.5531956", "0.5531617", "0.55284774", "0.5528095" ]
0.83990884
0
Serializes information the current object
def serialize(writer) raise StandardError, 'writer cannot be null' if writer.nil? writer.write_string_value("decimalPlaces", @decimal_places) writer.write_string_value("displayAs", @display_as) writer.write_object_value("maximum", @maximum) writer.write_object_value("minimum", @minimum) writer.write_string_value("@odata.type", @odata_type) writer.write_additional_data(@additional_data) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serialize\n end", "def serialize(object) end", "def serialize; end", "def serialize; end", "def serialize\n \n end", "def serialize\n raise NotImplementedError\n end", "def serialize\n raise NotImplementedError\n end", "def dump\r\n super + to_s\r\n end", "def serialize\n self.to_hash.to_json\n end", "def serialized\n serializer_class.new(self).serializable_hash\n end", "def serialize\n @raw_data\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"identityType\", @identity_type)\n end", "def serialize\n @serializer.serialize(self.output)\n end", "def serialize(_object, data); end", "def serialize(_object, data); end", "def to_json\n\t\t\tself.instance_variable_hash\n\t\tend", "def serializer; end", "def serialize!\n end", "def serialize(object)\n object.serializable_hash\n end", "def serialize(object)\n object.to_s\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"device\", @device)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"keyStrength\", @key_strength)\n end", "def marshal\n Marshal.dump self\n end", "def marshal\n Marshal.dump self\n end", "def marshal\n Marshal.dump self\n end", "def inspect\n serialize.to_s\n end", "def serialize\n YAML::dump(self)\n end", "def inspect()\n serialize.to_s()\n end", "def inspect()\n serialize.to_s()\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_collection_of_object_values(\"answers\", @answers)\n writer.write_object_value(\"assignment\", @assignment)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionCalloutInstances\", @custom_extension_callout_instances)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"requestor\", @requestor)\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_enum_value(\"state\", @state)\n writer.write_string_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"initiator\", @initiator)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_date_time_value(\"visibleHistoryStartDateTime\", @visible_history_start_date_time)\n end", "def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end", "def serialize(object, data); end", "def serialize\n JSON.generate(to_h)\n end", "def serialiaze\n Logger.d(\"Serializing the User object\")\n save_to_shared_prefs(@context, self.class, self)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"life\", @life)\n writer.write_object_value(\"per\", @per)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end", "def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"owner\", @owner)\n writer.write_collection_of_object_values(\"properties\", @properties)\n writer.write_string_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"targetTypes\", @target_types)\n end", "def write\n hash = attributes_hash\n write_value(serializer_class.dump(hash))\n @_cache = hash # set @_cache after the write\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end", "def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend", "def _dump(depth)\n scrooge_fetch_remaining\n scrooge_invalidate_updateable_result_set\n scrooge_dump_flag_this\n str = Marshal.dump(self)\n scrooge_dump_unflag_this\n str\n end", "def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end", "def to_dump\n @time = Time.now\n Base64.encode64(Marshal.dump(self))\n end", "def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend", "def inspect\n serialize.to_s\n end", "def inspect\n serialize.to_s\n end", "def inspect\n serialize.to_s\n end", "def serialize(options={})\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"apiConnectorConfiguration\", @api_connector_configuration)\n writer.write_collection_of_object_values(\"identityProviders\", @identity_providers)\n writer.write_collection_of_object_values(\"languages\", @languages)\n writer.write_collection_of_object_values(\"userAttributeAssignments\", @user_attribute_assignments)\n writer.write_collection_of_object_values(\"userFlowIdentityProviders\", @user_flow_identity_providers)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"clientContext\", @client_context)\n writer.write_object_value(\"resultInfo\", @result_info)\n writer.write_enum_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_number_value(\"memberCount\", @member_count)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_enum_value(\"tagType\", @tag_type)\n writer.write_string_value(\"teamId\", @team_id)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_object_value(\"resource\", @resource)\n writer.write_object_value(\"weight\", @weight)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"firstSeenDateTime\", @first_seen_date_time)\n writer.write_object_value(\"host\", @host)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"version\", @version)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"large\", @large)\n writer.write_object_value(\"medium\", @medium)\n writer.write_object_value(\"small\", @small)\n writer.write_object_value(\"source\", @source)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_enum_value(\"allowedTargetScope\", @allowed_target_scope)\n writer.write_object_value(\"automaticRequestSettings\", @automatic_request_settings)\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionStageSettings\", @custom_extension_stage_settings)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"expiration\", @expiration)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"questions\", @questions)\n writer.write_object_value(\"requestApprovalSettings\", @request_approval_settings)\n writer.write_object_value(\"requestorSettings\", @requestor_settings)\n writer.write_object_value(\"reviewSettings\", @review_settings)\n writer.write_collection_of_object_values(\"specificAllowedTargets\", @specific_allowed_targets)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end", "def serializable_hash\n self.attributes\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"modalities\", @modalities)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_collection_of_object_values(\"participants\", @participants)\n writer.write_collection_of_object_values(\"sessions\", @sessions)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"version\", @version)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"axes\", @axes)\n writer.write_object_value(\"dataLabels\", @data_labels)\n writer.write_object_value(\"format\", @format)\n writer.write_object_value(\"height\", @height)\n writer.write_object_value(\"left\", @left)\n writer.write_object_value(\"legend\", @legend)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"series\", @series)\n writer.write_object_value(\"title\", @title)\n writer.write_object_value(\"top\", @top)\n writer.write_object_value(\"width\", @width)\n writer.write_object_value(\"worksheet\", @worksheet)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"name\", @name)\n writer.write_enum_value(\"scenarios\", @scenarios)\n end", "def serialize\n JSON.dump(@hash)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_boolean_value(\"isUsable\", @is_usable)\n writer.write_boolean_value(\"isUsableOnce\", @is_usable_once)\n writer.write_number_value(\"lifetimeInMinutes\", @lifetime_in_minutes)\n writer.write_string_value(\"methodUsabilityReason\", @method_usability_reason)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"temporaryAccessPass\", @temporary_access_pass)\n end", "def to_s\r\n dump\r\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"callee\", @callee)\n writer.write_object_value(\"caller\", @caller)\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_object_value(\"failureInfo\", @failure_info)\n writer.write_collection_of_object_values(\"media\", @media)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"deviceCount\", @device_count)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_enum_value(\"platform\", @platform)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_object_value(\"sizeInByte\", @size_in_byte)\n writer.write_string_value(\"version\", @version)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_string_value(\"roleTemplateId\", @role_template_id)\n writer.write_collection_of_object_values(\"scopedMembers\", @scoped_members)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"options\", @options)\n writer.write_boolean_value(\"protected\", @protected)\n end", "def serialize(io)\n Encoder.encode(io, self)\n io\n end", "def _dump() end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"authenticationConfiguration\", @authentication_configuration)\n writer.write_object_value(\"clientConfiguration\", @client_configuration)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"endpointConfiguration\", @endpoint_configuration)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"body\", @body)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"imageUrl\", @image_url)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"bundles\", @bundles)\n writer.write_string_value(\"driveType\", @drive_type)\n writer.write_collection_of_object_values(\"following\", @following)\n writer.write_collection_of_object_values(\"items\", @items)\n writer.write_object_value(\"list\", @list)\n writer.write_object_value(\"owner\", @owner)\n writer.write_object_value(\"quota\", @quota)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"sharePointIds\", @share_point_ids)\n writer.write_collection_of_object_values(\"special\", @special)\n writer.write_object_value(\"system\", @system)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"feature\", @feature)\n writer.write_string_value(\"featureGroup\", @feature_group)\n writer.write_string_value(\"impactDescription\", @impact_description)\n writer.write_boolean_value(\"isResolved\", @is_resolved)\n writer.write_enum_value(\"origin\", @origin)\n writer.write_collection_of_object_values(\"posts\", @posts)\n writer.write_string_value(\"service\", @service)\n writer.write_enum_value(\"status\", @status)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_object_values(\"deviceStates\", @device_states)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_object_value(\"installSummary\", @install_summary)\n writer.write_object_value(\"largeCover\", @large_cover)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_date_time_value(\"publishedDateTime\", @published_date_time)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_collection_of_object_values(\"userStateSummary\", @user_state_summary)\n end", "def inspect\n attributes = [\n \"name=#{name.inspect}\",\n \"key=#{key.inspect}\",\n \"data_type=#{data_type.inspect}\",\n ]\n \"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>\"\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_object_values(\"categories\", @categories)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"developer\", @developer)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_object_value(\"largeIcon\", @large_icon)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"notes\", @notes)\n writer.write_string_value(\"owner\", @owner)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_enum_value(\"publishingState\", @publishing_state)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"platformType\", @platform_type)\n writer.write_number_value(\"settingCount\", @setting_count)\n writer.write_collection_of_object_values(\"settingStates\", @setting_states)\n writer.write_enum_value(\"state\", @state)\n writer.write_number_value(\"version\", @version)\n end", "def _dump()\n #This is a stub, used for indexing\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"templateId\", @template_id)\n writer.write_collection_of_object_values(\"values\", @values)\n end", "def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"containers\", @containers)\n writer.write_object_value(\"controller\", @controller)\n writer.write_collection_of_object_values(\"ephemeralContainers\", @ephemeral_containers)\n writer.write_collection_of_object_values(\"initContainers\", @init_containers)\n writer.write_object_value(\"labels\", @labels)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"namespace\", @namespace)\n writer.write_object_value(\"podIp\", @pod_ip)\n writer.write_object_value(\"serviceAccount\", @service_account)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"detectionStatus\", @detection_status)\n writer.write_object_value(\"imageFile\", @image_file)\n writer.write_string_value(\"mdeDeviceId\", @mde_device_id)\n writer.write_date_time_value(\"parentProcessCreationDateTime\", @parent_process_creation_date_time)\n writer.write_object_value(\"parentProcessId\", @parent_process_id)\n writer.write_object_value(\"parentProcessImageFile\", @parent_process_image_file)\n writer.write_string_value(\"processCommandLine\", @process_command_line)\n writer.write_date_time_value(\"processCreationDateTime\", @process_creation_date_time)\n writer.write_object_value(\"processId\", @process_id)\n writer.write_object_value(\"userAccount\", @user_account)\n end", "def inspect\n self.to_hash.inspect\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end", "def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end", "def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activationUrl\", @activation_url)\n writer.write_string_value(\"activitySourceHost\", @activity_source_host)\n writer.write_string_value(\"appActivityId\", @app_activity_id)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_object_value(\"contentInfo\", @content_info)\n writer.write_string_value(\"contentUrl\", @content_url)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"fallbackUrl\", @fallback_url)\n writer.write_collection_of_object_values(\"historyItems\", @history_items)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"userTimezone\", @user_timezone)\n writer.write_object_value(\"visualElements\", @visual_elements)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize\n super(ATTR_NAME_ARY)\n end", "def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"basis\", @basis)\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"datePurchased\", @date_purchased)\n writer.write_object_value(\"firstPeriod\", @first_period)\n writer.write_object_value(\"period\", @period)\n writer.write_object_value(\"rate\", @rate)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end", "def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end" ]
[ "0.7951372", "0.7645999", "0.7579812", "0.7579812", "0.7440032", "0.720861", "0.720861", "0.7207583", "0.7016516", "0.70007193", "0.6992252", "0.69838214", "0.69723576", "0.69666415", "0.69666415", "0.6942002", "0.69417155", "0.6933786", "0.6913977", "0.6891677", "0.68810964", "0.687664", "0.687664", "0.687664", "0.6875119", "0.68510306", "0.68364877", "0.68364877", "0.6825542", "0.6815931", "0.68061364", "0.68006235", "0.67944074", "0.67717844", "0.67341864", "0.67289317", "0.66964674", "0.66828746", "0.6673492", "0.6668077", "0.6666333", "0.6659732", "0.6656788", "0.66513675", "0.6635875", "0.66275525", "0.66275525", "0.66275525", "0.6627384", "0.66165835", "0.66141444", "0.6611379", "0.6597342", "0.65968686", "0.6594517", "0.6592636", "0.6583964", "0.6580536", "0.65803635", "0.6575503", "0.65716475", "0.65712893", "0.6566952", "0.6560253", "0.65554273", "0.65410006", "0.65378475", "0.65346783", "0.6527361", "0.6525178", "0.65242875", "0.65235287", "0.65174305", "0.65141636", "0.6508169", "0.6499713", "0.6498714", "0.6496881", "0.6486202", "0.6482482", "0.64814615", "0.6479782", "0.6476621", "0.6475453", "0.64677024", "0.64633876", "0.64619535", "0.6461202", "0.6457243", "0.64497435", "0.6439583", "0.6433183", "0.643078", "0.6424316", "0.6420337", "0.6420337", "0.6420337", "0.6420337", "0.6420337", "0.6418776", "0.64156514" ]
0.0
-1
=begin i: array with 'faces'strings o: number of smiling faces r: face has : or ; face may have or ~ face has ) or D nothing else! f: loop throug faces if 2 long: index 0 in valid eyes index 1 in valid mouth if 3 long: index 0 in valid eyes index 1 in valid nose index 2 in valid mouth if valid face up counter output counter =end
def countSmileys(faces) valid_eyes = [':', ';'] valid_nose = ['-', '~'] valid_mouth = [')', 'D'] counter = 0 faces.each do |face| case face.size when 2 if valid_eyes.include?(face[0]) && valid_mouth.include?(face[1]) counter += 1 end when 3 if valid_eyes.include?(face[0]) && valid_nose.include?(face[1]) && valid_mouth.include?(face[2]) counter += 1 end end end counter end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_smileys(arr)\n count = 0\n arr.each do |face|\n case\n when face == \":)\"\n count += 1\n when face == \":-)\"\n count += 1\n when face == \":~)\"\n count += 1\n when face == \":D\"\n count += 1\n when face == \":-D\"\n count += 1\n when face == \":~D\"\n count += 1\n when face == \";)\"\n count += 1\n when face == \";-)\"\n count += 1\n when face == \";~)\"\n count += 1\n when face == \";D\"\n count += 1\n when face == \";-D\"\n count += 1\n when face == \";~D\"\n count += 1\n end\n end\n count\nend", "def count_smileys(arr)\n arr.count { |face| face =~ /(:|;){1}(-|~)?(\\)|D)/ }\nend", "def count_smileys(arr)\n #your code here\n counter = 0\n nose = [\"-\",\"~\"]\n eyes = [\":\",\";\"]\n mouth = [\")\",\"D\"]\n arr.each do |x|\n if eyes.include?(x[0]) and mouth.include?(x[1])\n counter += 1\n elsif eyes.include?(x[0]) and nose.include?(x[1]) and mouth.include?(x[2])\n counter += 1\n end\n end\n return counter\nend", "def get_face_count\n count = 0\n @groups.each_value do |grp|\n count += grp.faces.size\n end\n return count\n end", "def count_smileys(arr)\n return 0 if arr.empty?\n valid = {\"eyes\"=>[\":\", \";\"], \"nose\"=>[\"-\", \"~\"], \"mouth\"=>[\")\", \"D\"]}\n valid_two = arr.select { |smile| smile.size == 2 }\n valid_three = arr.select { |smile| smile.size == 3 }\n\n valid_smiles = []\n\n valid_two.each do |smile|\n if valid[\"eyes\"].include?(smile[0]) &&\n valid[\"mouth\"].include?(smile[1])\n valid_smiles << smile\n end\n end\n\n valid_three.each do |smile|\n if valid[\"eyes\"].include?(smile[0]) &&\n valid[\"nose\"].include?(smile[1]) &&\n valid[\"mouth\"].include?(smile[2])\n valid_smiles << smile\n end\n end\n\n valid_smiles.size\nend", "def walk_through\n count = 0\n for i in 0..@n-1\n for j in 0..@m-1\n if @garden[i][j] == 'W'\n @garden[i][j] = 'C'\n count += 1\n check_around(i,j)\n end\n end\n end\n puts count\n end", "def count_smileys(arr)\n arr.map { |i| i.scan /[;:][-*~]?[D)]/ }.flatten.size\nend", "def find_faces\n end", "def find_faces\n end", "def countSheeps array\n\tcounter = 0\n array.each do | aBool |\n \tif aBool == true\n \t\tcounter = counter + 1\n \tend\n end\n return counter\nend", "def turn_count\n counter = 0\n cells.each do |index|\n if index != \" \"\n counter += 1\n end\n end\n counter\n end", "def countBoxes(backGround,pixColors,totalBoxes)\r\n \r\n rows = @image.file.rows\r\n cols = @image.file.cols\r\n \r\n # initialize working variables\r\n \r\n boxCounts = {}\r\n boxMasses = {}\r\n pixColors.each do | pixColor |\r\n boxCounts[pixColor] = {}\r\n boxMasses[pixColor] = {}\r\n @steps.each do | stepSize |\r\n totBoxes = (rows-stepSize+1) * (cols-stepSize+1)\r\n boxCounts[pixColor][stepSize] = {}\r\n boxMasses[pixColor][stepSize] = Array.new(totBoxes,0)\r\n totalBoxes[stepSize] = totBoxes\r\n end\r\n end\r\n\r\n # now figure box masses\r\n \r\n rows.times do | row |\r\n cols.times do | col |\r\n pixColor = @image.file.getCell(row,col)\r\n if (backGround == -1) or (pixColor != backGround)\r\n @steps.each do | stepSize |\r\n boxesPresent = enumerateBoxes(stepSize, row, col, rows, cols)\r\n boxesPresent.each do | boxNumber |\r\n boxMasses[pixColor][stepSize][boxNumber] += 1\r\n end\r\n end\r\n end\r\n end\r\n end\r\n \r\n # calculate boxCounts from boxMasses\r\n \r\n boxMasses.each_pair do | pixColor, byPixHash |\r\n byPixHash.each_pair do | stepSize, boxMassArray |\r\n boxMassArray.each do | boxMass |\r\n if (boxMass > 0)\r\n # boxCounts[pixColor][stepSize][boxMass] += 1 if boxMass > 0\r\n boxMassHash = boxCounts[pixColor][stepSize]\r\n if boxMassHash[boxMass]\r\n boxMassHash[boxMass] += 1\r\n else\r\n boxMassHash[boxMass] = 1\r\n end\r\n end\r\n end\r\n end\r\n end\r\n\r\n # debugging aid: dump box counts\r\n if false\r\n boxCounts.each_pair do | pixColor, byPixHash |\r\n byPixHash.each_pair do | stepSize, boxCountHash |\r\n boxCountHash.each_pair do | boxMass, boxCount |\r\n print \"boxCounts[#{pixColor}][#{stepSize}][#{boxMass}] = #{boxCount}\\n\"\r\n end\r\n end\r\n end\r\n end\r\n\r\n # return values\r\n boxCounts\r\n end", "def turn_count\n counter = 0\n @cells.each do |cell|\n if cell != \" \"\n counter += 1\n end\n end\n counter\n end", "def count_smileys_x(arr)\n arr.count { |e| e =~ /^(:|;)(-|~)?(\\)|D)$/ }\nend", "def turn_count\n #@cells.select {|cell| cell == \"X\" || cell == \"O\"}.size\n counter = 0\n @cells.each do |cell|\n if cell != \" \" && cell != \"\"\n counter += 1\n end\n end\n counter\n end", "def get_zigzag_flood_y(aface)\r\n result = []\r\n#@debug = true \r\n # create a 2D array to hold the rasterized shape\r\n # raster is on stepover boundaries and center of each square is where the zigzags will start and end.\r\n # set true for each centerpoint that is inside the face\r\n # raster 0,0 is bottom left of the shape, just outside the boundary\r\n bb = aface.bounds\r\n stepOverinuse = @bit_diameter * @stepOver\r\n ystart = bb.min.y - stepOverinuse / 2 # center of bottom row of cells\r\n yend = bb.max.y + stepOverinuse / 2 + 0.002\r\n \r\n xstart = bb.min.x - stepOverinuse / 2 # center of first column of cells\r\n xend = bb.max.x + stepOverinuse + 0.002 # MUST have a column after end of object else stuff gets skipped\r\n# if ($phoptions.use_fuzzy_pockets?) #always uses fuzzy, gives better results\r\n ylen = yend - ystart - 0.002\r\n stepOverinuse1 = getfuzzystepover(ylen)\r\n xlen = xend - xstart - 0.002\r\n stepOverinuse2 = getfuzzystepover(xlen)\r\n stepOverinuse = [stepOverinuse1, stepOverinuse2].min # always use lesser value\r\n# end\r\n debugfile(\"xstart #{xstart.to_mm},#{ystart.to_mm} #{xend.to_mm},#{yend.to_mm} #{stepOverinuse.to_mm}\" ) if (@debug)\r\n\r\n #use a hash as if it were a 2d array of cells rastered over the face\r\n if (@cells == nil)\r\n @cells = Hash.new(false)\r\n else\r\n @cells.clear\r\n end \r\n # now loop through all cells and test to see if this point is in the face\r\n pt = Geom::Point3d.new(0, 0, 0)\r\n xmax = ymax = 0.0\r\n#create the cell array \r\n createcells(xstart,xend, ystart,yend, stepOverinuse, aface) #creates cell has and sets @cellxmax etc\r\n xmax = @cellxmax\r\n ymax = @cellymax\r\n \r\n entities = Sketchup.active_model.active_entities if (@debug)\r\n \r\n debugfile(\"xmax #{xmax} ymax #{ymax}\") if (@debug) # max cell index\r\n# puts \"xmax #{xmax} ymax #{ymax}\"\r\n#output array for debug \r\n if (@debug)\r\n y = ymax\r\n debugfile(\"START\") if (@debug)\r\n while (y >= 0) do\r\n x = 0\r\n s = \"y #{y}\"\r\n while (x <= xmax) do\r\n if (@cells[[x,y]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n x += 1\r\n end\r\n debugfile(s) if (@debug)\r\n y -= 1 \r\n end\r\n end\r\n\r\n # now create the zigzag points from the hash, search along X for first and last points\r\n # keep track of 'going left' or 'going right' so we can test for a line that would cross the boundary\r\n # if this line would cross the boundary, start a new array of points\r\n r = 0\r\n prevpt = nil\r\n#@debug = true\r\n while (someleft(@cells,xmax,ymax)) # true if some cells are still not processed\r\n debugfile(\"R=#{r}\") if (@debug)\r\n result[r] = []\r\n y = 0\r\n goingright = true\r\n py = -1 # previous y used, to make sure we do not jump a Y level\r\n county = 0\r\n while (y <= ymax) do\r\n county += 1\r\n if (county > 500)\r\n puts \" county break\"\r\n break\r\n end\r\n \r\n leftx = -1\r\n x = 0\r\n while (x <= xmax) do # search to the right for a true\r\n if (@cells[[x,y]] == true)\r\n @cells[[x,y]] = false\r\n leftx = x\r\n break # found left side X val\r\n end\r\n x += 1\r\n end #while x\r\n rightx = -1\r\n x += 1\r\n if x <= xmax \r\n while (x <= xmax) do # search to the right for a false\r\n if (@cells[[x,y]] == false)\r\n rightx = x-1\r\n break # found right side X val\r\n end\r\n @cells[[x,y]] = false # set false after we visit\r\n x += 1\r\n end #while x\r\n end\r\n # now we have leftx and rightx for this Y, if rightx > -1 then push these points\r\n debugfile(\" left #{leftx} right #{rightx} y #{y}\") if (@debug)\r\n if (rightx > -1)\r\n #if px,py does not cross any face edges\r\n# pt1 = Geom::Point3d.new(xstart + leftx*stepOverinuse, ystart + y * stepOverinuse, 0)\r\n# pt2 = Geom::Point3d.new(0, 0, 0)\r\n if (goingright)\r\n pt1 = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n pt2 = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingright #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n else\r\n if (py > -1)\r\n if ((y - py) > 1) # do not cross many y rows, start new set instead\r\n debugfile(\"isyrows goingright #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n end\r\n end\r\n end\r\n end\r\n #check that this line does not cross something, happens on sharp vertical points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going right so create new point to the left of cross\r\n np = Geom::Point3d.new(cross.x - (stepOverinuse/2), cross.y, 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the right of the crossing\r\n pt1 = Geom::Point3d.new(cross.x + (stepOverinuse/2), cross.y, 0)\r\n end\r\n \r\n entities.add_cpoint(pt1) if (@debug)\r\n result[r] << pt1\r\n pt = pt1\r\n if (leftx != rightx)\r\n #pt = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt) if (@debug)\r\n else\r\n puts \"singleton #{x} #{y}\" if (@debug)\r\n end\r\n else\r\n #pt.x = xstart + rightx*stepOverinuse\r\n #pt.y = ystart + y * stepOverinuse\r\n pt1 = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n pt2 = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingleft #{x} #{y}\") if (@debug)\r\n prevpt = nil\r\n r += 1\r\n result[r] = []\r\n debugfile(\"iscrossing left R=#{r}\") if (@debug)\r\n else \r\n if (py > -1)\r\n if ((y - py) > 1) # do not cross many y rows\r\n debugfile(\"isyrows goingleft #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n prevpt = nil\r\n debugfile(\"isyrows left R=#{r}\") if (@debug)\r\n end\r\n end\r\n end\r\n end\r\n \r\n #check that this horiz line does not cross something, happens on sharp vertical points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going left so create new point to the right of cross\r\n np = Geom::Point3d.new(cross.x + stepOverinuse/2, cross.y, 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line on other side of gap\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the left of the crossing\r\n pt1 = Geom::Point3d.new(cross.x - stepOverinuse/2, cross.y, 0)\r\n end\r\n \r\n result[r] << pt1\r\n pt = pt1\r\n entities.add_cpoint(pt1) if (@debug)\r\n #pt.x = xstart + leftx*stepOverinuse\r\n if (leftx != rightx)\r\n# pt = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt2) if (@debug)\r\n else\r\n puts \"Singleton #{x} #{y}\" if (@debug)\r\n end\r\n end\r\n prevpt = Geom::Point3d.new(pt.x, pt.y, 0)\r\n py = y\r\n end # if rightx valid\r\n y += 1\r\n goingright = !goingright\r\n end # while y\r\n \r\n #debug output\r\n if (@debug)\r\n if (someleft(@cells,xmax,ymax) )\r\n debugfile(\"someleft #{r}\") if (@debug)\r\n yc = ymax\r\n while (yc >= 0) do\r\n xc = 0\r\n s = \"Y #{yc}\"\r\n while (xc <= xmax) do\r\n if (@cells[[xc,yc]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n xc += 1\r\n end\r\n debugfile(s) if (@debug)\r\n yc -= 1 \r\n end\r\n end\r\n end\r\n r += 1\r\n prevpt = nil\r\n end # while someleft \r\n@debug = false\r\n puts \" result #{result.length} #{result[0].length} \" if (@debug)\r\n debugfile(\"result #{result.length}\") if (@debug)\r\n result.each { |rs|\r\n debugfile(\" #{rs.length}\") if (@debug)\r\n }\r\n return result\r\n end", "def next_faceup_position\n return 1 if (faceup == [])\n faceup.last.faceup_position + 1\n end", "def count_brown_eyes (eye_colors)\n\tn = 0\n\teye_colors.each do |eye_color|\n\t\tif eye_color == \"Brown\"\n\t\t\tn += 1\n\t\tend\n\tend\n\n\treturn n\nend", "def hole_count\n holes.count\n end", "def turn_count\n count = 0\n @cells.each do |element|\n count += 1 if element != \" \"\n end\n count\n end", "def countSheeps array\n count = 0\n array.each { |sheep| count += 1 if sheep == true }\n count\nend", "def count_smileys(arr)\n arr.select { |s| s =~ /[;|:][-~]?[)D]/ }.size\nend", "def turn_count\n cells.count{|token| token == \"X\" || token == \"O\"}\n end", "def countingValleys(n, s)\n valleys, counter, flag, prev_flag = 0, 0, \"sea level\", \"\"\n s.chars.each do |x|\n prev_flag = flag\n if x == \"U\" \n counter += 1 \n elsif x == \"D\"\n counter -= 1\n end\n flag = \"valley\" if counter < 0\n flag = \"sea level\" if counter == 0 \n if prev_flag == \"valley\" && flag == \"sea level\"\n valleys += 1\n elsif prev_flag == \"sea level\" && flag == \"valley\"\n valleys += 1\n end\n end\n valleys/2\nend", "def draw_face2(face_name, x, y, index = 0, animf = false, animf_index = 0, animf_max = 1, nofade = false)\n if animf\n # Use Animated Face\n bitmap = Cache.face(face_name)\n rect = Rect.new(0,0,0,0)\n rect.width = (bitmap.width / animf_max)\n rect.height = bitmap.height\n rect.x = animf_index * rect.width\n rect.y = 0\n @face.bitmap = Bitmap.new(rect.width,rect.height)\n @face.bitmap.blt(0,0,bitmap,rect)\n bitmap.dispose\n elsif $game_message.side == 0 or $game_message.side == -1 or EightFaces_File\n # USE 8 FACES PER FILE\n bitmap = Cache.face(face_name)\n rect = Rect.new(0,0,0,0)\n rect.width = (bitmap.width / 4)\n rect.height = (bitmap.height / 2)\n rect.x = index % 4 * rect.width\n rect.y = index / 4 * rect.height\n @face.bitmap = Bitmap.new(rect.width,rect.height)\n @face.bitmap.blt(0,0,bitmap,rect)\n bitmap.dispose\n else\n # USE 1 FACES PER FILE\n @face.bitmap = Cache.face(face_name)\n end\n # SET X/Y OF FACE DEPENDS ON FACE SIDE\n if $game_message.side == 1\n @face.mirror = false\n @face.x = x + 6\n @face.y = y - 6 + height - @face.height\n elsif $game_message.side == 2\n @face.mirror = true\n @face.x = x + ((self.width - 6) - @face.width)\n @face.y = y - 6 + height - @face.height\n elsif $game_message.side == 0\n @face.mirror = false\n @face.x = x + 16\n @face.y = y - 16 + height - @face.height\n elsif $game_message.side == -1\n @face.mirror = true\n @face.x = x + self.contents.width - @face.width + 16\n @face.y = y - 16 + height - @face.height\n end\n @face.x += FACE_X_PLUS\n @face.y += FACE_Y_PLUS\n @face_data = [face_name, index, $game_message.side]\n if @face_data != @face_data_old and FADE_MOVE_WHEN_USE_NEW_FACE; @showtime = 1; @face_data_old = @face_data; end\n @face.opacity = 0 if !nofade and ($nms.face_fade == true and ((FADE_ONLY_FIRST and @showtime <= 1) or (FADE_ONLY_FIRST == false)))\n end", "def countSheeps array\n array.count(true)\nend", "def createcells(xstart,xend, ystart,yend, stepOverinuse, aface)\r\n countx = 0\r\n xmax = ymax = 0\r\n x = xstart\r\n while (x <= xend) do\r\n y = ystart\r\n county = 0\r\n while (y <= yend) do\r\n #note: using half stepover on the X axis, gets the ends of the zigs closer to the border\r\n xc = ((x-xstart) / (stepOverinuse/2) + 0.002).round # x cell index\r\n yc = ((y-ystart) / stepOverinuse + 0.002).round # y cell index\r\n pt = Geom::Point3d.new(x, y,0)\r\n res = aface.classify_point(pt)\r\n \r\n case res\r\n when Sketchup::Face::PointUnknown #(indicates an error),\r\n puts \"unknown\" if (@debug)\r\n when Sketchup::Face::PointInside #(point is on the face, not in a hole),\r\n @cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOnVertex #(point touches a vertex),\r\n #cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOnEdge #(point is on an edge),\r\n #cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOutside #(point outside the face or in a hole),\r\n #puts \"outside\" if (@debug)\r\n when Sketchup::Face::PointNotOnPlane #(point off the face's plane).\r\n puts \"notonplane\" if (@debug)\r\n end\r\n \r\n xmax = (xmax < xc) ? xc : xmax\r\n ymax = (ymax < yc) ? yc : ymax\r\n y += stepOverinuse\r\n county += 1\r\n if (county > 5000) #really for debugging but prevents runaway loops\r\n puts \"county high break\"\r\n break\r\n end\r\n end # while y\r\n x += (stepOverinuse / 2.0)\r\n countx += 1\r\n if (countx > 5000)\r\n puts \"countx high break\"\r\n break\r\n end\r\n end # while x\r\n @cellxmax = xmax\r\n @cellymax = ymax\r\n end", "def annotate_related_faces(face)\n # Find faces at same z as selected face\n proc { |r|\n r.material = SVG.same(face.plane[3], r.plane[3]) ? FaceSVG.surface : FaceSVG.pocket\n }\n end", "def students_with_brown_eyes(eye_colors)\n\tbrown_eyes = 0\n\n\teye_colors.each do |eye_color|\n \t\tif eye_color == \"Brown\"\n\t\t\tbrown_eyes += 1\n\t\tend\n\tend\n\n\treturn brown_eyes\n\nend", "def countSheeps(array)\n array.count do |sheep|\n next if sheep.nil?\n sheep == true\n end\nend", "def count_correct_positions\n color_index_checker = []\n @code_guess.each_with_index do |color, index|\n if color == @secret_code[index]\n @red_peg += 1\n end\n end\n end", "def part1()\n @seats = @input.map(&:dup)\n until rules_part1() == 0\n end\n count = 0\n @seats.each { |row| count += row.count('#') }\n count\nend", "def turn_count\r\n cells.count {|cell| cell == \"X\" || cell == \"O\"}\r\n end", "def countSheeps(array)\n array.count(true)\nend", "def countSheeps2 array\n array.count(true)\nend", "def face\n end", "def countSheeps(array)\n return array.count{|v|v}\nend", "def countSheeps arr \n count = 0\n arr.each { |sheep|\n sheep == true && count += 1\n }\n count\nend", "def turn_count\n count = 0\n cells.each {|pos| count += 1 if pos == \"X\" || pos == \"O\"}\n count\n end", "def turn_count\n cells.count{ |space| space ==\"X\" || space ==\"O\" }\n end", "def detect_faces imgurl = \"\"\r\n return @client.faces_detect(:urls => [imgurl])\r\n end", "def countSheeps array\n count = 0\n array.each do |x|\n x == true ? count += 1 : next\n end\n count\nend", "def count_impacts(north_laser_array, south_laser_array, direction)\n robot_moves = (0..(north_laser_array.size - 1) ).to_a #left to right\n robot_moves.reverse! if direction == :west #right to left\n impacts = 0\n robot_moves.each_with_index do |robot_position, tick|\n if(tick % 2 == 0) #even tick\n impacts += 1 if north_laser_array[robot_position] == \"|\"\n else #odd\n impacts += 1 if south_laser_array[robot_position] == \"|\"\n end\n end\n return impacts\nend", "def count_enemies()\r\n _enemy_nb = 0\r\n for i in 0..3\r\n if @warrior.feel(DIRECTIONS[i]).enemy?\r\n _enemy_nb += 1\r\n end\r\n end\r\n return _enemy_nb\r\n end", "def turn_count\n cells.count {|cell| cell == \"X\" || cell == \"O\"}\n end", "def num_jewels_in_stones(j, s)\n s.count(j)\nend", "def rule_3 *cards\n if cards.all?(&:face?)\n puts \"Upping the anti! #{cards.map(&:face?)}\"\n cards.raw_integer_value + 50\n end\n end", "def turn_count\n @cells.select{|position| position != \" \"}.count\n end", "def turn_count\n cells.count { |cell| cell == \"X\" || cell == \"O\" }\n end", "def red_peg_check\n guess_array = @guess.split\n secret_code_array = @secret_code.split\n red_pegs = guess_array.map.with_index { |e, i| e == secret_code_array[i] }\n @red_pegs = red_pegs.count(true)\n\n end", "def turn_count\n\t\tcells.count {|cell| cell == \"X\" || cell == \"O\"}\t\n\tend", "def turn_count\n cells.count {|value| value == \"X\" || value == \"O\"}\n end", "def ghost_face_check\n @ghostme = 255\n @ghostme = @saveghost if @saveghost != nil\n @keepme = false\n if $game_message.face_name.empty?\n $game_message.face_name = @savename if @savename != nil\n $game_message.face_index = @saveindex if @saveindex != nil\n end\n @keepme = true if @text.include?(\"\\\\keep\") # Sets keeping if true\n @keepme = true if @text.include?(\"\\\\k\")\n @text.gsub!(/\\\\keep/) {\"\"} # Clears keeping modifiers\n @text.gsub!(/\\\\k/) {\"\"}\n @savename = @keepme ? $game_message.face_name : nil # Keep me variables\n @saveindex = @keepme ? $game_message.face_index : nil\n @text.gsub!(/\\\\(?:trans|t)\\[(\\d+)\\]/i) { # Sets transparency\n check_face_trans($1.to_i) }\n @saveghost = @keepme ? @ghostme : nil\n end", "def count_object(object)\r\n _enemy_nb = 0\r\n for i in 0..3\r\n if @warrior.feel(DIRECTIONS[i]).send(object)\r\n _enemy_nb += 1\r\n end\r\n end\r\n return _enemy_nb\r\n end", "def count_human_marker(squares)\n squares.map(&:marker).count(TTTPlay::HUMAN_MARKER)\n end", "def countSheeps array\n total_sheep = 0\n # iterate through array\n # if element value is true, add one to a counter total_sheep\n array.each do |sheep|\n total_sheep += 1 if sheep\n end\n total_sheep\nend", "def turn_count\n cells.count { |char| char == \"X\" || char == \"O\" }\n end", "def FT_HAS_FAST_GLYPHS( face )\n 0\n end", "def run(character)\n \tnumberOfFilms = 0\n \tfor name in get_character_names\n numberOfFilms += 1 if name == character\n \tend\n\t\t numberOfFilms\n end", "def count_guess \r\n\t\t@num_guess = @secret_word.length \r\n\t\t@num_guess.times do \r\n\t\t\t@word_length_array << \"_\"\r\n\t\tend \r\n\t\tp @word_length_array\r\n\tend", "def count_sheep(num)\n (1..num).map {|i| \"#{i} sheep...\"}.join\nend", "def frequency\n opponents_faced.to_f / sample_size\n end", "def count_ude(g)\n @ude_counter['u'] = zeros\n zeros_v = []\n @l.each do |k,v|\n \tzeros_v << k if v == 'inf'\n end # do\n d_v_counter = 0\n zeros_v.each do |zv|\n\tno_follower_labeled_zero = true\n \tg.adjacent_vertices(zv).each do |v|\n \t\tno_follower_labeled_zero = false if @l[v] == '0'\n \tend # do\n \td_v_counter +=1 if no_follower_labeled_zero\n end # do\n @ude_counter['d'] = d_v_counter\n @ude_counter['e'] = g.num_vertices - @ude_counter['u'] - @ude_counter['d']\n end", "def turn_count(board)\n#Start with none\n turns = 0\n#Each is an iterator that acts on each part of the array (to count it)\n#Token is the value of characters X or O, each acts on the token\n#If the token = X or O THEN the count begins\n board.each do |token|\n if token == \"X\" || token == \"O\"\n turns += 1\n end\n end\n turns\n#don't forget! board.each do has its own END independently of def or if!\nend", "def count_surround_spaces(x, y, game_array)\n\n # Get an array of all possible surrouding squares\n spaces_to_check = generate_surrounding_spaces(x, y)\n\n bombs_counted = 0\n\n for space in spaces_to_check\n space_y = space[0]\n space_x = space[1]\n\n bombs_counted += 1 if is_bomb(game_array[space_y][space_x])\n\n end\n\n return bombs_counted\n\nend", "def count_bugs(state, i, j)\n [[i + 1, j], [i - 1, j], [i, j + 1], [i, j - 1]].count do |n1, n2|\n (0...state.size).to_a.include?(n1) && (0...state[n1].size).to_a.include?(n2) && state[n1][n2] == '#'\n end\nend", "def count_positions(wins, forker, forkee)\n potential_wins = get_potential_wins(wins, forker, forkee)\n position_counts = {}\n potential_wins.each do |potential_win|\n potential_win.each do |position|\n position_counts[position] = 0 if position_counts[position] == nil\n position_counts[position] += 1\n end\n end\n return position_counts\n end", "def turn_count(cells = @cells)\n cells.count {|taken| taken == \"X\" || taken == \"O\"}\n end", "def genotype_count(genome_array)\n\n gcount = Hash.new(0)\n\n #This block of code will generate a list of homozygous genotypes, and a list of heterozygous genotypes\n nucleotides = \"ACTG\"\n homozygous_genotypes_array = []\n heterozygous_genotypes_array = []\n nucleotides.each_char {|ele1| \n nucleotides.each_char {|ele2|\t\n homozygous_genotypes_array<<(ele1 + ele2) if ele1 == ele2\t\n heterozygous_genotypes_array<<(ele1 + ele2) if ele1 != ele2}}\n \n #This adds up the number of different genotypes in the genome\n genome_array.each {|entry|\n if heterozygous_genotypes_array.include?(entry[3]) \n gcount[\"Heterozygous\"] += 1 \n elsif homozygous_genotypes_array.include?(entry[3])\n\t gcount[\"Homozygous\"] += 1\n elsif nucleotides.include?(entry[3])\n gcount[\"Haploid\"] += 1 \n else\n gcount[\"Missing\"] += 1 \n end\n }\n gcount.each {|genotype, count| puts count.to_s + \" \" + genotype + \" data points\"}\nend", "def count_sea_monsters_in_image(img)\n\t\tll = @size * 8\n\t\tseamonster = /..................#..{#{ll-20}}#....##....##....###.{#{ll-20}}.#..#..#..#..#..#.../\n\t\timg.flatten.join('').scan(seamonster).size\n\tend", "def createcellsX(xstart,xend, ystart,yend, stepOverinuse, aface)\r\n county = 0\r\n xmax = ymax = 0\r\n y = ystart\r\n while (y <= yend) do\r\n x = xstart\r\n countx = 0\r\n while (x <= xend) do\r\n #note: using half stepover on the X axis, gets the ends of the zigs closer to the border\r\n xc = ((x-xstart) / (stepOverinuse) + 0.002).round # x cell index\r\n yc = ((y-ystart) / (stepOverinuse/2) + 0.002).round # y cell index\r\n pt = Geom::Point3d.new(x, y,0)\r\n res = aface.classify_point(pt)\r\n \r\n case res\r\n when Sketchup::Face::PointUnknown #(indicates an error),\r\n puts \"unknown\" if (@debug)\r\n when Sketchup::Face::PointInside #(point is on the face, not in a hole),\r\n @cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOnVertex #(point touches a vertex),\r\n #cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOnEdge #(point is on an edge),\r\n #cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOutside #(point outside the face or in a hole),\r\n #puts \"outside\" if (@debug)\r\n when Sketchup::Face::PointNotOnPlane #(point off the face's plane).\r\n puts \"notonplane\" if (@debug)\r\n end\r\n \r\n xmax = (xmax < xc) ? xc : xmax\r\n ymax = (ymax < yc) ? yc : ymax\r\n x += stepOverinuse\r\n countx += 1\r\n if (countx > 5000) #really for debugging but prevents runaway loops\r\n puts \"countx high break\"\r\n break\r\n end\r\n end # while x\r\n y += (stepOverinuse / 2.0)\r\n county += 1\r\n if (county > 5000)\r\n puts \"county high break\"\r\n break\r\n end\r\n end # while y\r\n @cellxmax = xmax\r\n @cellymax = ymax\r\n end", "def counting_spaces\n i = 0\n while i < 9 do\n result = @array.at(i)\n result.each do |num|\n if num == 0\n @@count = @@count + 1\n end\n end\n i = i + 1\n end\n end", "def scan_face(face)\r\n @seen << face\r\n \r\n face.edges.each do |edge|\r\n edge.faces.each do |f2|\r\n if f2 == face or !@seen.include? f2\r\n next # both faces must be in the seen list\r\n end\r\n \r\n submit_edge(edge, face, f2)\r\n end\r\n end # of iteration over face's edges\r\n end", "def sheep_count(num)\n \nend", "def turn_count(arr)\r\n arr.count do |arr_item|\r\n arr_item != \" \"\r\n end\r\nend", "def walkright(i,j,object)\r\n w=0\r\n counter =4\r\n while w < 4\r\n if @nha2[i+w][j] == object\r\n counter =counter -1\r\n end\r\n w+=1\r\n end\r\n return counter\r\n end", "def check_color(guess)\n count = 0\n guess.upcase.chars.uniq.each do |char| \n if @secret_code.include? char\n count += 1 \n end\n end\n return count \n end", "def walkhigh(i,j,object)\r\n w=0\r\n counter =4\r\n while w < 4\r\n if @nha2[i][j+w] == object\r\n counter =counter -1\r\n end\r\n w+=1\r\n end\r\n return counter\r\n end", "def coll_1\n am_ents = Sketchup.active_model.entities\n s = 300\n f1 = [ 0, 0, 0 ] , [ 0, s, 0 ] , [ s, s, 0 ] , [ s, 0, 0 ]\n f2 = [ 0, 0, s ] , [ 0, s, s ] , [ s, s, s ] , [ s, 0, s ]\n puts \"am_ents.length = #{am_ents.length}\"\n am_ents.add_face( f1 )\n puts \"am_ents.length = #{am_ents.length}\"\n am_ents.add_face( f2 )\n puts \"am_ents.length = #{am_ents.length}\"\n end", "def value_of_hand(array_of_cards)\n faces = {\"A\" =>11,\n \"2\" => 2, \n \"3\" => 3,\n \"4\" => 4,\n \"5\" => 5,\n \"6\" => 6,\n \"7\" => 7,\n \"8\" => 8,\n \"9\" => 9,\n \"10\" => 10,\n \"J\" => 10,\n \"Q\" => 10,\n \"K\" => 10\n }\n total_value = 0\n num_aces = 0\n array_of_cards.each do |c|\n #cards are in string format, e.g. \"J of diamonds\"\n face = c.split[0]\n value = faces[face]\n total_value += value\n num_aces += 1 if face == \"A\"\n end\n #correct for Aces -- BORROWED THIS LOGIC FROM TEACHER'S CODE\n num_aces.times do\n total_value -= 10 if total_value > 21\n end\n return total_value\nend", "def face _args\n \"face _args;\" \n end", "def bigram_count()\n\t@corpus.each { |sentence_arr|\n\t prev_word = \"\"\n\t sentence_arr.each { |word|\n\t\tif(prev_word != \"\")\n\t\t @bifreq[prev_word + \" \" + word] += 1\n\t\telse\n\t\t @bifreq[\"PHI \"+word] += 1\n\t\tend \t \t\n\t\tprev_word = word\n\t }\n\t}\n end", "def count_blacks\r\n black_count = Hash.new(0)\r\n code.length.times { |i| black_count[code[i]] += 1 if code[i] == guess[i] } ## DRT\r\n black_sum = 0\r\n black_count.each { |k,v| black_sum += v }\r\n black_sum\r\n end", "def get_zigzag_flood_x(aface)\r\n result = []\r\n#@debug = true \r\n # create a 2D array to hold the rasterized shape\r\n # raster is on stepover boundaries and center of each square is where the zigzags will start and end.\r\n # set true for each centerpoint that is inside the face\r\n # raster 0,0 is bottom left of the shape, just outside the boundary\r\n bb = aface.bounds\r\n stepOverinuse = @bit_diameter * @stepOver\r\n ystart = bb.min.y - stepOverinuse / 2 # center of bottom row of cells\r\n yend = bb.max.y + stepOverinuse + 0.002\r\n \r\n xstart = bb.min.x - stepOverinuse / 2 # center of first column of cells\r\n xend = bb.max.x + stepOverinuse + 0.002 # MUST have a column after end of object else stuff gets skipped\r\n# if ($phoptions.use_fuzzy_pockets?) #always uses fuzzy, gives better results\r\n ylen = yend - ystart - 0.002\r\n stepOverinuse1 = getfuzzystepover(ylen)\r\n xlen = xend - xstart - 0.002\r\n stepOverinuse2 = getfuzzystepover(xlen)\r\n stepOverinuse = [stepOverinuse1, stepOverinuse2].min # always use lesser value\r\n# end\r\n debugfile(\"xstart #{xstart.to_mm},#{ystart.to_mm} #{xend.to_mm},#{yend.to_mm} #{stepOverinuse.to_mm}\" ) if (@debug)\r\n\r\n #use a hash as if it were a 2d array of cells rastered over the face\r\n if (@cells == nil)\r\n @cells = Hash.new(false)\r\n else\r\n @cells.clear\r\n end \r\n # now loop through all cells and test to see if this point is in the face\r\n pt = Geom::Point3d.new(0, 0, 0)\r\n xmax = ymax = 0.0\r\n#create the cell array \r\n createcellsX(xstart,xend, ystart,yend, stepOverinuse, aface) #creates cell hash and sets @cellxmax etc\r\n xmax = @cellxmax\r\n ymax = @cellymax\r\n \r\n entities = Sketchup.active_model.active_entities if (@debug)\r\n \r\n debugfile(\"xmax #{xmax} ymax #{ymax}\") if (@debug) # max cell index\r\n# puts \"xmax #{xmax} ymax #{ymax}\"\r\n#output array for debug \r\n if (@debug)\r\n y = ymax\r\n debugfile(\"START\") if (@debug)\r\n while (y >= 0) do\r\n x = 0\r\n s = \"y #{y}\"\r\n while (x <= xmax) do\r\n if (@cells[[x,y]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n x += 1\r\n end\r\n debugfile(s) if (@debug)\r\n y -= 1 \r\n end\r\n end\r\n \r\n # now create the zigzag points from the hash, search along Y for first and last points\r\n # keep track of 'going DOWN toward 0' or 'going UP' so we can test for a line that would cross the boundary\r\n # if this line would cross the boundary, start a new array of points\r\n r = 0\r\n prevpt = nil\r\n#@debug = true\r\n while (someleft(@cells,xmax,ymax)) # true if some cells are still not processed\r\n debugfile(\"R=#{r}\") if (@debug)\r\n result[r] = []\r\n x = 0\r\n goingright = true # goingUP\r\n px = -1 # previous x used, to make sure we do not jump a X level\r\n countx = 0\r\n while (x <= xmax) do\r\n countx += 1\r\n if (countx > 5000)\r\n puts \" countx break\"\r\n break\r\n end\r\n \r\n lefty = -1 # down\r\n y = 0\r\n while (y <= ymax) do # search to the right for a true\r\n if (@cells[[x,y]] == true)\r\n @cells[[x,y]] = false\r\n lefty = y\r\n break # found left side X val\r\n end\r\n y += 1\r\n end #while y\r\n righty = -1\r\n y += 1\r\n if y <= ymax \r\n while (y <= ymax) do # search to the right for a false\r\n if (@cells[[x,y]] == false)\r\n righty = y-1\r\n break # found right side X val\r\n end\r\n @cells[[x,y]] = false # set false after we visit\r\n y += 1\r\n end #while x\r\n end\r\n # now we have lefty and righty for this X, if righty > -1 then push these points\r\n debugfile(\" left #{lefty} right #{righty} y #{y}\") if (@debug)\r\n if (righty > -1)\r\n #if px,py does not cross any face edges\r\n# pt1 = Geom::Point3d.new(xstart + leftx*stepOverinuse, ystart + y * stepOverinuse, 0)\r\n# pt2 = Geom::Point3d.new(0, 0, 0)\r\n if (goingright)\r\n pt1 = Geom::Point3d.new(xstart + x * stepOverinuse, ystart + lefty * (stepOverinuse/2), 0)\r\n pt2 = Geom::Point3d.new(xstart + x * stepOverinuse, ystart + righty * (stepOverinuse/2), 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingUP #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n else\r\n if (px > -1)\r\n if ((x - px) > 1) # do not cross many x rows, start new set instead\r\n debugfile(\"isxrows goingUP #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n debugfile(\" R=#{r}\") if (@debug)\r\n prevpt = nil\r\n end\r\n end\r\n end\r\n end\r\n #check that this line does not cross something, happens on sharp vertical points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going up so create new point below cross\r\n np = Geom::Point3d.new(cross.x, cross.y - (stepOverinuse/2), 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the right of the crossing\r\n pt1 = Geom::Point3d.new(cross.x, cross.y + (stepOverinuse/2), 0)\r\n end\r\n \r\n entities.add_cpoint(pt1) if (@debug)\r\n result[r] << pt1\r\n pt = pt1\r\n if (lefty != righty)\r\n #pt = Geom::Point3d.new(xstart + rightx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt) if (@debug)\r\n else\r\n puts \"singleton #{x} #{y}\" if (@debug)\r\n end\r\n else\r\n #pt.x = xstart + rightx*stepOverinuse\r\n #pt.y = ystart + y * stepOverinuse\r\n pt1 = Geom::Point3d.new(xstart + x * stepOverinuse,ystart + righty*(stepOverinuse/2), 0)\r\n pt2 = Geom::Point3d.new(xstart + x * stepOverinuse,ystart + lefty *(stepOverinuse/2), 0)\r\n #if line from prevpt to pt crosses anything, start new line segment\r\n if (prevpt != nil)\r\n if (iscrossing(prevpt,pt1,aface) )\r\n debugfile(\"iscrossing goingleft #{x} #{y}\") if (@debug)\r\n prevpt = nil\r\n r += 1\r\n result[r] = []\r\n debugfile(\"iscrossing left R=#{r}\") if (@debug)\r\n else \r\n if (px > -1)\r\n if ((x - px) > 1) # do not cross many X rows\r\n debugfile(\"isyrows goingleft #{x} #{y}\") if (@debug)\r\n r += 1\r\n result[r] = []\r\n prevpt = nil\r\n debugfile(\"isyrows left R=#{r}\") if (@debug)\r\n end\r\n end\r\n end\r\n end\r\n \r\n #check that this vert line does not cross something, happens on sharp horozontal points\r\n if (iscrossing(pt1,pt2,aface))\r\n cross = wherecrossing(pt1,pt2,aface) # point where they cross\r\n #going left so create new point to the right of cross\r\n np = Geom::Point3d.new( cross.x,cross.y + stepOverinuse/2, 0)\r\n result[r] << pt1\r\n result[r] << np\r\n #start new line on other side of gap\r\n r += 1\r\n result[r] = []\r\n #create new pt1 to the left of the crossing\r\n pt1 = Geom::Point3d.new( cross.x, cross.y - stepOverinuse/2, 0)\r\n end\r\n \r\n result[r] << pt1\r\n pt = pt1\r\n entities.add_cpoint(pt1) if (@debug)\r\n #pt.x = xstart + leftx*stepOverinuse\r\n if (lefty != righty)\r\n# pt = Geom::Point3d.new(xstart + leftx*(stepOverinuse/2), ystart + y * stepOverinuse, 0)\r\n result[r] << pt2\r\n pt = pt2\r\n entities.add_cpoint(pt2) if (@debug)\r\n else\r\n puts \"Singleton #{x} #{y}\" if (@debug)\r\n end\r\n end\r\n prevpt = Geom::Point3d.new(pt.x, pt.y, 0)\r\n px = x\r\n end # if rightx valid\r\n x += 1\r\n goingright = !goingright\r\n end # while y\r\n \r\n #debug output\r\n if (@debug)\r\n if (someleft(@cells,xmax,ymax) )\r\n debugfile(\"someleft #{r}\") if (@debug)\r\n yc = ymax\r\n while (yc >= 0) do\r\n xc = 0\r\n s = \"Y #{yc}\"\r\n while (xc <= xmax) do\r\n if (@cells[[xc,yc]])\r\n s += \" 1\"\r\n else\r\n s += \" 0\"\r\n end\r\n xc += 1\r\n end\r\n debugfile(s) if (@debug)\r\n yc -= 1 \r\n end\r\n end\r\n end\r\n r += 1\r\n prevpt = nil\r\n end # while someleft \r\n@debug = false\r\n puts \" result #{result.length} #{result[0].length} \" if (@debug)\r\n debugfile(\"result #{result.length}\") if (@debug)\r\n result.each { |rs|\r\n debugfile(\" #{rs.length}\") if (@debug)\r\n }\r\n return result\r\n end", "def process(num_blacks, num_whites) \r\n if (!@zero_response_code_found)\r\n # we can only get blacks during this phase of all 4's same color however we will count them later during mask phase\r\n # keep track of number of exact matches\r\n if num_blacks > 0\r\n # save for later processing when we go to half/half mode\r\n @safe_array << @current_color\r\n #puts \"color_count[#{@current_color}] = #{@color_count[@current_color]}\"\r\n #puts \"AA\"\r\n else\r\n @zero_response_code_found = true\r\n @half_half_color = @current_color\r\n #puts \"BB\"\r\n end # if num_blacks\r\n else\r\n if @num_correct_colors_found < 4\r\n #puts \"SEARCHING FOR FINAL 4\"\r\n if @three_of_a_kind_check\r\n# need to worry about 3 and 4 of a kind scenario\r\n# during find zero-response phase - if we encounter 3 or 4 of a kind, we need to set a flag, perhaps my hash is doing that\r\n# or modify the hash.\r\n# but then the problem comes about after finding the zero-response, during the finding the half-half phase. during this\r\n# phase it is not possible to determine if there are 3 or 4 of a kind due to the arrangemnet of the pattern.\r\n# one way to solve this for both zero-response phase and half-half phase is by having another 3 of a kind safe array\r\n# if during zero-response phase, we encounter 4 of a kind. game will auto end?\r\n# if during zero-response phase, we encounter 3 of a kind, then submit color into three_of_a_kind array and into safe_array\r\n# to be used later by guess method. guess will normally count the 2 on the right side, but not count the left. the \r\n# three_of_a_kind array and the half_half_left mode will count the 1 remaining color of a three of a kind\r\n# if during half-half phase, we encounter 2 of a kind(specifically, 2 blacks, or 1 black/1 white, but not 2 whites, process\r\n# will normally count the 2 colors. However there is a chance that there is a 3rd occurrence of the color that we can not see\r\n# due to the half-half-right pattern. Therefore we need to add the color to the three_of_a_kind array which causes guess to\r\n# change the pattern to\r\n# [color, color, no-response-color, no-response-color]\r\n\r\n# process needs to compensate for double counting whites (only count blacks) during 3_of_a_kind_check and for double\r\n# counting doubles. (only count blacks when blacks+whites=3, whites have already been counted, and when blacks+whites==2,\r\n# this scenario has already been counted)\r\n\r\n# I need to save the state of the initial three_of_a_kind compare in order to determine how to count the three of a kind\r\n# correctly.\r\n #puts \"THREE OF A KIND CHECK IN PROCESS method\"\r\n previous_num_blacks, previous_num_whites = @half_half_result[@current_color]\r\n if previous_num_blacks == 2\r\n #puts \"PREVIOUS_NUM_BLACKS == 2\"\r\n @num_correct_colors_found += num_blacks\r\n num_blacks.times { @match_left << @current_color }\r\n elsif previous_num_blacks == 1 && previous_num_whites == 1\r\n # for this case we need to make sure we don't double count\r\n #puts \"PREV BLACKS==1 && PREV WHITES==1\"\r\n if num_blacks == 2\r\n @num_correct_colors_found += 1\r\n @match_left << @current_color\r\n end\r\n end\r\n #puts \"Num of blacks = #{num_blacks} Previous num blacks = #{previous_num_blacks}\"\r\n #puts \"Num of whites = #{num_whites} Previous num whites = #{previous_num_whites}\"\r\n # always get out of three of a kind mode\r\n @three_of_a_kind_check = false\r\n\r\n else # if @three_of_a_kind_check\r\n # add to running total of found numbers so we can get to next phase of algo\r\n @num_correct_colors_found += (num_blacks + num_whites) ##### THIS WILL NEED TO CHANGE WHEN THREE OF A KIND LOGIC ADDED\r\n\r\n # following section is used in half-half section either by processing\r\n # new colors or by processing old colors from the safe array\r\n # if found blacks we found it on the right and update color_count for current_color\r\n # officially counting blacks and whites are only done while in half-half mode\r\n # note that safe_array take dequeue priority when it is not empty. see guess above\r\n if num_blacks > 0\r\n num_blacks.times { @match_right << @current_color } \r\n end\r\n # if found whites we found it on the left and update color_count for current_color \r\n if num_whites > 0\r\n num_whites.times { @match_left << @current_color } \r\n end \r\n # this info is necessary when doing the reverse half_half compare to see if there are three/four of a kind\r\n @half_half_result[@current_color] = [num_blacks, num_whites]\r\n # during this phase we can't know if there are 2 or 3 of the current color, so we need to do a reverse_half_half\r\n # check if there are 2 blacks or (1 black + 1 white)\r\n @three_of_a_kind_check_array << @current_color if (num_blacks == 2 || (num_blacks==1 && num_whites==1))\r\n #puts \"CC\"\r\n end # if @three_of_a_kind_mode else\r\n else\r\n # Scenarios are as follows for final code\r\n # L1,L2,R1,R2 \r\n # (4W) -> L2,L1,R2,R1\r\n # (2W2B) -> L1,L2,R2,R1 or L2,L1,R1,R2\r\n # (0W) -> pattern found\r\n #puts \"DD\"\r\n @final_four_whites = num_whites # used by guess\r\n\r\n end\r\n\r\n end # if !@zero_response...\r\n\r\n end", "def analyze\n @hits.times do\n @guesses << @last_guess unless @guesses.length == 4\n end\n end", "def analyze\n @hits.times do\n @guesses << @last_guess unless @guesses.length == 4\n end\n end", "def fish_count()\n return @fish.length()\n end", "def cows\n (@arr & @guess_num).size\n end", "def add_face indices\n faces << indices.map(&:to_i)\n end", "def happy_unhappy_unhappiness\n # The distance between 'i' and 'y' is 0.5. The distance between and two\n # other non-equal phone pairs is 1. This ensures that 'i' and 'y' will tend\n # align with each other.\n happy_unhappy_phones =<<-EOTEXT\n FORM, LETTER, CLASS\n i, i, iy\n y, y, iy\n a, a, a\n e, e, e\n h, h, h\n n, n, n\n p, p, p\n s, s, s\n u, u, u\n EOTEXT\n phone_table = PhoneticAlign::PhoneTable.new(happy_unhappy_phones)\n # Phonetic sequences\n # Meanings\n un_meaning = PhoneticAlign::FeatureValueMatrix[:POL => :neg]\n happy_meaning = PhoneticAlign::FeatureValueMatrix[:LEMMA => :happy]\n ness_meaning = PhoneticAlign::FeatureValueMatrix[:POS => :noun]\n # Morphemes\n un_morph = PhoneticAlign::SurfaceMorpheme.new(un_meaning, phone_table.phone_sequence(\"un\"))\n happy_morph = PhoneticAlign::SurfaceMorpheme.new(happy_meaning, phone_table.phone_sequence(\"happy\"))\n happy_happi_morph = PhoneticAlign::SurfaceMorpheme.new(happy_meaning, phone_table.phone_sequence(\"happi\"), \n [phone_table.phone_sequence(\"happy\"),\n phone_table.phone_sequence(\"happi\")])\n ness_morph = PhoneticAlign::SurfaceMorpheme.new(ness_meaning, phone_table.phone_sequence(\"ness\"))\n # Words consisting of all phones.\n happy_p = PhoneticAlign::Word.new(phone_table.phone_sequence(\"happy\"), happy_meaning)\n unhappy_p = PhoneticAlign::Word.new(phone_table.phone_sequence(\"unhappy\"), un_meaning + happy_meaning)\n unhappiness_p = PhoneticAlign::Word.new(phone_table.phone_sequence(\"unhappiness\"), un_meaning + happy_meaning + ness_meaning)\n # Words consisting of phones and morphemes.\n unhappy_pm = PhoneticAlign::Word.new([un_morph] + phone_table.phone_sequence(\"happy\"), un_meaning + happy_meaning)\n # Words consisting of all morphemes\n happy_m = PhoneticAlign::Word.new([happy_morph], happy_meaning)\n unhappy_m = PhoneticAlign::Word.new([un_morph, happy_morph], un_meaning + happy_meaning)\n happy_happi_ness_m = PhoneticAlign::Word.new([happy_happi_morph, ness_morph], happy_meaning)\n unhappy_happi_ness_m = PhoneticAlign::Word.new([un_morph, happy_happi_morph, ness_morph], un_meaning + happy_meaning + ness_meaning)\n return Struct.new(:phone_table,\n :happy_p, :unhappy_p, :unhappiness_p,\n :unhappy_pm,\n :happy_m, :unhappy_m, :happy_happi_ness_m, :unhappy_happi_ness_m,\n :un_meaning, :happy_meaning, :ness_meaning).new(\n phone_table,\n happy_p, unhappy_p, unhappiness_p,\n unhappy_pm,\n happy_m, unhappy_m, happy_happi_ness_m, unhappy_happi_ness_m,\n un_meaning, happy_meaning, ness_meaning)\nend", "def main(args)\n expectedArgs = 1\n helpMessage = \"Usage\\nlef_layer_blockage_count.rb input_lef [layer_name]\\n\"\n helpMessage << \"Default [layer_name] is VI1\\n\" \n if (args.size<expectedArgs)\n puts helpMessage\n abort\n end\n\n layer_name = \"VI1\"\n lef_file = args.shift\n if args.length>0\n layer_name = args.shift\n end\n\n\n # Header\n puts \"cell_name,#{layer_name}_blockage_count\"\n # Open a file and parse some stuff\n infile = File.open(lef_file,\"r\")\n lines = infile.readlines\n infile.close\n cntr=0\n layer_count=0\n in_obs = false\n in_obs_layer = false\n cell_layer_count = Hash.new()\n while cntr<(lines.length-1)\n line=lines[cntr]\n # Get cell name\n if line=~/^\\s*MACRO\\s+(\\w+)\\s*$/\n cell = $1\n layer_count=0\n # Look for obstruction\n elsif line=~/^\\s*OBS\\s*$/\n in_obs = true\n # Look for layers and get a count\n elsif in_obs && line=~/^\\s*LAYER\\s+#{layer_name}\\s*;/\n in_obs_layer = true\n #keep processinga all the layers and look for the end of the layers\n while in_obs_layer\n cntr+=1\n line=lines[cntr]\n if (line=~/^\\s*LAYER\\s+/) \n in_obs_layer = false\n elsif (line=~/^\\s*END\\s*$/)\n in_obs = false\n in_obs_layer = false\n else\n layer_count+=1\n end\n end\n cell_layer_count[cell]=layer_count\n puts \"#{cell},#{layer_count}\"\n # Look for end of obs\n elsif in_obs && (line=~/^\\s*END\\s*$/)\n in_obs = false\n end\n cntr+=1\n end\nend", "def faceify(opts)\n opts[:face] = (opts[:face].to_s.downcase == 'right')\n opts\n end", "def turn_count\n self.cells.reject{|cell| cell.include?(\" \")}.count\n end", "def conta_vicini(i,j,game)\n vicini = 0\n \n #### BORDI RIGIDI\n #if i > 0\n # vicini += 1 if game[:griglia][i-1][j]\n #end\n #if i > 0 && j > 0\n # vicini += 1 if game[:griglia][i-1][j-1]\n #end\n #if i > 0 && j < CELLE_PER_RIGA\n # vicini += 1 if game[:griglia][i-1][j+1]\n #end\n #if j > 0\n # vicini += 1 if game[:griglia][i][j-1]\n #end\n #if j < CELLE_PER_RIGA-1\n # vicini += 1 if game[:griglia][i][j+1]\n #end\n #if i < CELLE_PER_COLONNA-1 && j > 0\n # vicini += 1 if game[:griglia][i+1][j-1]\n #end\n #if i < CELLE_PER_COLONNA-1\n # vicini += 1 if game[:griglia][i+1][j]\n #end\n #if i < CELLE_PER_COLONNA-1 && j < CELLE_PER_RIGA-1\n # vicini += 1 if game[:griglia][i+1][j+1]\n #end\n \n #======================================================\n ### BORDI RICORSIVI\n i += CELLE_PER_COLONNA if i-1 < 0\n j += CELLE_PER_RIGA if j-1 < 0\n i -= CELLE_PER_COLONNA if i+1 >= CELLE_PER_COLONNA\n j -= CELLE_PER_RIGA if j+1 >= CELLE_PER_RIGA\n \n vicini += 1 if game[:griglia][i-1][j]\n vicini += 1 if game[:griglia][i-1][j-1]\n vicini += 1 if game[:griglia][i-1][j+1]\n vicini += 1 if game[:griglia][i][j-1]\n vicini += 1 if game[:griglia][i][j+1]\n vicini += 1 if game[:griglia][i+1][j-1]\n vicini += 1 if game[:griglia][i+1][j]\n vicini += 1 if game[:griglia][i+1][j+1]\n \n return vicini\nend", "def identify\n \n return if @value > 0 # no need to do it twice!\n return if @cards.size < 5 # need at least 5 cards\n \n @cards.sort!\n \n #puts \"@total_face_value = #{@total_face_value}\"\n \n if is_flush? then \n #puts 'have a flush of some kind...' \n \n if @total_face_value == 60 then\n #puts \"it's a royal flush!\"\n @rank = ROYAL_FLUSH\n @value = @cards.max.face_value\n return\n end\n \n if is_straight? then\n #puts \"it's straight flush!\"\n @rank = STRAIGHT_FLUSH\n @value = @cards.max.face_value\n return\n end\n \n #puts \"it's a regular flush!\"\n @rank = FLUSH\n @value = @cards.max.face_value\n return\n end\n \n #puts 'not a flush'\n \n if is_straight? then\n #puts \"it's a straight!\"\n @rank = STRAIGHT\n @value = @cards.max.face_value\n return\n end\n \n # look for pairs\n (pairs, @unpaired_cards) = find_pairs()\n if pairs.empty? then\n # high card!\n #puts \"high card \" + high_card.to_s\n @rank = HIGH_CARD\n @value = @cards.max.face_value\n return\n end\n \n if pairs.size == 1 then\n paired_cards = pairs[0].size\n @value = pairs[0].max.face_value\n if paired_cards == 2 then\n #puts \"it's a single pair!\"\n @rank = PAIR\n elsif paired_cards == 3 then\n #puts \"it's a three of a kind!\"\n @rank = THREE_KIND\n elsif paired_cards == 4 then\n @rank = FOUR_KIND\n end\n return\n \n elsif pairs.size == 2 then\n paired_cards = pairs[0].size + pairs[1].size\n a = pairs[0].max.face_value\n b = pairs[1].max.face_value\n if a > b then\n @value = a\n elsif b > a then\n @value = b\n else\n # should never happen since it means the\n # pairs are of the same face value\n # e.g., two pairs of 6s\n @value = a\n end\n if paired_cards == 4 then\n #puts \"it's two pair!\"\n @rank = TWO_PAIR\n elsif paired_cards == 5 then\n #puts \"it's a full house!\"\n @rank = FULL_HOUSE\n # add faces of each pair for value\n if a > b then\n @value = a * 100 + b\n elsif b > a then\n @value = b * 100 + a\n end\n end\n return\n \n end\n \n # should never get here\n raise \"oh no, should never have come to this!\"\n \n end", "def jewels_and_stones(j,s)\n\n if (s == nil || s.length < 1 || j == nil || j.length < 1)\n return 0\n end\n\n hash = Hash.new\n\n j.each_char do |char|\n hash[char] = 1\n end\n\n count = 0\n s.each_char do |char|\n if (hash[s[char]] == 1)\n count = count + 1\n end\n end\n return count\n\nend", "def iterate_for_backfaces(mat, entity_list)\r\n for e in entity_list\r\n if e.class == Sketchup::Group\r\n iterate_for_backfaces(mat, e.entities)\r\n end\r\n if e.class == Sketchup::ComponentInstance\r\n if $g_backfaces_instances[e.definition] == nil or mat == nil\r\n $g_backfaces_instances[e.definition] = true\r\n iterate_for_backfaces(mat, e.definition.entities)\r\n end\r\n end\r\n if e.class == Sketchup::Face\r\n if mat==nil\r\n if e.material == Sketchup.active_model.materials[\"Backfaces\"]\r\n e.material = $g_backfaces[e]\r\n end\r\n if e.back_material == Sketchup.active_model.materials[\"Backfaces\"]\r\n e.back_material = $g_backfaces[e]\r\n end\r\n else\r\n $g_backfaces[e]=e.back_material\r\n e.back_material = mat\r\n end\r\n end\r\n end\r\nend", "def detect_faces(image)\n @detector ||= OpenCV::CvHaarClassifierCascade::load(HAARCASCADE_CONFIG_PATH)\n @detector.detect_objects(image).map { |rect| image.sub_rect(rect) }\n end", "def count_of_hufflepuff(values)\n count = 0\n values.each do |house| \n if house[2] == \"Hufflepuff\"\n count += 1\n end\n end\n puts \"There are #{count} Hufflepuffs!\"\nend" ]
[ "0.7118032", "0.6936785", "0.6496086", "0.60318416", "0.60110873", "0.58371985", "0.58162344", "0.5764312", "0.5764312", "0.5638524", "0.56019145", "0.55512035", "0.5549019", "0.55447537", "0.5506901", "0.54708034", "0.5418709", "0.54167885", "0.54089683", "0.540799", "0.54002225", "0.5387668", "0.5376007", "0.5336987", "0.53178906", "0.53166765", "0.53084224", "0.53084093", "0.53060436", "0.5300898", "0.52758616", "0.5268131", "0.5267774", "0.5260567", "0.52559185", "0.5249957", "0.5244192", "0.5239196", "0.52324027", "0.52260906", "0.52144754", "0.52120876", "0.51812065", "0.51808965", "0.517938", "0.51790273", "0.5169876", "0.5168677", "0.51664", "0.5164189", "0.51472986", "0.513608", "0.5129667", "0.51227474", "0.51185465", "0.5113519", "0.51075053", "0.51066583", "0.50968313", "0.5094617", "0.5093093", "0.5074444", "0.50652415", "0.5060871", "0.5060668", "0.5058878", "0.5048969", "0.503319", "0.50310194", "0.5027271", "0.5025149", "0.50248283", "0.50165147", "0.50099266", "0.5009337", "0.49785644", "0.49784234", "0.49675727", "0.4961655", "0.49551013", "0.49547717", "0.49493033", "0.49413812", "0.49413136", "0.4940561", "0.4933917", "0.4933917", "0.49302745", "0.4928914", "0.49263117", "0.49204162", "0.4916132", "0.49126288", "0.491108", "0.48939666", "0.48938993", "0.48894006", "0.4889209", "0.4877509", "0.48670238" ]
0.81330156
0
Show the new movie form
def new @movie = Movie.new @actors = Actor.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\n # Create an instance variable for the form_for helper\n @movie = Movie.new\n\n # by default we render app/views/movies/new.html.erb\n end", "def new\n @movie = Movie.find(params[:movie_id])\n end", "def new\n @movie = Movie.new\n end", "def new\n @movie = Movie.new\n end", "def new\n @movie = Movie.new\n end", "def new\t\t\n\t\t@movie = Movie.new\n\tend", "def new\n @movie = Movie.new\nend", "def new\n @movie = Movie.new\n end", "def create\n @movie = Movie.new(movie_params)\n if @movie.save\n flash[:notice] = \"#{@movie.title} was successfully created.\"\n redirect_to movies_path\n else\n # Create failed, re-render the form\n render 'new'\n end\n end", "def new\n @channel = params[:forminfo]\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n if @movie.save\n redirect_to movies_path, notice: \"#{@movie.title} was submitted successfully!\"\n else\n render :new\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie_info = MovieInfo.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie_info }\n end\n end", "def create\n # Create a new movie instance that will be used in the form:\n @movie = Movie.new(movie_params);\n\n if(@movie.save)\n # Present a 1-time flash message to the user after redirect:\n flash[:notice] = \"Movie created successfully.\";\n\n # If saved to DB successfully, go to show page:\n redirect_to @movie;\n else\n # If validations prevented save, reload form (with error message):\n render 'new';\n end\n end", "def new\n @cinemas_movie = CinemasMovie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @cinemas_movie }\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n \n if @movie.save\n redirect_to index_url\n flash[:success] = \"Movie was successfully created.\" \n\n else\n render 'new'\n \n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def create\n new_movie = Movie.new\n\n new_movie.title = params[:title]\n new_movie.year = params[:year]\n new_movie.director = params[:director]\n new_movie.actors = params[:cast_members]\n new_movie.plot = params[:plot]\n new_movie.mpaa_rating = params[:mpaa_rating]\n new_movie.favorite = params[:favorite]\n new_movie.save\n\n redirect_to new_movie\n end", "def new\n @bollywood_movie = BollywoodMovie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @bollywood_movie }\n end\n end", "def new\n @users_movie = UsersMovie.new\n @users_movie.build_movie\n end", "def new\n @video = Video.new\n @title = \"Video Submission\"\n \n @url = params[:url]\n \n respond_to do |format|\n format.html # new.html.erb\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to movie_url(@movie), notice: \"Movie was successfully created.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n end\n end\n end", "def new\n\t\t@adminfilm = Film.new\n\tend", "def new\n @film = @festival.films.new\n \n respond_to do |format|\n format.html { raise NonAjaxEditsNotSupported }\n format.js # new.rjs\n format.xml { render :xml => @film }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.js\n format.xml { render :xml => @movie }\n end\n end", "def new\n @watched_movie = WatchedMovie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @watched_movie }\n end\n end", "def new\n @unseen_movie = UnseenMovie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unseen_movie }\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n @movie\n end", "def create\n @movie = Movie.new(movie_params)\n end", "def create\n @movie = Movie.new(movie_params)\n end", "def new\n @role_in_a_movie = RoleInAMovie.new\n\n redirect_to root_path, :notice => \"You are not supposed to view this page.\"\n end", "def add_movie\n @movie = Tmdb::Movie.detail(params['id'])\n @movie_director = Tmdb::Movie.director(@movie.id)[0].name\n\n @new_movie = Movie.create(\n title: @movie.title,\n release_date: @movie.release_date,\n director: @movie_director,\n overview: @movie.overview,\n poster_url: \"https://image.tmdb.org/t/p/w640#{@movie.poster_path}\"\n )\n\n redirect_to movie_path(@new_movie), notice: \"#{@new_movie.title} was added.\"\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'La pelicula ha sido creada correctamente.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n @title = 'Movie details + | ' + @movie.title\n end", "def new\n @movie_list = MovieList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie_list }\n end\n end", "def new\n @movie = @school.movies.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie_format = MovieFormat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie_format }\n end\n end", "def new\n @page_title = 'Create Army'\n respond_to do |format|\n format.html # render new.html.erb\n end\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n end", "def new\n @movie = @category.movies.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def show\n\t\tid = params[:id];\t\t\t\t#get the movie id\n\t\t@movie = Movie.find_by_id(id) \t#get the movie from the database\n\tend", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html {redirect_to @movie, notice: 'Movie was successfully created.'}\n format.json {render :show, status: :created, location: @movie}\n else\n format.html {render :new}\n format.json {render json: @movie.errors, status: :unprocessable_entity}\n end\n end\n end", "def new\n @channel = params[:forminfo]\n @video = Video.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @video }\n end\n end", "def new\n @movie_item = MovieItem.new\n\t\tredirect_to root_path, :notice => \"You are not supposed to view this page.\"\n# respond_to do |format|\n# format.html # new.html.erb\n# format.json { render json: @movie_item }\n# end\n end", "def new\t\n\t@award = MovieAward.new()\n @movie_id = params[:movie]\n @artist_id = params[:artist]\n @award_cat_id = params[:award_cat]\n @year = params[:year] ?params[:year] : \"1900\" \n\n logger.info 'FINDME message'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @award }\n end\n end", "def create\n allowed_params = movie_params\n allowed_params[:genres] = [allowed_params[:genres]]\n allowed_params[:video_quality] = [allowed_params[:video_quality]]\n @movie = Movie.new(allowed_params)\n @movie.created_by = current_user\n\n if @movie.save\n redirect_to @movie\n else\n render :new\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to(@movie, :notice => 'Movie was successfully created.') }\n format.xml { render :xml => @movie, :status => :created, :location => @movie }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def maker\n show \n end", "def create\n @genres_movie = GenresMovie.new(genres_movie_params)\n\n respond_to do |format|\n if @genres_movie.save\n format.html { redirect_to @genres_movie, notice: 'Genres movie was successfully created.' }\n format.json { render :show, status: :created, location: @genres_movie }\n else\n format.html { render :new }\n format.json { render json: @genres_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @movie_list_item = MovieListItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie_list_item }\n end\n end", "def show\n @imdb_movie = Movie.find(params[:id])\n end", "def show\n @movie = Movie.find(params[:id])\n respond_to do |format|\n format.html #show.html.erb\n\tend\n end", "def create\n @reeview = Reeview.new(reeview_params)\n @reeview.user_id = current_user.id\n @reeview.movie_id = @movie.id\n\n if @reeview.save\n redirect_to @movie\n else\n render 'new'\n end\n end", "def create\n @movie_show = MovieShow.new(movie_show_params)\n\n respond_to do |format|\n if @movie_show.save\n format.html { redirect_to @movie_show, notice: \"Movie show was successfully created.\" }\n format.json { render :show, status: :created, location: @movie_show }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @movie_show.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @album = Album.new\n @genres = Genre.find(:all, :order => \"name\")\n @artists = Artist.find(:all, :order => \"name\")\n @movies = Movie.find(:all, :order => \"name\")\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @album }\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to root_path, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @stay_in = \"Thêm Mới Phim\"\n @admin_movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_movie }\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def show\n # check if movie is already saved to db, otherwise load from moviedb api\n if Movie.exists?(params[:id])\n p 'exists'\n @movie = Movie.find(params[:id])\n else\n p 'doesn\\'t exists'\n @movie = Movie.create_from_tmdb params[:id]\n end\n end", "def new\n @users_movie = UsersMovie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @users_movie }\n format.fbml\n end\n end", "def show; @video.show; end", "def show\n id = params[:id]\n @movie = Movie.find(id)\n end", "def show\n id = params[:id]\n @movie = Movie.find(id)\n end", "def new\n @video = Video.new\n p params\n @video.title = params[:title] if params[:title]\n @video.url = params[:url] if params[:url]\n @video.image_url = params[:image_url] if params[:image_url]\n @video.active = params[:active] if params[:active]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @video }\n end\n end", "def show\n @movie = Movie.find(params[:id])\n\n unless @movie.omdb_checked_date && 6.months.since(@movie.omdb_checked_date) < Date.current\n Omdb.info(@movie)\n end\n\n unless @movie.tmdb_checked_date && 6.months.since(@movie.tmdb_checked_date) < Date.current\n TmdbWrapper.info(@movie)\n end\n\n # Guidebox turn off\n # unless @movie.guidebox_checked_date && 1.month.since(@movie.guidebox_checked_date) < Date.current\n # @sources = Guidebox.sources(@movie)\n # end\n\n @movie.reload\n\n render :show, layout: false\n end", "def new\n begin\n @active_page = \"videos\"\n @video = Video.new\n respond_with(@video)\n rescue Exception => e\n log_error(e, \"Error occured in New action of VideosController\")\n flash_error(t('videos.new_page_load_error'))\n end\n end", "def set_movie\n @movie = Movie.find(params[:id])\n redirect_to movies_path, alert: 'Il film non è stato trovato' unless @movie\n end", "def new\n @video = Video.new\n end", "def new\n @video = Video.new\n end", "def new\n @video = Video.new\n end", "def new\n @video = Video.new\n end" ]
[ "0.7567354", "0.733482", "0.7243992", "0.7243992", "0.7243992", "0.7195505", "0.7176323", "0.7086204", "0.70391816", "0.6888926", "0.68814903", "0.6859921", "0.6859921", "0.6859921", "0.6859921", "0.6859921", "0.6859921", "0.6859921", "0.6859921", "0.6859921", "0.6846886", "0.68462527", "0.68381286", "0.6820213", "0.67886406", "0.67886406", "0.67886406", "0.67886406", "0.6742905", "0.6730388", "0.67069405", "0.6692088", "0.66867566", "0.6686655", "0.66824305", "0.66751206", "0.6650091", "0.662871", "0.6612309", "0.65724355", "0.65724355", "0.65515155", "0.65437543", "0.65418184", "0.64960366", "0.64686924", "0.64681107", "0.64596415", "0.64466476", "0.64417636", "0.64417636", "0.64417636", "0.6435907", "0.6426057", "0.6417502", "0.6417502", "0.6416846", "0.6416846", "0.6416846", "0.6416846", "0.6416846", "0.6416846", "0.6416846", "0.6416846", "0.6416846", "0.6416301", "0.6365409", "0.63634694", "0.6360294", "0.6359956", "0.6354436", "0.6352131", "0.6347056", "0.6346616", "0.63275224", "0.63261014", "0.6323214", "0.6322289", "0.63188285", "0.63109946", "0.63080925", "0.6300587", "0.62941676", "0.62941676", "0.62941676", "0.62941676", "0.62941676", "0.62892354", "0.62630165", "0.6252694", "0.6250802", "0.6250802", "0.62362206", "0.6235936", "0.62344295", "0.622978", "0.6229672", "0.6229672", "0.6229672", "0.6229672" ]
0.68256193
23
Create a new movie with given info from 'new' form and redirect to movies page on success.
def create @movie = Movie.new(movie_params) title = @movie.title title = title.split(' ') title = title.map { |word| word.downcase} title = title.map { |word| word.capitalize} newTitle = "" title.each_with_index { |v,i| if i == title.length - 1 then newTitle += v else newTitle += v + ' ' end } @movie.title = newTitle if @movie.save flash[:notice] = "#{@movie.title} was successfully created." @project = Project.new(actor_params) @project.movie_id = Movie.last.id @project.save redirect_to movies_path else # Create failed, re-render the form render 'new' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @movie = Movie.new(movie_params)\n\n if @movie.save\n redirect_to movies_path, notice: \"#{@movie.title} was submitted successfully!\"\n else\n render :new\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to movie_url(@movie), notice: \"Movie was successfully created.\" }\n else\n format.html { render :edit, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n \n if @movie.save\n redirect_to index_url\n flash[:success] = \"Movie was successfully created.\" \n\n else\n render 'new'\n \n end\n end", "def create\n # Create a new movie instance that will be used in the form:\n @movie = Movie.new(movie_params);\n\n if(@movie.save)\n # Present a 1-time flash message to the user after redirect:\n flash[:notice] = \"Movie created successfully.\";\n\n # If saved to DB successfully, go to show page:\n redirect_to @movie;\n else\n # If validations prevented save, reload form (with error message):\n render 'new';\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html {redirect_to @movie, notice: 'Movie was successfully created.'}\n format.json {render :show, status: :created, location: @movie}\n else\n format.html {render :new}\n format.json {render json: @movie.errors, status: :unprocessable_entity}\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'La pelicula ha sido creada correctamente.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n new_movie = Movie.new\n\n new_movie.title = params[:title]\n new_movie.year = params[:year]\n new_movie.director = params[:director]\n new_movie.actors = params[:cast_members]\n new_movie.plot = params[:plot]\n new_movie.mpaa_rating = params[:mpaa_rating]\n new_movie.favorite = params[:favorite]\n new_movie.save\n\n redirect_to new_movie\n end", "def create\n @movie = Movie.new(movie_params)\n if @movie.save\n flash[:notice] = \"#{@movie.title} was successfully created.\"\n redirect_to movies_path\n else\n # Create failed, re-render the form\n render 'new'\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to(@movie, :notice => 'Movie was successfully created.') }\n format.xml { render :xml => @movie, :status => :created, :location => @movie }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n @movie\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to root_path, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_movie\n @movie = Tmdb::Movie.detail(params['id'])\n @movie_director = Tmdb::Movie.director(@movie.id)[0].name\n\n @new_movie = Movie.create(\n title: @movie.title,\n release_date: @movie.release_date,\n director: @movie_director,\n overview: @movie.overview,\n poster_url: \"https://image.tmdb.org/t/p/w640#{@movie.poster_path}\"\n )\n\n redirect_to movie_path(@new_movie), notice: \"#{@new_movie.title} was added.\"\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params_create)\n respond_to do |format|\n if @movie.save\n format.html { redirect_to user_list_movies_url, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie_info = MovieInfo.new(params[:movie_info])\n \n respond_to do |format|\n if @movie_info.save\n format.html { redirect_to @movie_info, notice: 'Movie info was successfully created.' }\n format.json { render json: @movie_info, status: :created, location: @movie_info }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie_info.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n prepare_movie(true)\n \n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @theatre_movie = TheatreMovie.new(theatre_movie_params)\n\n respond_to do |format|\n if @theatre_movie.save\n format.html { redirect_to @theatre_movie, notice: 'Theatre movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @theatre_movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @theatre_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = current_user.movies.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = @category.movies.new(params[:movie])\n\n respond_to do |format|\n if @movie.save\n flash[:notice] = 'Movie was successfully created.'\n format.html { redirect_to(category_movie_url(@category, @movie)) }#, notice: 'Movie was successfully created.' }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tmdbmovie = Tmdbmovie.new(tmdbmovie_params)\n\n respond_to do |format|\n if @tmdbmovie.save\n format.html { redirect_to @tmdbmovie, notice: 'Tmdbmovie was successfully created.' }\n format.json { render :show, status: :created, location: @tmdbmovie }\n else\n format.html { render :new }\n format.json { render json: @tmdbmovie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @actors_movie = ActorsMovie.new(actors_movie_params)\n\n respond_to do |format|\n if @actors_movie.save\n format.html { redirect_to @actors_movie, notice: 'Actors movie was successfully created.' }\n format.json { render :show, status: :created, location: @actors_movie }\n else\n format.html { render :new }\n format.json { render json: @actors_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @theatre_movie = TheatreMovie.new(theatre_movie_params)\n\n respond_to do |format|\n if @theatre_movie.save\n format.html { redirect_to @theatre_movie, notice: 'Theatre movie was successfully created.' }\n format.json { render :show, status: :created, location: @theatre_movie }\n else\n format.html { render :new }\n format.json { render json: @theatre_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @omdb_movie = OmdbMovie.new(omdb_movie_params)\n\n respond_to do |format|\n if @omdb_movie.save\n format.html { redirect_to @omdb_movie, notice: 'Omdb movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @omdb_movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @omdb_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n allowed_params = movie_params\n allowed_params[:genres] = [allowed_params[:genres]]\n allowed_params[:video_quality] = [allowed_params[:video_quality]]\n @movie = Movie.new(allowed_params)\n @movie.created_by = current_user\n\n if @movie.save\n redirect_to @movie\n else\n render :new\n end\n end", "def create\n @movie = Movie.new({:name => params[:movie][:name], :rating => 0})\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to(@movie, :notice => 'Movie was successfully created.') }\n format.xml { render :xml => @movie, :status => :created, :location => @movie }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @genres_movie = GenresMovie.new(genres_movie_params)\n\n respond_to do |format|\n if @genres_movie.save\n format.html { redirect_to @genres_movie, notice: 'Genres movie was successfully created.' }\n format.json { render :show, status: :created, location: @genres_movie }\n else\n format.html { render :new }\n format.json { render json: @genres_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @playlist_movie = PlaylistMovie.new(movie_params)\n respond_to do |format|\n if @playlist_movie.save\n format.html { redirect_to playlist_path(@playlist_movie.playlist_id), notice: 'Movie was successfully added to your playlist.' }\n format.json { render action: 'show', status: :created, location: @playlist_movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @playlist_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cinemas_movie = CinemasMovie.new(params[:cinemas_movie])\n\n respond_to do |format|\n if @cinemas_movie.save\n format.html { redirect_to @cinemas_movie, :notice => 'Cinemas Movie was successfully created.' }\n format.json { render :json => @cinemas_movie, :status => :created, :location => @cinemas_movie }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @cinemas_movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def new\t\t\n\t\t@movie = Movie.new\n\tend", "def create\n @movie_model = MovieModel.new(movie_model_params)\n\n respond_to do |format|\n if @movie_model.save\n format.html { redirect_to @movie_model, notice: 'Movie model was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie_model }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie_model.errors, status: :unprocessable_entity }\n end\n end\n end", "def new_movie(movie_name, info = nil)\n movie = Movie.find_or_create_by(name: movie_name, info: info)\n movie_list.find_or_create_by(user_id: self.id, movie_id: movie.id)\n end", "def create\n @movie = Movie.new(movie_params)\n\n @movie.user_id = current_user.id # authenticated user\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie_crew = MovieCrew.new(movie_crew_params)\n\n respond_to do |format|\n if @movie_crew.save\n format.html { redirect_to @movie_crew, notice: \"Movie crew was successfully created.\" }\n format.json { render :show, status: :created, location: @movie_crew }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @movie_crew.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n end", "def create\n @movie = Movie.new(movie_params)\n end", "def create\n # @movie just a varible\n # current_user.movies it goes to the list of movies for the user and add a new movie\n @movie = current_user.movies.new(movie_params)\n @movie.save\n\n #this will redirectited to the index \n redirect_to movies_path(@movie)\n end", "def create\n @unseen_movie = UnseenMovie.new(params[:unseen_movie])\n\n respond_to do |format|\n if @unseen_movie.save\n format.html { redirect_to @unseen_movie, notice: 'Unseen movie was successfully created.' }\n format.json { render json: @unseen_movie, status: :created, location: @unseen_movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @unseen_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @type_movie = TypeMovie.new(type_movie_params)\n\n respond_to do |format|\n if @type_movie.save\n format.html { redirect_to @type_movie, notice: 'Type movie was successfully created.' }\n format.json { render :show, status: :created, location: @type_movie }\n else\n format.html { render :new }\n format.json { render json: @type_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie = Movie.new(movie_params)\n @movie.user = current_user if current_user\n add_director\n add_actors\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @reeview = Reeview.new(reeview_params)\n @reeview.user_id = current_user.id\n @reeview.movie_id = @movie.id\n\n if @reeview.save\n redirect_to @movie\n else\n render 'new'\n end\n end", "def create\n @bollywood_movie = BollywoodMovie.new(params[:bollywood_movie])\n\n respond_to do |format|\n if @bollywood_movie.save\n format.html { redirect_to @bollywood_movie, :notice => 'Bollywood movie was successfully created.' }\n format.json { render :json => @bollywood_movie, :status => :created, :location => @bollywood_movie }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @bollywood_movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @watched_movie = WatchedMovie.new(params[:watched_movie])\n\n respond_to do |format|\n if @watched_movie.save\n format.html { redirect_to @watched_movie, notice: 'Watched movie was successfully created.' }\n format.json { render json: @watched_movie, status: :created, location: @watched_movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @watched_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cinema_movie = CinemaMovie.new(cinema_movie_params)\n\n respond_to do |format|\n if @cinema_movie.save\n format.html { redirect_to @cinema_movie, notice: 'Cinema movie was successfully created.' }\n format.json { render :show, status: :created, location: @cinema_movie }\n else\n format.html { render :new }\n format.json { render json: @cinema_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @role_in_a_movie = RoleInAMovie.new(params[:role_in_a_movie])\n\n respond_to do |format|\n if @role_in_a_movie.save\n format.html { redirect_to @role_in_a_movie, notice: 'Role in a movie was successfully created.' }\n format.json { render json: @role_in_a_movie, status: :created, location: @role_in_a_movie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @role_in_a_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n vid = Video.create(video_params)\n redirect_to \"/videos/#{vid.id}\"\n end", "def create\n @movie = Movie.new(movie_params)\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: \"Movie was successfully created.\" }\n format.json { render :show, status: :created, location: @movie }\n format.js\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @saved_title = SavedTitle.new(saved_title_params)\n respond_to do |format|\n if @saved_title.save\n format.html { redirect_to @saved_title, notice: 'Movie was successfully added to list.' }\n format.json { render :show, status: :created, location: @saved_title }\n else\n format.html { render :new }\n format.json { render json: @saved_title.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # check if we want to bypass the API\n if movie_params[:bypassapi] == \"Bypass API\"\n @movie_info = movie_params.delete_if{|k,v| k == \"bypassapi\"}\n\n else\n # use the API and get the movie title via form\n if movie_params[:title].present?\n @movie_title = movie_params[:title].gsub(\" \",\"-\")\n @content = open(\"http://www.omdbapi.com/?t=#{@movie_title}&y=&plot=short&r=json\").read\n @results = JSON.parse(@content, symbolize_names: true)\n\n else\n @imdbID = movie_params[:imdbID]\n @content = open(\"http://www.omdbapi.com/?i=#{@imdbID}&plot=short&r=json\").read\n @results = JSON.parse(@content, symbolize_names: true)\n end\n\n # check if API has an error. if so, use movie_params\n if @results[:Error] == \"Movie not found!\"\n redirect_to new_movie_path, :alert => \"Title not found in the API. If you still want to add it,\n select the 'bypass the API' option\" and return\n\n else\n # parse the date\n @parsed_date = Date.new(movie_params[\"date_watched(1i)\"].to_i,\n movie_params[\"date_watched(2i)\"].to_i, movie_params[\"date_watched(3i)\"].to_i) unless ! movie_params[\"date_watched(1i)\"].present?\n\n # create the hash for the movie params\n @movie_info = { title: @results[:Title],\n imdb_url: \"http://www.imdb.com/title/#{@results[:imdbID]}/\",\n watch_url: movie_params[:watch_url],\n date_watched: @parsed_date,\n location_watched: movie_params[:location_watched],\n category_id: movie_params[:category_id],\n watchlist_id: movie_params[:watchlist_id],\n our_rating: movie_params[:our_rating],\n preview_link: movie_params[:preview_link],\n been_watched: movie_params[:been_watched],\n notes: movie_params[:notes],\n #imdb_artwork: @results[:Poster].gsub(\"N/A\", \"\"),\n imdb_artwork: \"http://img.omdbapi.com/?i=#{@results[:imdbID]}&apikey=#{ENV['poster_api_key']}\".gsub('N/A', ''),\n imdb_plot_summary: @results[:Plot],\n imdb_rating: @results[:imdbRating],\n imdb_genre: @results[:Genre],\n runtime: @results[:Runtime],\n year_released: @results[:Year],\n imdb_actors: @results[:Actors]}\n end #end of if/else based on API error\n end #end of if/else on whether or not to bypass the API\n\n # assign hash to a new movie object\n @movie = Movie.new(@movie_info)\n\n # save new movie object to the database\n respond_to do |format|\n if @movie.save\n format.html { redirect_to movies_url, notice: 'Movie was successfully created.' }\n format.json { render :show, status: :created, location: @movie }\n else\n format.html { render :new }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie_record = MovieRecord.new(movie_record_params)\n\n respond_to do |format|\n if @movie_record.save\n format.html { redirect_to movie_records_url, notice: 'Movie record was successfully created.' }\n format.json { render :show, status: :created, location: @movie_record }\n else\n format.html { redirect_to movie_records_url }\n format.json { render json: @movie_record.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @categories_movie = CategoriesMovie.new(categories_movie_params)\n\n respond_to do |format|\n if @categories_movie.save\n format.html { redirect_to @categories_movie, notice: 'Categories movie was successfully created.' }\n format.json { render :show, status: :created, location: @categories_movie }\n else\n format.html { render :new }\n format.json { render json: @categories_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @movie = Movie.find(params[:movie_id])\n end", "def create\n @movie_list_item = MovieListItem.new(params[:movie_list_item])\n\n respond_to do |format|\n if @movie_list_item.save\n format.html { redirect_to(@movie_list_item, :notice => 'Movie list item was successfully created.') }\n format.xml { render :xml => @movie_list_item, :status => :created, :location => @movie_list_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movie_list_item.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\r\n # session is a rails way of storing data temporarily in a cookie\r\n if session[:movies] == nil\r\n session[:movies] = []\r\n end\r\n\r\n session[:movies].push(params[:movie])\r\n puts \"session movie data\"\r\n puts session[:movies]\r\n\r\n redirect_to movie_path(session[:movies].length - 1) #pass the last movie we just added to the show page and redirect there\r\n # puts \"===================\"\r\n # puts params[:movie]\r\n # puts \"===================\"\r\n # @movies = []\r\n # @movies.push(params[:movie])\r\n end", "def new\n # Create an instance variable for the form_for helper\n @movie = Movie.new\n\n # by default we render app/views/movies/new.html.erb\n end", "def create\n @movie = Movie.new(movie_params)\n @movie.address = @movie.city + \" \" + @movie.country\n @movie.thumnail_url = \"https://mood2travel.s3.amazonaws.com/thumnails/\" + @movie.videoId.to_s + \".png\"\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to @movie, notice: 'Movie was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @film_genre = FilmGenre.new(film_genre_params)\n\n respond_to do |format|\n if @film_genre.save\n format.html { redirect_to @film_genre, notice: 'Film genre was successfully created.' }\n format.json { render :show, status: :created, location: @film_genre }\n else\n format.html { render :new }\n format.json { render json: @film_genre.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie }\n end\n end", "def new\n @movie = Movie.new\nend", "def create\n\tdata = params[:movie]\n if(data.has_key?(\"genres\"))\n\t\tids = Genre.get_ids(data[:genres])\n\t\tdata.delete(\"genres\")\n\tend\n @movie = @catalogue.movies.build(data)\n unless ids == nil\n\t\t@movie.genre_ids = ids\n end\n\n respond_to do |format|\n if @movie.save\n format.html { redirect_to(@movie, :notice => 'Movie was successfully created.') }\n format.xml { render :xml => @movie, :status => :created, :location => @movie }\n format.json { render :json => {:success => true} }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n format.json { render :json => {:success => false, :errors => @movie.errors} }\n end\n end\n end", "def new\n @movie_item = MovieItem.new\n\t\tredirect_to root_path, :notice => \"You are not supposed to view this page.\"\n# respond_to do |format|\n# format.html # new.html.erb\n# format.json { render json: @movie_item }\n# end\n end", "def new\n @movie_info = MovieInfo.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movie_info }\n end\n end", "def new\n @movie = Movie.new\n end", "def new\n @movie = Movie.new\n end", "def new\n @movie = Movie.new\n end", "def new\n @role_in_a_movie = RoleInAMovie.new\n\n redirect_to root_path, :notice => \"You are not supposed to view this page.\"\n end", "def create\n @movie_participant = MovieParticipant.new(movie_participant_params)\n\n respond_to do |format|\n if @movie_participant.save\n format.html { redirect_to @movie_participant, notice: 'Movie participant was successfully created.' }\n format.json { render action: 'show', status: :created, location: @movie_participant }\n else\n format.html { render action: 'new' }\n format.json { render json: @movie_participant.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @moviepost = Moviepost.new(moviepost_params)\n\n respond_to do |format|\n if @moviepost.save\n format.html { redirect_to root_path, notice: 'Moviepost was successfully created.' }\n # format.html { redirect_to @moviepost, notice: 'Moviepost was successfully created.' }\n format.json { render :show, status: :created, location: @moviepost }\n else\n format.html { render :new }\n format.json { render json: @moviepost.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movimiento = Movimiento.new(movimiento_params)\n if @movimiento.save\n redirect_to [:edit, @movimiento], notice: t('action.save')\n else\n render :new \n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def new\n @movie = Movie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @movie }\n end\n end", "def create\n @movies_ive_watched = MoviesIveWatched.new(movies_ive_watched_params)\n\n respond_to do |format|\n if @movies_ive_watched.save\n format.html { redirect_to @movies_ive_watched, notice: 'Movies ive watched was successfully created.' }\n format.json { render :show, status: :created, location: @movies_ive_watched }\n else\n format.html { render :new }\n format.json { render json: @movies_ive_watched.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie_company = MovieCompany.new(movie_company_params)\n\n respond_to do |format|\n if @movie_company.save\n format.html { redirect_to @movie_company, notice: 'Movie company was successfully created.' }\n format.json { render :show, status: :created, location: @movie_company }\n else\n format.html { render :new }\n format.json { render json: @movie_company.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @moviie = Moviie.new(moviie_params)\n\n respond_to do |format|\n if @moviie.save\n format.html { redirect_to @moviie, notice: 'Moviie was successfully created.' }\n format.json { render :show, status: :created, location: @moviie }\n else\n format.html { render :new }\n format.json { render json: @moviie.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @movie_type = MovieType.new(movie_type_params)\n\n respond_to do |format|\n if @movie_type.save\n format.html { redirect_to @movie_type, notice: 'Movie type was successfully created.' }\n format.json { render :show, status: :created, location: @movie_type }\n else\n format.html { render :new }\n format.json { render json: @movie_type.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.813226", "0.7950397", "0.78547406", "0.7850082", "0.782687", "0.78156054", "0.7804333", "0.7799138", "0.7778784", "0.77772564", "0.77772564", "0.77450496", "0.7732235", "0.77319443", "0.77280396", "0.77280396", "0.77280396", "0.77280396", "0.77280396", "0.77280396", "0.77280396", "0.77280396", "0.77280396", "0.771516", "0.771516", "0.771516", "0.771516", "0.771516", "0.7714464", "0.7676507", "0.7515405", "0.75055695", "0.7398605", "0.7387482", "0.7380561", "0.7374443", "0.73404497", "0.73336047", "0.73040694", "0.72611403", "0.72305226", "0.72269285", "0.72180223", "0.7211013", "0.720389", "0.72002935", "0.71801215", "0.7174082", "0.7168954", "0.71541864", "0.71541864", "0.7143332", "0.7138133", "0.71122146", "0.7105398", "0.70869166", "0.70701706", "0.70686626", "0.7064189", "0.70401376", "0.70357025", "0.7025386", "0.70151675", "0.7013847", "0.70123696", "0.7002637", "0.69851565", "0.69357806", "0.693475", "0.6933032", "0.69250506", "0.6915471", "0.6907866", "0.6907866", "0.6907866", "0.6907866", "0.6907866", "0.6907866", "0.6907866", "0.6907866", "0.6907866", "0.68842137", "0.68737483", "0.68718827", "0.687156", "0.6851724", "0.6851724", "0.6851724", "0.6837387", "0.6819152", "0.68131524", "0.68002915", "0.6792888", "0.6792888", "0.6792888", "0.6792888", "0.67766434", "0.67733866", "0.67647237", "0.67594224" ]
0.68805444
82