Module: Ankit::CardHappening
- Includes:
- CardNaming, EventFormatting, EventTraversing, RoundCounting
- Included in:
- CardHappeningCommand, Ankit::Challenge::Progress, Failing
- Defined in:
- lib/ankit/card_happening_command.rb
Instance Method Summary collapse
Methods included from CardNaming
#card_wildcard_for, #to_card_name, #to_card_path
Methods included from EventTraversing
find_latest_event_for, find_latest_event_named, #latest_event_for
Methods included from EventFormatting
Methods included from RoundCounting
#last_round, #latest_round, #next_round, #round_proceeded
Instance Method Details
#make_happen(method_name, card_name, round_proceeding = latest_round) ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/ankit/card_happening_command.rb', line 13 def make_happen(method_name, card_name, round_proceeding=latest_round) last = EventTraversing.find_latest_event_for(runtime, card_name) || Event.for_card(card_name, "vanilla", last_round) head = last.send(method_name, Envelope.fresh(round_proceeding)) FileUtils.touch(runtime.config.primary_journal) open(runtime.config.primary_journal, "a") { |f| f.write("#{head.to_json}\n") } self.round_proceeded head end |