From 5d326dc9bbf8ecb282e6606f4af1b1929d3c475e Mon Sep 17 00:00:00 2001 From: elijah Date: Sun, 23 Mar 2014 12:29:05 -0700 Subject: fix bug that prevented json keys with a period in them. --- lib/leap_cli/config/object.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/leap_cli/config/object.rb b/lib/leap_cli/config/object.rb index f1f8ca2..d4fe6bc 100644 --- a/lib/leap_cli/config/object.rb +++ b/lib/leap_cli/config/object.rb @@ -96,7 +96,9 @@ module LeapCli # def get!(key) key = key.to_s - if key =~ /\./ + if self.has_key?(key) + fetch_value(key) + elsif key =~ /\./ # for keys with with '.' in them, we start from the root object (@node). keys = key.split('.') value = @node.get!(keys.first) @@ -105,8 +107,6 @@ module LeapCli else value end - elsif self.has_key?(key) - fetch_value(key) else raise NoMethodError.new(key, "No method '#{key}' for #{self.class}") end -- cgit v1.2.3