lib/app_box.rb in app_box-0.2.4 vs lib/app_box.rb in app_box-0.2.5
- old
+ new
@@ -19,18 +19,18 @@
def self.method_missing(name, *args, &block)
AppBox.instance.send(name, *args)
end
def self.set_property(name, value, parent=AppBox)
- if value.class == String
+ if value.class == String || value.class == Array
if parent.nil?
AppBox.send "#{name}=", value
else
parent.send "#{name}=", value
end
elsif value.class == Hash
parent = parent.send "#{name}=", OpenStruct.new
- value.each do |_name, _value|
+ value.each do |_name, _value|
set_property(_name, _value, parent)
end
end
end
end