This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class LeakyRoom | |
DESIRED_MIN_TEMPERATURE = 72 | |
attr_accessor :temperature, :occupied | |
end | |
class Room | |
def heat_needed? | |
# Policy based upon temp and whether occupied. | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.company.silentlogin.service; | |
import org.springframework.test.AbstractDependencyInjectionSpringContextTests; | |
import org.apache.commons.codec.binary.Base64; | |
import org.easymock.MockControl; | |
import java.security.MessageDigest; | |
import java.util.*; | |
import com.company.security.service.SecurityService; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Session | |
require(['models/session'], function(Session) { window.Session = Session }); | |
s = new Session(); | |
s.fetch(); | |
// Returns a Session model with the following: | |
// - attributes contain simple attributes | |
// - trips (TripList) a collection of Trip models; 'light' versions. | |
// - user (User) the logged in user; check its attributes for email and name. | |
// - expenseCategories | |
// - expensePaymentTypes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRIPCASE.models.BonusOffersRequest = TRIPCASE.Model.extend({ | |
proxyName: 'BonusOffersRequestProxy', | |
init: function(attrs, options) { | |
this.trip = options.trip; | |
}, | |
validate: function(attrs) { | |
var errors = []; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TRIPCASE.controllers.Feedback = TRIPCASE.Controller.extend({ | |
init: function(options) { | |
_.bindAll(this, "_onCreate"); | |
}, | |
/* Actions */ | |
feedback: function() { | |
var feedback = new TRIPCASE.models.Feedback(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Class singleton methods to mix into ActiveRecord. | |
module SingletonMethods # :nodoc: | |
# Extends the existing find method in potentially two ways: | |
# - If a mappable instance exists in the options, adds a distance column. | |
# - If a mappable instance exists in the options and the distance column exists in the | |
# conditions, substitutes the distance sql for the distance column -- this saves | |
# having to write the gory SQL. | |
def find(*args) | |
options = extract_options_from_args!(args) | |
origin = extract_origin_from_options(options) |