{"action":"closed","issue":{"number":26,"created_at":"2011-08-26T09:11:03Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Currently, in ruby-dicom, when creating a new DICOM object, no matter in which way, we use the #new method. When looking at the code for handling all this cases, I can't help but feel that it is somewhat overloaded, and the code isnt as clean as it could be. I would like to address this by making new class methods to offload the #new method when it comes to creating a new DICOM object in various ways. I will make some suggestions here, but I am definitely open to suggestions so please respond if you have some alterantive suggestions.\r\n\r\nCurrently, using #new with either string or nil, we can create new (empty) object, read from file, parse a pre-loaded string or even load from html string (experimental).\r\n\r\nWhat I would like in a new implementation is something like the following:\r\n\r\nCreate new (empty) DICOM object:\r\n\r\n    obj = DObject.new\r\n\r\nCreate a new DICOM object which is read from a file:\r\n\r\n    obj = DObject.read('file.dcm')\r\n\r\nCreate a new DICOM object which is parsed from a pre-loaded DICOM binary string:\r\n\r\n    obj = DObject.parse(string)\r\n\r\nCreate a new DICOM object by retrieving a html link (should we even support this in ruby-dicom?)\r\n\r\n    obj = DObject.get(hyperlink)\r\n\r\nWhat do you think? Please let me know.\r\nObviously, if carried out, we will do deprecation warnings for a period to ease the transition. I know I havent been too good with deprecation warnings in the past, but this is such a critical change that it obviously needs to be done.\r\n\r\nRegards,\r\nChris","comments":1,"title":"New DObject class methods to offload #new","updated_at":"2011-10-24T11:02:11Z","url":"https://api.github.com/repos/dicom/ruby-dicom/issues/26","id":1493657,"assignee":null,"milestone":{"number":13,"created_at":"2011-10-24T10:59:26Z","due_on":"2011-10-10T07:00:00Z","title":"v0.9.2","creator":{"avatar_url":"https://secure.gravatar.com/avatar/da1edd267557a4f37dcd2e8b3eea9fdc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"da1edd267557a4f37dcd2e8b3eea9fdc","url":"https://api.github.com/users/dicom","id":68168,"login":"dicom"},"url":"https://api.github.com/repos/dicom/ruby-dicom/milestones/13","open_issues":0,"closed_issues":2,"description":"The ruby-dicom 0.9.2 gem, released 2011-10-10.","state":"closed"},"closed_at":"2011-10-24T11:02:11Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/da1edd267557a4f37dcd2e8b3eea9fdc?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"da1edd267557a4f37dcd2e8b3eea9fdc","url":"https://api.github.com/users/dicom","id":68168,"login":"dicom"},"html_url":"https://github.com/dicom/ruby-dicom/issues/26","labels":[{"name":"Refactor","url":"https://api.github.com/repos/dicom/ruby-dicom/labels/Refactor","color":"CC0000"},{"name":"Specification","url":"https://api.github.com/repos/dicom/ruby-dicom/labels/Specification","color":"d7e102"}],"state":"closed"},"legacy":{"number":26,"action":"closed","issue":1493657}}