Module: BallGag::Cloak

Included in:
BallGag
Defined in:
lib/ball_gag/cloak.rb

Instance Method Summary collapse

Instance Method Details

#negative_preterite=(preterite) ⇒ Object



31
32
33
34
# File 'lib/ball_gag/cloak.rb', line 31

def negative_preterite= preterite
  @preterite_negative = true
  set_preterite preterite
end

#preteriteObject



22
23
24
# File 'lib/ball_gag/cloak.rb', line 22

def preterite
  @preterite || 'gagged'
end

#preterite=(preterite) ⇒ Object



26
27
28
29
# File 'lib/ball_gag/cloak.rb', line 26

def preterite= preterite
  @preterite_negative = false
  set_preterite preterite
end

#preterite_negative?Boolean

Returns:

  • (Boolean)


36
37
38
# File 'lib/ball_gag/cloak.rb', line 36

def preterite_negative?
  @preterite_negative
end

#verbObject



3
4
5
# File 'lib/ball_gag/cloak.rb', line 3

def verb
  @verb || 'gag'
end

#verb=(verb) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/ball_gag/cloak.rb', line 7

def verb= verb
  old_verb = @verb
  @verb = verb

  BallGag::ClassMethods.instance_eval do
    if verb
      define_method verb do |*args|
        gag *args
      end
    elsif old_verb
      remove_method old_verb
    end
  end
end