{"id":16073563,"url":"https://github.com/phstc/headshift_test","last_synced_at":"2025-10-09T00:14:12.970Z","repository":{"id":1443197,"uuid":"1673591","full_name":"phstc/Headshift_test","owner":"phstc","description":"Headshift_test","archived":false,"fork":false,"pushed_at":"2011-06-01T23:42:43.000Z","size":104,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-22T08:48:24.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://pablocantero.com","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phstc.png","metadata":{"files":{"readme":"README.rdoc","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2011-04-28T01:03:37.000Z","updated_at":"2022-08-17T15:24:48.000Z","dependencies_parsed_at":"2022-07-29T13:39:07.799Z","dependency_job_id":null,"html_url":"https://github.com/phstc/Headshift_test","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phstc/Headshift_test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2FHeadshift_test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2FHeadshift_test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2FHeadshift_test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2FHeadshift_test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phstc","download_url":"https://codeload.github.com/phstc/Headshift_test/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phstc%2FHeadshift_test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000714,"owners_count":26082879,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T08:21:26.034Z","updated_at":"2025-10-09T00:14:12.951Z","avatar_url":"https://github.com/phstc.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"== Headshift_test/Pablo Cantero\n\nHere is my code for the Code Kata (https://gist.github.com/5977211c8c3c30b43063) proposed\n\nI wrote the checkout class following your interface\n\n co = Checkout.new(pricing_rules)\n co.scan(item)\n co.scan(item)\n price = co.total\n\nI don't know if I didn't understand. But I'm not totaly agree with co.scan. IMHO I think that the pricing_rules must be calculated in the method total\n\nI wrote this code as simple as I could ;)\n\n== Running this code\n\n  rake\n\nRake command will execute a short questionnaire and after it will execute the entire test suite ;)\n\n== Why I cloned the object in checkout_spec.rb\n\nI cloned the products in checkout_spec.rb \n\n co.scan(@fruit_tea.clone)\n\nTo use different references, to don't break my code in this part\n\n if count % 2 == 1\n   product.price = 0\n end\n\nIf I use the same reference, it will change all objects price (same reference) to 0\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphstc%2Fheadshift_test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphstc%2Fheadshift_test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphstc%2Fheadshift_test/lists"}