Sha256: faaff3bb9ec84184b5b5f877446e90443b36da5096af559f45c8dcdd4b808405
Contents?: true
Size: 832 Bytes
Versions: 46
Compression:
Stored size: 832 Bytes
Contents
module Lockdown class Context attr_accessor :name, :allowed_methods def to_s self.class.to_s end def allows?(method_name) @allowed_methods.include?(method_name) end end class RootContext < Context def initialize(name) @name = name @allowed_methods = %w(with_controller and_controller to_model) end end class ControllerContext < Context def initialize(name) @name = name @allowed_methods = %w(with_controller and_controller to_model only_methods except_methods) end end class ModelContext < Context def initialize(name) @name = name @allowed_methods = %w(where) end end class ModelWhereContext < Context def initialize(name) @name = name @allowed_methods = %w(is_in includes equals) end end end
Version data entries
46 entries across 46 versions & 5 rubygems