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
| def update | |
| if user.newfangled? | |
| user.update_attributes(name: user_params[:Body]) | |
| elsif user.named? | |
| #Twilio::TwiML::Response.new do |r| | |
| #r.Say "Thank you, your PIN has been received." | |
| #end | |
| user.update_attributes(pin: user_params[:Digits]) | |
| 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 SMSWallet | |
| class TwimlBuilder | |
| def initialize(user) | |
| @user = user | |
| @response = Twilio::TwiML::Response.new do |r| | |
| r.Gather method: method, action: action, numDigits: 4 do |g| | |
| r.Say message | |
| end | |
| r.Say "We didn't receive any input. Goodbye!" | |
| 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
| client.calls.create( | |
| to: args[:to], | |
| from: args[:from], | |
| url: args[:url] | |
| ) |
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
| <?xml version="1.0" encoding="UTF-8"?> | |
| <Response> | |
| <Gather action="http://289c088.ngrok.com/sms_transactions" numDigits="4" timeout="10"> | |
| <Say voice="woman">Hello, and welcome to Atlas Card. Please set the 4-digit pin you'd like to use for your account and then press the pound key.</Say> | |
| </Gather> | |
| </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
| " Press ? for help | |
| .. (up a dir) | |
| /Users/matthewcampbell/Sites/code/atlas-card/SMSWallet/ | |
| ▸ app/ | |
| ▸ bin/ | |
| ▸ config/ | |
| ▸ db/ | |
| ▸ lib/ | |
| ▸ log/ |
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
| def terms_of_service | |
| end | |
| def update | |
| if user.update_attributes(user_params) | |
| redirect_to trips_path(region: session[:region]) | |
| else | |
| render :terms_of_service | |
| 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
| class FlybladeController < ApplicationController | |
| def check_terms_of_service_version | |
| return if request.path == edit_user_path(current_user) | |
| version = Flyblade::TermsOfServicePolicy.current_version | |
| unless current_user.terms_of_service_version == version | |
| return redirect_to edit_user_path(current_user) | |
| end | |
| 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 Flyblade | |
| class TermsOfServicePolicy | |
| class << self | |
| def current_version | |
| OperatingPolicy.find_by_title("EULA / Terms of Service").try(:version) || "1.0.0" | |
| end | |
| end | |
| def initialize(user) | |
| @user = user |
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 Flyblade | |
| class TermsOfServicePolicy | |
| CURRENT_VERSION = current_version | |
| def initialize(user) | |
| @user = user | |
| end | |
| def accepted_current_version? | |
| user.terms_of_service_version == CURRENT_VERSION |
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
| var anagram = require('./anagram'); | |
| describe('Anagram', function() { | |
| it("no matches",function() { | |
| var subject = anagram("diaper"); | |
| var matches = subject.matches([ "hello", "world", "zombies", "pants"]); | |
| expect(matches).toEqual([]); | |
| }); |