Skip to content

Commit

Permalink
replace returning with tap
Browse files Browse the repository at this point in the history
  • Loading branch information
saturnflyer committed May 17, 2011
1 parent 378c044 commit 0ad379d
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/radiant/admin_ui.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def load_default_regions
private

def load_default_page_regions
returning OpenStruct.new do |page|
OpenStruct.new.tap do |page|
page.edit = RegionSet.new do |edit|
edit.main.concat %w{edit_header edit_form edit_popups}
edit.form.concat %w{edit_title edit_extended_metadata edit_page_parts}
Expand All @@ -177,7 +177,7 @@ def load_default_page_regions
end

def load_default_user_regions
returning OpenStruct.new do |user|
OpenStruct.new.tap do |user|
user.preferences = RegionSet.new do |preferences|
preferences.main.concat %w{edit_header edit_form}
preferences.form.concat %w{edit_name edit_email edit_username edit_password edit_locale}
Expand All @@ -199,7 +199,7 @@ def load_default_user_regions
end

def load_default_snippet_regions
returning OpenStruct.new do |snippet|
OpenStruct.new.tap do |snippet|
snippet.edit = RegionSet.new do |edit|
edit.main.concat %w{edit_header edit_form}
edit.form.concat %w{edit_title edit_content edit_filter}
Expand All @@ -216,7 +216,7 @@ def load_default_snippet_regions
end

def load_default_layout_regions
returning OpenStruct.new do |layout|
OpenStruct.new.tap do |layout|
layout.edit = RegionSet.new do |edit|
edit.main.concat %w{edit_header edit_form}
edit.form.concat %w{edit_title edit_extended_metadata edit_content}
Expand All @@ -233,7 +233,7 @@ def load_default_layout_regions
end

def load_default_configuration_regions
returning OpenStruct.new do |configuration|
OpenStruct.new.tap do |configuration|
configuration.show = RegionSet.new do |show|
show.user.concat %w{preferences}
show.config.concat %w{site defaults users}
Expand All @@ -247,7 +247,7 @@ def load_default_configuration_regions
end

def load_default_extension_regions
returning OpenStruct.new do |extension|
OpenStruct.new.tap do |extension|
extension.index = RegionSet.new do |index|
index.thead.concat %w{title_header website_header version_header}
index.tbody.concat %w{title_cell website_cell version_cell}
Expand Down

0 comments on commit 0ad379d

Please sign in to comment.