I hereby claim:
- I am stephenrichards on github.
- I am stephenrichards (https://keybase.io/stephenrichards) on keybase.
- I have a public key ASA7E9tyNSk9b1YmcvZq9RmYvoPUNIsTBtxtkvlTlWW2wgo
To claim this, I am signing this object:
# This gist finds the case add request payload, and scans it to pull out the Response value for a | |
# particular attribute (in this case, APPLY_CASE_MEANS_REVIEW, which appears twice in the payload) | |
# | |
laa = LegalAidApplication.find_by(application_ref: 'L-7WE-R99') | |
s = laa.ccms_submission | |
h = s.submission_history.find_by(to_state: 'case_submitted') | |
doc = Nokogiri::XML(h.request).remove_namespaces! |
require 'json' | |
laa = LegalAidApplication.find_by application_ref: 'L-HUV-KKR' | |
cfe_submissions = laa.cfe_submissions.first.submission_histories | |
cfe_submissions.each do |h| | |
puts "#{h.http_method} #{h.url}" | |
unless h.http_method == 'GET' | |
puts "request:" | |
pp JSON.parse(h.request_payload) | |
end |
client = Geckoboard.client(Rails.configuration.x.geckoboard.api_key) | |
client.ping | |
dataset = client.datasets.find_or_create( | |
'aaa.demo.applications_started_by_day', | |
fields: [ | |
Geckoboard::DateField.new(:date, name: 'Date'), |
module CCMS | |
class PayloadParser | |
def initialize | |
@doc = File.open(Rails.root.join('ccms_integration/example_payloads/PassportedSingleProceedingNonMolDelegated.xml')) { |f| Nokogiri::XML(f).remove_namespaces! } | |
end | |
def run | |
puts ">>>>>>>>> #{__FILE__}:#{__LINE__} <<<<<<<<<<\n" | |
x = @doc.xpath('//Attributes//Attribute//Attribute') |
I hereby claim:
To claim this, I am signing this object:
# Below are two classes -FareCalculator and OysterCard calculator. | |
# Currently, the fare calculator simply looks up the fare based on the starting zone and ending zone | |
# and returns the result. | |
# | |
# For this exercise, add procs to the ZONE_TO_ZONE_FARES so that if the journey is from zone 3 to 2 and the oyster card has a | |
# season ticket, then the fare is 45 and the fare for zone 1 to 1 in they have an incomplete journey on the card, the maximum fare is charged | |
class FareCalculator | |
MAXIMUM_FARE = 666 |
# create the EvenOnlyArray class so that this works | |
eoa = EvenOnlyArray.new 3,55,12,44,26,37 | |
eoa.each_even { |x| puts x * 2 } | |
# expected output: | |
# 24 | |
# 88 | |
# 52 |
content_tag :html do | |
content_tag :div, class: 'govuk-body' do | |
content_tag :p, class: 'govuk-item do | |
"My item" | |
end | |
end | |
end | |
# expected output: | |
# <html><div class="govuk_body><p class="govuk_item">My item</p></div></html> |
class SwipeOutService | |
delegate :alerts, :to => :fare_calculator | |
def initialize(card, end_station_id) | |
@card = card | |
@end_station = Station.find(end_station_id) | |
@fare_calculator = FareCalculator.new(@card, @end_station) | |
end |
class ThinController < ApplicationController | |
def index | |
@cards = OysterCard.order(balance: :desc) | |
end | |
def show | |
end | |
def swipe_out |