This file contains 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 Policy | |
def price | |
@price = Settings.policy.base_rate + Settings.policy.extra_traveller_discount * (@travellers.length - 1) | |
@travellers.each do |traveller| | |
@price += @destination.day_rate(traveller.age) * (@end_date - @start_date).to_i | |
end | |
end | |
end | |
class Destination |
This file contains 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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
queryParams: ['filter'], | |
actions: { | |
filterAdded(value) { | |
var queryParams = this.get('queryParams'); | |
queryParams['filter'] = {reference: {contains: value}}; | |
this.transitionToRoute({ queryParams: queryParams }); |
This file contains 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
defmodule Client do | |
# This doesn't work! | |
use Application.get_env(:my_app, :http_client_base, HTTPoison.Base) | |
defp process_url(url) do | |
url |> URI.parse |> Map.put(:scheme, "https") |> URI.to_string | |
end | |
defp process_request_body(body) do | |
body |