Add setup method and Setting object to configure AMS

This commit is contained in:
Santiago Pastorino
2013-09-04 21:01:13 -03:00
parent 29148cbe1c
commit 513e7f2166
3 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
module ActiveModel
class Serializer
class Settings
def initialize
@data = {}
end
def [](key)
@data[key.to_s]
end
def []=(key, value)
@data[key.to_s] = value
end
def each(&block)
@data.each(&block)
end
def clear
@data.clear
end
end
SETTINGS = Settings.new
end
end