lostisland/sawyer — pull request #23 by bhuga (2014-03-20 22:10:22+00:00)
Title: Tighter inspect

Sets up inspect for `Sawyer::Resource` and `Sawyer::Resource#rels` to look like hashes.

`Sawyer::Resource` before:
```
[2] pry(main)> r = o.repo 'lostisland/sawyer'
=> #,
@_fields=
#,
@_metaclass=#>,
@_rels=
#2544008,
:name=>"sawyer",
:full_name=>"lostisland/sawyer",
:owner=>
#,
@_fields=#,
@_metaclass=#>,
@_rels=
#"lostisland",
:id=>2613464,
:gravatar_id=>"2cac6a53fb519390129fb847ca365f31",
:type=>"Organization",
:site_admin=>false}>,
:private=>false,
:description=>"Secret User Agent of HTTP",
:fork=>false,
:created_at=>2011-10-09 19:15:53 UTC,
:updated_at=>2014-01-21 16:06:43 UTC,
:pushed_at=>2014-01-21 16:06:42 UTC,
:homepage=>"",
:size=>588,
:stargazers_count=>89,
:watchers_count=>89,
:language=>"Ruby",
:has_issues=>true,
:has_downloads=>true,
:has_wiki=>true,
:forks_count=>19,
:open_issues_count=>4,
:forks=>19,
:open_issues=>4,
:watchers=>89,
:default_branch=>"master",
:master_branch=>"master",
:permissions=>
#,
@_fields=#,
@_metaclass=#>,
@_rels=#,
@attrs={:admin=>false, :push=>false, :pull=>true}>,
:organization=>
#,
@_fields=#,
@_metaclass=#>,
@_rels=
#"lostisland",
:id=>2613464,
:gravatar_id=>"2cac6a53fb519390129fb847ca365f31",
:type=>"Organization",
:site_admin=>false}>,
:network_count=>19,
:subscribers_count=>8}>
```

`Sawyer::Resource` after:
```
[1] pry(main)> r = o.repo 'lostisland/sawyer'
=> {:id=>2544008,
:name=>"sawyer",
:full_name=>"lostisland/sawyer",
:owner=>
{:login=>"lostisland",
:id=>2613464,
:gravatar_id=>"2cac6a53fb519390129fb847ca365f31",
:type=>"Organization",
:site_admin=>false},
:private=>false,
:description=>"Secret User Agent of HTTP",
:fork=>false,
:created_at=>2011-10-09 19:15:53 UTC,
:updated_at=>2014-01-21 16:06:43 UTC,
:pushed_at=>2014-01-21 16:06:42 UTC,
:homepage=>"",
:size=>588,
:stargazers_count=>89,
:watchers_count=>89,
:language=>"Ruby",
:has_issues=>true,
:has_downloads=>true,
:has_wiki=>true,
:forks_count=>19,
:open_issues_count=>4,
:forks=>19,
:open_issues=>4,
:watchers=>89,
:default_branch=>"master",
:master_branch=>"master",
:permissions=>{:admin=>false, :push=>false, :pull=>true},
:organization=>
{:login=>"lostisland",
:id=>2613464,
:gravatar_id=>"2cac6a53fb519390129fb847ca365f31",
:type=>"Organization",
:site_admin=>false},
:network_count=>19,
:subscribers_count=>8}
```

`Sawyer::Relation::Map` before:
```
[3] pry(main)> r.rels
=> #
```

`Sawyer::Relation::Map` after:
```
[2] pry(main)> r.rels
=> {:html_url=>"https://github.com/lostisland/sawyer",
:self_url=>"https://api.github.com/repos/lostisland/sawyer",
:forks_url=>"https://api.github.com/repos/lostisland/sawyer/forks",
:keys_url=>"https://api.github.com/repos/lostisland/sawyer/keys",
:collaborators_url=>
"https://api.github.com/repos/lostisland/sawyer/collaborators",
:teams_url=>"https://api.github.com/repos/lostisland/sawyer/teams",
:hooks_url=>"https://api.github.com/repos/lostisland/sawyer/hooks",
:issue_events_url=>
"https://api.github.com/repos/lostisland/sawyer/issues/events",
:events_url=>"https://api.github.com/repos/lostisland/sawyer/events",
:assignees_url=>"https://api.github.com/repos/lostisland/sawyer/assignees",
:branches_url=>"https://api.github.com/repos/lostisland/sawyer/branches",
:tags_url=>"https://api.github.com/repos/lostisland/sawyer/tags",
:blobs_url=>"https://api.github.com/repos/lostisland/sawyer/git/blobs",
:git_tags_url=>"https://api.github.com/repos/lostisland/sawyer/git/tags",
:git_refs_url=>"https://api.github.com/repos/lostisland/sawyer/git/refs",
:trees_url=>"https://api.github.com/repos/lostisland/sawyer/git/trees",
:statuses_url=>"https://api.github.com/repos/lostisland/sawyer/statuses/",
:languages_url=>"https://api.github.com/repos/lostisland/sawyer/languages",
:stargazers_url=>"https://api.github.com/repos/lostisland/sawyer/stargazers",
:contributors_url=>
"https://api.github.com/repos/lostisland/sawyer/contributors",
:subscribers_url=>
"https://api.github.com/repos/lostisland/sawyer/subscribers",
:subscription_url=>
"https://api.github.com/repos/lostisland/sawyer/subscription",
:commits_url=>"https://api.github.com/repos/lostisland/sawyer/commits",
:git_commits_url=>
"https://api.github.com/repos/lostisland/sawyer/git/commits",
:comments_url=>"https://api.github.com/repos/lostisland/sawyer/comments",
:issue_comment_url=>
"https://api.github.com/repos/lostisland/sawyer/issues/comments/",
:contents_url=>"https://api.github.com/repos/lostisland/sawyer/contents/",
:compare_url=>"https://api.github.com/repos/lostisland/sawyer/compare/...",
:merges_url=>"https://api.github.com/repos/lostisland/sawyer/merges",
:archive_url=>"https://api.github.com/repos/lostisland/sawyer/",
:downloads_url=>"https://api.github.com/repos/lostisland/sawyer/downloads",
:issues_url=>"https://api.github.com/repos/lostisland/sawyer/issues",
:pulls_url=>"https://api.github.com/repos/lostisland/sawyer/pulls",
:milestones_url=>"https://api.github.com/repos/lostisland/sawyer/milestones",
:notifications_url=>
"https://api.github.com/repos/lostisland/sawyer/notifications",
:labels_url=>"https://api.github.com/repos/lostisland/sawyer/labels",
:releases_url=>"https://api.github.com/repos/lostisland/sawyer/releases",
:git_url=>"git://github.com/lostisland/sawyer.git",
:ssh_url=>"git@github.com:lostisland/sawyer.git",
:clone_url=>"https://github.com/lostisland/sawyer.git",
:svn_url=>"https://github.com/lostisland/sawyer"}
```