Last active
February 4, 2017 10:16
-
-
Save solnic/d9ef5c8db87d20da4cd6 to your computer and use it in GitHub Desktop.
Revisions
-
solnic revised this gist
Mar 25, 2015 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,4 +11,4 @@ class GothamCityMapper < ROM::Mapper m = GothamCityMapper.build puts m.call [{ superhero: 'Bruce Wayne' }] # => [{:superhero=>#<struct Batman secret_name="Bruce Wayne">}] -
solnic created this gist
Mar 25, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,14 @@ require 'rom' Batman = Struct.new(:secret_name) Transproc.register(:to_batman, proc { |name| Batman.new(name) }) class GothamCityMapper < ROM::Mapper attribute :superhero, type: :batman end m = GothamCityMapper.build puts m.call [{ superhero: 'Bruce Wayne' }] # => {:superhero=>#<struct Batman secret_name="Bruce Wayne">}