Sha256: 8e9b1da27d79ee59ba6e339bb7a365b2280c93d95f553020593b18ceec747542
Contents?: true
Size: 607 Bytes
Versions: 14
Compression:
Stored size: 607 Bytes
Contents
module ActiveModel class Serializer class Config def initialize(data = {}) @data = data end def each(&block) @data.each(&block) end def clear @data.clear end def method_missing(name, *args) name = name.to_s return @data[name] if @data.include?(name) match = name.match(/\A(.*?)([?=]?)\Z/) case match[2] when "=" @data[match[1]] = args.first when "?" !!@data[match[1]] end end end CONFIG = Config.new('embed' => :objects) # :nodoc: end end
Version data entries
14 entries across 14 versions & 2 rubygems