{"action":"created","comment":{"url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/comments/38059146","id":38059146,"diff_hunk":"@@ -66,16 +66,70 @@ row_model.name # => \"SOME PROJECT NAME\"\n \n `Import::File` also provides the `RowModel` with the previous `RowModel` instance:\n \n+```ruby\n+row_model.previous # => <ProjectImportRowModel instance>\n+row_model.previous.previous # => nil, save memory by avoiding a linked list\n ```\n+\n+## Presenter\n+For complex rows, you can wrap your `RowModel` with a presenter:\n+\n+```ruby\n+class ProjectImportRowModel < ProjectRowModel\n+  include CsvRowModel::Import\n+\n+  # same as above\n+\n+  presenter do","path":"README.md","position":27,"original_position":27,"commit_id":"8a3a1e66f668d9ed5df6c3a6b0c05e23d5b9025f","original_commit_id":"8a3a1e66f668d9ed5df6c3a6b0c05e23d5b9025f","user":{"login":"ale7714","id":1709578,"avatar_url":"https://avatars.githubusercontent.com/u/1709578?v=3","gravatar_id":"","url":"https://api.github.com/users/ale7714","html_url":"https://github.com/ale7714","followers_url":"https://api.github.com/users/ale7714/followers","following_url":"https://api.github.com/users/ale7714/following{/other_user}","gists_url":"https://api.github.com/users/ale7714/gists{/gist_id}","starred_url":"https://api.github.com/users/ale7714/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ale7714/subscriptions","organizations_url":"https://api.github.com/users/ale7714/orgs","repos_url":"https://api.github.com/users/ale7714/repos","events_url":"https://api.github.com/users/ale7714/events{/privacy}","received_events_url":"https://api.github.com/users/ale7714/received_events","type":"User","site_admin":false},"body":"👍🏻 I think is easier to read the import model... Maybe some clases can become really big though ","created_at":"2015-08-27T03:24:41Z","updated_at":"2015-08-27T03:24:41Z","html_url":"https://github.com/FinalCAD/csv_row_model/pull/28#discussion_r38059146","pull_request_url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/comments/38059146"},"html":{"href":"https://github.com/FinalCAD/csv_row_model/pull/28#discussion_r38059146"},"pull_request":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28","id":43455866,"html_url":"https://github.com/FinalCAD/csv_row_model/pull/28","diff_url":"https://github.com/FinalCAD/csv_row_model/pull/28.diff","patch_url":"https://github.com/FinalCAD/csv_row_model/pull/28.patch","issue_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/28","number":28,"state":"open","locked":false,"title":"Mapper to presenter","user":{"login":"s12chung","id":263394,"avatar_url":"https://avatars.githubusercontent.com/u/263394?v=3","gravatar_id":"","url":"https://api.github.com/users/s12chung","html_url":"https://github.com/s12chung","followers_url":"https://api.github.com/users/s12chung/followers","following_url":"https://api.github.com/users/s12chung/following{/other_user}","gists_url":"https://api.github.com/users/s12chung/gists{/gist_id}","starred_url":"https://api.github.com/users/s12chung/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/s12chung/subscriptions","organizations_url":"https://api.github.com/users/s12chung/orgs","repos_url":"https://api.github.com/users/s12chung/repos","events_url":"https://api.github.com/users/s12chung/events{/privacy}","received_events_url":"https://api.github.com/users/s12chung/received_events","type":"User","site_admin":false},"body":"updating the code is like:\r\n```ruby\r\nclass Mapper\r\n include CsvRowModel::Import::Mapper\r\n maps_to ImportRowModel\r\n\r\n # implementation\r\nend\r\n\r\nmapper = CsvRowModel::Import::File.new(file_path, Mapper).next\r\n```\r\n\r\nto:\r\n```ruby\r\nclass ImportRowModel\r\n  # normal ImportRowModel code\r\n\r\n  presenter do\r\n    # Mapper implementation is copy and pasted here\r\n  end\r\nend\r\n\r\nrow_model = CsvRowModel::Import::File.new(file_path, ImportRowModel).next\r\npresenter = row_model.presenter\r\n```\r\n\r\nor you can read the README: https://github.com/FinalCAD/csv_row_model/blob/e375dc28afc0fb1c9b0ec552a27be2987118394c/README.md#presenter","created_at":"2015-08-26T21:44:09Z","updated_at":"2015-08-27T03:24:41Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6c94ea0e8225e9527623992841403e20dbc81a61","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28/commits","review_comments_url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28/comments","review_comment_url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/comments{/number}","comments_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/28/comments","statuses_url":"https://api.github.com/repos/FinalCAD/csv_row_model/statuses/8a3a1e66f668d9ed5df6c3a6b0c05e23d5b9025f","head":{"label":"FinalCAD:mapper_to_presenter","ref":"mapper_to_presenter","sha":"8a3a1e66f668d9ed5df6c3a6b0c05e23d5b9025f","user":{"login":"FinalCAD","id":7592480,"avatar_url":"https://avatars.githubusercontent.com/u/7592480?v=3","gravatar_id":"","url":"https://api.github.com/users/FinalCAD","html_url":"https://github.com/FinalCAD","followers_url":"https://api.github.com/users/FinalCAD/followers","following_url":"https://api.github.com/users/FinalCAD/following{/other_user}","gists_url":"https://api.github.com/users/FinalCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/FinalCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FinalCAD/subscriptions","organizations_url":"https://api.github.com/users/FinalCAD/orgs","repos_url":"https://api.github.com/users/FinalCAD/repos","events_url":"https://api.github.com/users/FinalCAD/events{/privacy}","received_events_url":"https://api.github.com/users/FinalCAD/received_events","type":"Organization","site_admin":false},"repo":{"id":38328805,"name":"csv_row_model","full_name":"FinalCAD/csv_row_model","owner":{"login":"FinalCAD","id":7592480,"avatar_url":"https://avatars.githubusercontent.com/u/7592480?v=3","gravatar_id":"","url":"https://api.github.com/users/FinalCAD","html_url":"https://github.com/FinalCAD","followers_url":"https://api.github.com/users/FinalCAD/followers","following_url":"https://api.github.com/users/FinalCAD/following{/other_user}","gists_url":"https://api.github.com/users/FinalCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/FinalCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FinalCAD/subscriptions","organizations_url":"https://api.github.com/users/FinalCAD/orgs","repos_url":"https://api.github.com/users/FinalCAD/repos","events_url":"https://api.github.com/users/FinalCAD/events{/privacy}","received_events_url":"https://api.github.com/users/FinalCAD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FinalCAD/csv_row_model","description":"Import and export your custom CSVs with a shared Ruby ORM-like interface.","fork":false,"url":"https://api.github.com/repos/FinalCAD/csv_row_model","forks_url":"https://api.github.com/repos/FinalCAD/csv_row_model/forks","keys_url":"https://api.github.com/repos/FinalCAD/csv_row_model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FinalCAD/csv_row_model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FinalCAD/csv_row_model/teams","hooks_url":"https://api.github.com/repos/FinalCAD/csv_row_model/hooks","issue_events_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/events{/number}","events_url":"https://api.github.com/repos/FinalCAD/csv_row_model/events","assignees_url":"https://api.github.com/repos/FinalCAD/csv_row_model/assignees{/user}","branches_url":"https://api.github.com/repos/FinalCAD/csv_row_model/branches{/branch}","tags_url":"https://api.github.com/repos/FinalCAD/csv_row_model/tags","blobs_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/refs{/sha}","trees_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FinalCAD/csv_row_model/statuses/{sha}","languages_url":"https://api.github.com/repos/FinalCAD/csv_row_model/languages","stargazers_url":"https://api.github.com/repos/FinalCAD/csv_row_model/stargazers","contributors_url":"https://api.github.com/repos/FinalCAD/csv_row_model/contributors","subscribers_url":"https://api.github.com/repos/FinalCAD/csv_row_model/subscribers","subscription_url":"https://api.github.com/repos/FinalCAD/csv_row_model/subscription","commits_url":"https://api.github.com/repos/FinalCAD/csv_row_model/commits{/sha}","git_commits_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/commits{/sha}","comments_url":"https://api.github.com/repos/FinalCAD/csv_row_model/comments{/number}","issue_comment_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/comments{/number}","contents_url":"https://api.github.com/repos/FinalCAD/csv_row_model/contents/{+path}","compare_url":"https://api.github.com/repos/FinalCAD/csv_row_model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FinalCAD/csv_row_model/merges","archive_url":"https://api.github.com/repos/FinalCAD/csv_row_model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FinalCAD/csv_row_model/downloads","issues_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues{/number}","pulls_url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls{/number}","milestones_url":"https://api.github.com/repos/FinalCAD/csv_row_model/milestones{/number}","notifications_url":"https://api.github.com/repos/FinalCAD/csv_row_model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FinalCAD/csv_row_model/labels{/name}","releases_url":"https://api.github.com/repos/FinalCAD/csv_row_model/releases{/id}","created_at":"2015-06-30T19:28:49Z","updated_at":"2015-08-15T00:44:08Z","pushed_at":"2015-08-26T21:47:32Z","git_url":"git://github.com/FinalCAD/csv_row_model.git","ssh_url":"git@github.com:FinalCAD/csv_row_model.git","clone_url":"https://github.com/FinalCAD/csv_row_model.git","svn_url":"https://github.com/FinalCAD/csv_row_model","homepage":"","size":800,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"FinalCAD:master","ref":"master","sha":"845a9bbba26245e2bcfbf118bfa4ea2ccd51900c","user":{"login":"FinalCAD","id":7592480,"avatar_url":"https://avatars.githubusercontent.com/u/7592480?v=3","gravatar_id":"","url":"https://api.github.com/users/FinalCAD","html_url":"https://github.com/FinalCAD","followers_url":"https://api.github.com/users/FinalCAD/followers","following_url":"https://api.github.com/users/FinalCAD/following{/other_user}","gists_url":"https://api.github.com/users/FinalCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/FinalCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FinalCAD/subscriptions","organizations_url":"https://api.github.com/users/FinalCAD/orgs","repos_url":"https://api.github.com/users/FinalCAD/repos","events_url":"https://api.github.com/users/FinalCAD/events{/privacy}","received_events_url":"https://api.github.com/users/FinalCAD/received_events","type":"Organization","site_admin":false},"repo":{"id":38328805,"name":"csv_row_model","full_name":"FinalCAD/csv_row_model","owner":{"login":"FinalCAD","id":7592480,"avatar_url":"https://avatars.githubusercontent.com/u/7592480?v=3","gravatar_id":"","url":"https://api.github.com/users/FinalCAD","html_url":"https://github.com/FinalCAD","followers_url":"https://api.github.com/users/FinalCAD/followers","following_url":"https://api.github.com/users/FinalCAD/following{/other_user}","gists_url":"https://api.github.com/users/FinalCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/FinalCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FinalCAD/subscriptions","organizations_url":"https://api.github.com/users/FinalCAD/orgs","repos_url":"https://api.github.com/users/FinalCAD/repos","events_url":"https://api.github.com/users/FinalCAD/events{/privacy}","received_events_url":"https://api.github.com/users/FinalCAD/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/FinalCAD/csv_row_model","description":"Import and export your custom CSVs with a shared Ruby ORM-like interface.","fork":false,"url":"https://api.github.com/repos/FinalCAD/csv_row_model","forks_url":"https://api.github.com/repos/FinalCAD/csv_row_model/forks","keys_url":"https://api.github.com/repos/FinalCAD/csv_row_model/keys{/key_id}","collaborators_url":"https://api.github.com/repos/FinalCAD/csv_row_model/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/FinalCAD/csv_row_model/teams","hooks_url":"https://api.github.com/repos/FinalCAD/csv_row_model/hooks","issue_events_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/events{/number}","events_url":"https://api.github.com/repos/FinalCAD/csv_row_model/events","assignees_url":"https://api.github.com/repos/FinalCAD/csv_row_model/assignees{/user}","branches_url":"https://api.github.com/repos/FinalCAD/csv_row_model/branches{/branch}","tags_url":"https://api.github.com/repos/FinalCAD/csv_row_model/tags","blobs_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/refs{/sha}","trees_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/trees{/sha}","statuses_url":"https://api.github.com/repos/FinalCAD/csv_row_model/statuses/{sha}","languages_url":"https://api.github.com/repos/FinalCAD/csv_row_model/languages","stargazers_url":"https://api.github.com/repos/FinalCAD/csv_row_model/stargazers","contributors_url":"https://api.github.com/repos/FinalCAD/csv_row_model/contributors","subscribers_url":"https://api.github.com/repos/FinalCAD/csv_row_model/subscribers","subscription_url":"https://api.github.com/repos/FinalCAD/csv_row_model/subscription","commits_url":"https://api.github.com/repos/FinalCAD/csv_row_model/commits{/sha}","git_commits_url":"https://api.github.com/repos/FinalCAD/csv_row_model/git/commits{/sha}","comments_url":"https://api.github.com/repos/FinalCAD/csv_row_model/comments{/number}","issue_comment_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/comments{/number}","contents_url":"https://api.github.com/repos/FinalCAD/csv_row_model/contents/{+path}","compare_url":"https://api.github.com/repos/FinalCAD/csv_row_model/compare/{base}...{head}","merges_url":"https://api.github.com/repos/FinalCAD/csv_row_model/merges","archive_url":"https://api.github.com/repos/FinalCAD/csv_row_model/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/FinalCAD/csv_row_model/downloads","issues_url":"https://api.github.com/repos/FinalCAD/csv_row_model/issues{/number}","pulls_url":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls{/number}","milestones_url":"https://api.github.com/repos/FinalCAD/csv_row_model/milestones{/number}","notifications_url":"https://api.github.com/repos/FinalCAD/csv_row_model/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/FinalCAD/csv_row_model/labels{/name}","releases_url":"https://api.github.com/repos/FinalCAD/csv_row_model/releases{/id}","created_at":"2015-06-30T19:28:49Z","updated_at":"2015-08-15T00:44:08Z","pushed_at":"2015-08-26T21:47:32Z","git_url":"git://github.com/FinalCAD/csv_row_model.git","ssh_url":"git@github.com:FinalCAD/csv_row_model.git","clone_url":"https://github.com/FinalCAD/csv_row_model.git","svn_url":"https://github.com/FinalCAD/csv_row_model","homepage":"","size":800,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28"},"html":{"href":"https://github.com/FinalCAD/csv_row_model/pull/28"},"issue":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/28"},"comments":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/FinalCAD/csv_row_model/statuses/8a3a1e66f668d9ed5df6c3a6b0c05e23d5b9025f"}}}}