{"id":15473027,"url":"https://github.com/hackvan/triangle-classification","last_synced_at":"2026-06-20T05:31:17.891Z","repository":{"id":145341920,"uuid":"140751755","full_name":"hackvan/triangle-classification","owner":"hackvan","description":null,"archived":false,"fork":false,"pushed_at":"2018-07-12T18:52:19.000Z","size":4,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T22:25:59.149Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackvan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-12T18:40:45.000Z","updated_at":"2018-07-12T18:52:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"414810fa-4d11-4483-8b13-5c72fbb589d4","html_url":"https://github.com/hackvan/triangle-classification","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"465475ca0bf505fe8aee36559be2b79dbb13473b"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hackvan/triangle-classification","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Ftriangle-classification","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Ftriangle-classification/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Ftriangle-classification/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Ftriangle-classification/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackvan","download_url":"https://codeload.github.com/hackvan/triangle-classification/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackvan%2Ftriangle-classification/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34558893,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"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-02T02:42:19.374Z","updated_at":"2026-06-20T05:31:17.875Z","avatar_url":"https://github.com/hackvan.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Triangle\n\n## Objectives\n\n1. Define a custom error and use it.\n\n## Instructions\n\n* Write a `Triangle` class that accepts three arguments on initialization. Each argument is a length of one of the three sides of the triangle. \n\n* Give your Triangles an instance method, `kind` that returns, as a symbol, its type. The valid types are:\n\n1. `:equilateral`\n\n2. `:isosceles`\n\n3. `:scalene`\n\n* The `kind` method should raise a custom error, `TriangleError` if the triangle is invalid. Check out the hint below to understand what makes a triangle invalid. Write a custom error class, `TriangleError` and inherit it from `StandardError`. This custom error class should be defined in the same file as the `Triangle` class, but outside of the class definition of `Triangle`. Like this:\n\n```ruby\n# lib/triangle.rb\n\nclass Triangle\n  # triangle code\n\n  class TriangleError \u003c StandardError\n    # triangle error code\n  end\nend\n```\n\n## Hint\n\nThe sum of the lengths of any two sides of a triangle always exceeds the length of the third side. This is a principle known as the _triangle inequality_.\n\nFurther, each side must be larger than 0.\n\n## Resources \n\n* [Exception Handling](http://www.skorks.com/2009/09/ruby-exceptions-and-exception-handling/)\n* [Basic Mathematics](http://www.basic-mathematics.com/) - [Types of Triangles](http://www.basic-mathematics.com/types-of-triangles.html)\n\n\u003cp data-visibility='hidden'\u003eView \u003ca href='https://learn.co/lessons/triangle-classification' title='Triangle'\u003eTriangle\u003c/a\u003e on Learn.co and start learning to code for free.\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackvan%2Ftriangle-classification","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackvan%2Ftriangle-classification","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackvan%2Ftriangle-classification/lists"}