Module: Card::Set::All::States

Extended by:
Card::Set
Defined in:
tmpsets/set/mod002-core/all/states.rb

Constant Summary

Constants included from Format

Format::TEMPLATE_DIR

Instance Method Summary collapse

Methods included from I18nScope

#mod_name, #scope

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #process_base_modules, #register_set

Methods included from Helpers

#abstract_set?, #all_set?, #num_set_parts, #shortname, #underscore

Methods included from Card::Set::AdvancedApi

#attachment, #ensure_set, #stage_method

Methods included from Format

#all_set_format_mod!, #before, #define_on_format, #format, layout_method_name, #register_set_format, #view, #view_for_override, view_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Basket

#abstract_basket, #add_to_basket, #basket

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Instance Method Details

#known?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'tmpsets/set/mod002-core/all/states.rb', line 10

def known?
  real? || virtual?
end

#new_card?Boolean Also known as: new?

~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/states.rb ~~

Returns:

  • (Boolean)


4
5
6
7
# File 'tmpsets/set/mod002-core/all/states.rb', line 4

def new_card?
  new_record? || # not yet in db (from ActiveRecord)
    !!@from_trash    # in process of restoration from trash, not yet "re-created"
end

#pristine?Boolean

Returns:

  • (Boolean)


22
23
24
25
26
27
# File 'tmpsets/set/mod002-core/all/states.rb', line 22

def pristine?
  # has not been edited directly by human users.  bleep blorp.
  new_card? || !actions.joins(:act).where(
    "card_acts.actor_id != ?", Card::WagnBotID
  ).exists?
end

#real?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'tmpsets/set/mod002-core/all/states.rb', line 14

def real?
  !new_card?
end

#unknown?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'tmpsets/set/mod002-core/all/states.rb', line 18

def unknown?
  !known?
end