{"action":"created","issue":{"url":"https://api.github.com/repos/rom-rb/rom-mapper/issues/8","labels_url":"https://api.github.com/repos/rom-rb/rom-mapper/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/rom-rb/rom-mapper/issues/8/comments","events_url":"https://api.github.com/repos/rom-rb/rom-mapper/issues/8/events","html_url":"https://github.com/rom-rb/rom-mapper/issues/8","id":100489977,"number":8,"title":"Add ability to register custom coersions","user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/rom-rb/rom-mapper/labels/help-wanted","name":"help-wanted","color":"ededed"},{"url":"https://api.github.com/repos/rom-rb/rom-mapper/labels/mapper","name":"mapper","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-08-12T08:04:20Z","updated_at":"2015-08-12T08:04:23Z","closed_at":null,"body":"_From @cflipse on July 14, 2015 15:38_\n\nNow that we're moving away from a centralized Transproc function registry, we need someplace to put coersions for domain value objects, so that:\r\n\r\n```\r\nBookMapper < ROM::Mapper\r\n  model Book\r\n  attribute :isbn, type: :isbn\r\nend\r\n```\r\n\r\nwill coerce Book#isbn to an ISBN type value object.\r\n\r\nYou can do this currently by calling `ROM::Processor::Transproc::Functions.import` but that's gobal, and deeply nested enough that it _screams_ private.  Cleaner, more explicit support in the context of the mappers would be good.\r\n\r\n<bountysource-plugin>\r\n---\r\nWant to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/24325919-add-ability-to-register-custom-coersions?utm_campaign=plugin&utm_content=tracker%2F155789&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F155789&utm_medium=issues&utm_source=github).\r\n</bountysource-plugin>\n\n_Copied from original issue: rom-rb/rom#286_"},"comment":{"url":"https://api.github.com/repos/rom-rb/rom-mapper/issues/comments/130210972","html_url":"https://github.com/rom-rb/rom-mapper/issues/8#issuecomment-130210972","issue_url":"https://api.github.com/repos/rom-rb/rom-mapper/issues/8","id":130210972,"user":{"login":"solnic","id":1066,"avatar_url":"https://avatars.githubusercontent.com/u/1066?v=3","gravatar_id":"","url":"https://api.github.com/users/solnic","html_url":"https://github.com/solnic","followers_url":"https://api.github.com/users/solnic/followers","following_url":"https://api.github.com/users/solnic/following{/other_user}","gists_url":"https://api.github.com/users/solnic/gists{/gist_id}","starred_url":"https://api.github.com/users/solnic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/solnic/subscriptions","organizations_url":"https://api.github.com/users/solnic/orgs","repos_url":"https://api.github.com/users/solnic/repos","events_url":"https://api.github.com/users/solnic/events{/privacy}","received_events_url":"https://api.github.com/users/solnic/received_events","type":"User","site_admin":false},"created_at":"2015-08-12T08:04:23Z","updated_at":"2015-08-12T08:04:23Z","body":"_From @AMHOL on July 15, 2015 11:47_\n\nIt makes me sad to see state held on a class level like that"}}