20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
# File 'lib/ball_gag/gag.rb', line 20
def gag *arguments, &block
define_and_mixin_gagged_attributes_methods
callable = arguments.pop if arguments.last.respond_to? :call
options = arguments.pop if arguments.last.kind_of? Hash
to_call = callable || block || BallGag.engine ||
lambda { |*| raise NoEngineConfiguredError }
define_not_gagged_interpellations(arguments, to_call, options)
arguments.each do |attribute|
@gagged_attributes[attribute] = to_call
define_gagged_interpellation attribute
end
arguments
end
|