summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanielsdeleo <dan@chef.io>2015-09-16 16:53:25 -0700
committerdanielsdeleo <dan@chef.io>2015-09-17 14:29:50 -0700
commit6c01a178e1c701f2e4c5f85d0c9fa93431bb5b69 (patch)
tree51c147fae1229de140064b75009a182f4b8feb9f
parent41372f5a6b5608625a6d89953d24c60373d4c39b (diff)
downloadchef-6c01a178e1c701f2e4c5f85d0c9fa93431bb5b69.tar.gz
Use Forwardable to delegate in PolicyBuilder::Dynamic
-rw-r--r--lib/chef/policy_builder/dynamic.rb45
1 files changed, 13 insertions, 32 deletions
diff --git a/lib/chef/policy_builder/dynamic.rb b/lib/chef/policy_builder/dynamic.rb
index 0f266a25fb..deefd1e855 100644
--- a/lib/chef/policy_builder/dynamic.rb
+++ b/lib/chef/policy_builder/dynamic.rb
@@ -16,6 +16,8 @@
# limitations under the License.
#
+require 'forwardable'
+
require 'chef/log'
require 'chef/rest'
require 'chef/run_context'
@@ -30,6 +32,8 @@ class Chef
# implementation based on the content of the node object.
class Dynamic
+ extend Forwardable
+
attr_reader :node
attr_reader :node_name
attr_reader :ohai_data
@@ -71,39 +75,16 @@ class Chef
raise
end
- ## Delegated Methods ##
+ ## Delegated Public API Methods ##
- def original_runlist
- implementation.original_runlist
- end
-
- def run_context
- implementation.run_context
- end
-
- def run_list_expansion
- implementation.run_list_expansion
- end
-
- def build_node
- implementation.build_node
- end
-
- def setup_run_context(specific_recipes=nil)
- implementation.setup_run_context(specific_recipes)
- end
-
- def expand_run_list
- implementation.expand_run_list
- end
-
- def sync_cookbooks
- implementation.sync_cookbooks
- end
-
- def temporary_policy?
- implementation.temporary_policy?
- end
+ def_delegator :implementation, :original_runlist
+ def_delegator :implementation, :run_context
+ def_delegator :implementation, :run_list_expansion
+ def_delegator :implementation, :build_node
+ def_delegator :implementation, :setup_run_context
+ def_delegator :implementation, :expand_run_list
+ def_delegator :implementation, :sync_cookbooks
+ def_delegator :implementation, :temporary_policy?
## Internal Public API ##