aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2014-03-23 12:29:05 -0700
committerelijah <elijah@riseup.net>2014-03-23 12:29:05 -0700
commit5d326dc9bbf8ecb282e6606f4af1b1929d3c475e (patch)
tree45046731bc6bbedfc7ab21a260dad71a36a90122
parentbf3f301678a38d7436635db5fdc1e669c31da231 (diff)
downloadleap_cli-5d326dc9bbf8ecb282e6606f4af1b1929d3c475e.tar.gz
leap_cli-5d326dc9bbf8ecb282e6606f4af1b1929d3c475e.tar.bz2
fix bug that prevented json keys with a period in them.
-rw-r--r--lib/leap_cli/config/object.rb6
1 files changed, 3 insertions, 3 deletions
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