diff options
author | elijah <elijah@riseup.net> | 2014-03-23 12:29:05 -0700 |
---|---|---|
committer | elijah <elijah@riseup.net> | 2014-03-23 12:29:05 -0700 |
commit | 5d326dc9bbf8ecb282e6606f4af1b1929d3c475e (patch) | |
tree | 45046731bc6bbedfc7ab21a260dad71a36a90122 | |
parent | bf3f301678a38d7436635db5fdc1e669c31da231 (diff) | |
download | leap_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.rb | 6 |
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 |