Skip to content

Commit

Permalink
delegate to_ary to Hash from binarylogic#36
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Guymon committed May 8, 2014
1 parent 0634be8 commit 52c985d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/configlogic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ def initialize(hash_or_file = self.class.source, section = nil)
# Called for dynamically-defined keys, and also the first key deferenced at the top-level, if load! is not used.
# Otherwise, create_accessors! (called by new) will have created actual methods for each key.
def method_missing(name, *args, &block)
super if name === :to_ary # delegate to_ary to Hash
key = name.to_s
return missing_key("Missing setting '#{key}' in #{@section}") unless has_key? key
value = fetch(key)
Expand Down

0 comments on commit 52c985d

Please sign in to comment.