diff options
author | Valery Sizov <valery@gitlab.com> | 2016-12-07 14:00:06 +0200 |
---|---|---|
committer | Valery Sizov <valery@gitlab.com> | 2016-12-07 14:00:06 +0200 |
commit | b12d6541835024eb74384551b84bf0e74747d0c3 (patch) | |
tree | cde3a9635d616f20bf8c747221d475e0c852b86b /lib/bitbucket/page.rb | |
parent | 67b7637e5d7d3cf3e3f5cde6e7f984ece368c48c (diff) | |
download | gitlab-ce-b12d6541835024eb74384551b84bf0e74747d0c3.tar.gz |
BitBuckpet importer. Refactoring. Iteration 2
Diffstat (limited to 'lib/bitbucket/page.rb')
-rw-r--r-- | lib/bitbucket/page.rb | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/bitbucket/page.rb b/lib/bitbucket/page.rb index 49d083cc66f..8f50f67f84d 100644 --- a/lib/bitbucket/page.rb +++ b/lib/bitbucket/page.rb @@ -18,14 +18,12 @@ module Bitbucket private def parse_attrs(raw) - attrs = %w(size page pagelen next previous) - attrs.map { |attr| { attr.to_sym => raw[attr] } }.reduce(&:merge) + raw.slice(*%w(size page pagelen next previous)).symbolize_keys end def parse_values(raw, bitbucket_rep_class) return [] unless raw['values'] && raw['values'].is_a?(Array) - - raw['values'].map { |hash| bitbucket_rep_class.new(hash) } + bitbucket_rep_class.decorate(raw['values']) end def representation_class(type) |