Module: Card::Director::All

Included in:
Card
Defined in:
card/lib/card/director/all.rb

Overview

director-related Card instance methods

Instance Method Summary collapse

Instance Method Details

#act(options = {}, &block) ⇒ Object



5
6
7
8
9
10
11
# File 'card/lib/card/director/all.rb', line 5

def act options={}, &block
  if act_card
    add_to_act options, &block
  else
    start_new_act(&block)
  end
end

#act_cardObject



13
14
15
# File 'card/lib/card/director/all.rb', line 13

def act_card
  Card::Director.act_card
end

#act_card?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'card/lib/card/director/all.rb', line 17

def act_card?
  self == act_card
end

#save(*args) ⇒ Object



26
27
28
# File 'card/lib/card/director/all.rb', line 26

def save *args
  act { super }
end

#save!(*args) ⇒ Object



21
22
23
24
# File 'card/lib/card/director/all.rb', line 21

def save! *args
  as_subcard = args.first&.delete :as_subcard
  act(as_subcard: as_subcard) { super }
end

#update(*args) ⇒ Object Also known as: update_attributes



34
35
36
# File 'card/lib/card/director/all.rb', line 34

def update *args
  act { super }
end

#update!(*args) ⇒ Object Also known as: update_attributes!



38
39
40
# File 'card/lib/card/director/all.rb', line 38

def update! *args
  act { super }
end

#valid?(*args) ⇒ Boolean

Returns:

  • (Boolean)


30
31
32
# File 'card/lib/card/director/all.rb', line 30

def valid? *args
  act(validating: true) { super }
end