module Trip
module Controls
class AttendsTripOffer
def initialize(request)
Validator.validate!(request)
@user = FacebookUserFetcher.get(request.access_token)
@trip_offer = Repositories::TripOffer.find_by_id(request.trip_offer_id)
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
| See https://gist.github.com/indrekj/1a5ac479c9768d4b5bab |
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
| #!/bin/bash | |
| author=`git config --get user.name` | |
| commits() { | |
| git log --author="$author" --no-merges --format="%ad %s" --date=short --date-order | |
| } | |
| main() { | |
| LAST_DATE="" |
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
| import java.util.ArrayList; | |
| import java.util.List; | |
| public class HandlerChain<IN, OUT> { | |
| private List<Handler<?, ?>> handlers = new ArrayList<Handler<?, ?>>(); | |
| private HandlerChain() { | |
| } |
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
| :!mutant -r ./spec/spec_helper.rb --rspec-dm2 ::Inflecto\.underscore | |
| Spec file(s): "spec/unit//class_methods/underscore_spec.rb" not found for Inflecto.underscore:/Users/indrek/inflecto/lib/inflecto.rb:43:9f2af | |
| ... | |
| ... | |
| Took: (0.05s) | |
| subjects: 1 | |
| mutations: 52 | |
| noop_fails: 0 |
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 MakesBookingPayment | |
| def initialize(booking, payment_details) | |
| @booking = booking | |
| @payment_details = payment_details | |
| end | |
| def pay! | |
| response = process_payment | |
| Transaction.record_purchase(@booking, response) |
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
| require "virtus" | |
| module Bitbot | |
| module Live | |
| class Depth | |
| include Virtus | |
| attribute :price, Price | |
| end | |
| 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
| module Admin | |
| class CategoriesController < BaseController | |
| def new | |
| @form = CategoryForm.new | |
| end | |
| def create | |
| @form = CategoryForm.new(params[:category]) | |
| if @form.valid? |
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
| require "dm-mapper" | |
| require "data_mapper/engine/arel" | |
| DM = DataMapper::Environment.new | |
| DM.engines[:arel] = DataMapper::Engine::Arel::Engine.new("sqlite3:/db/development.sqlite3") | |
| require "virtus" | |
| class Variant | |
| include DataMapper::Model |
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
| #!/bin/bash | |
| START=bff040e58fa3f00a5c8caada4d1c00718d2810f2 | |
| function filesChanged() { | |
| prev=$START | |
| revs=`git rev-list $START..HEAD --no-merges` | |
| for rev in $revs; do | |
| changed=`git diff --name-only $prev $rev --diff-filter=M` |