/usr/lib/ruby/vendor_ruby/active_model/serializer/config.rb is in ruby-active-model-serializers 0.9.7-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 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
|