Permalink
Browse files

Merge pull request #33 from dpaterson/pull-req-release-rails3anddb-ma…

…ster-e0fa10770b

re-factor out intialize method in controllers [3/22]
  • Loading branch information...
2 parents 1fe6662 + e0fa107 commit 9668e3527acf36cbd8b6b7b7fc432da62b24f1a3 @galthaus galthaus committed Aug 2, 2012
Showing with 26 additions and 21 deletions.
  1. +26 −21 crowbar_framework/app/controllers/keystone_controller.rb
@@ -1,21 +1,26 @@
-# Copyright 2011, Dell
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-class KeystoneController < BarclampController
- def initialize
- @service_object = KeystoneService.new logger
- end
-end
-
+# Copyright 2011, Dell
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+class KeystoneController < BarclampController
+ before_filter :set_service_object
+
+ def set_service_object
+ @service_object = KeystoneService.new logger
+ end
+
+ private :set_service_object
+
+end
+

0 comments on commit 9668e35

Please sign in to comment.