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

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

Instance Method Summary collapse

Methods included from I18nScope

#mod_name, #scope

Methods included from Loader

#clean_empty_module_from_hash, #clean_empty_modules, #extended, #pattern_and_modules_from_path, #process_base_modules, #register_set, #tmp_file_frame, #tmp_file_template, #tmp_file_wrapped_content, #write_tmp_file

Methods included from Helpers

#abstract_set?, #all_set?, #shortname

Methods included from Card::Set::AdvancedApi

#attachment, #ensure_set, #stage_method

Methods included from Format

#all_set_format_mod!, #define_on_format, #format, #register_set_format, #view

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

Methods included from Event

#event

Instance Method Details

#known?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'tmpsets/set/mod001-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/mod001-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/mod001-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/mod001-core/all/states.rb', line 14

def real?
  !new_card?
end

#unknown?Boolean

Returns:

  • (Boolean)


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

def unknown?
  !known?
end