Module: Card::Set::All::ActiveCard

Extended by:
Card::Set
Defined in:
tmpsets/set/mod003-core/all/active_card.rb

Overview

Set: All cards (ActiveCard)

Class Method Summary collapse

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

#before, layout_method_name, #view, view_method_name, view_setting_method_name, wrapper_method_name

Methods included from Inheritance

#include_set, #include_set_formats

Methods included from Basket

#abstract_basket, #add_to_basket, #basket, #unshift_basket

Methods included from Trait

#card_accessor, #card_reader, #card_writer, #require_field

Methods included from Event::Api

#event

Class Method Details

.source_locationObject



7
# File 'tmpsets/set/mod003-core/all/active_card.rb', line 7

def self.source_location; "/Users/ethan/dev/decko/gem/card/mod/core/set/all/active_card.rb"; end

Instance Method Details

#format(opts = {}) ⇒ Object

FIXME: -this needs a better home!



38
39
40
41
# File 'tmpsets/set/mod003-core/all/active_card.rb', line 38

def format opts={}
  opts = { format: opts.to_sym } if [Symbol, String].member? opts.class
  Card::Format.new self, opts
end

#trait_var(_var_name, &_block) ⇒ Object

following may be useful, but is neither tested nor in use

def card_attributes if Card::Set.traits set_modules.each do |mod| if mod_traits = Card::Set.traits[mod] return mod_traits end end end nil end

def trait_var? var_name !instance_variable_get( var_name ).nil? end



29
30
31
32
33
34
35
# File 'tmpsets/set/mod003-core/all/active_card.rb', line 29

def trait_var _var_name, &_block
  # FIXME: - following optimization attempt needs to handle cache clearing!
  #  instance_variable_get var_name or begin
  #    instance_variable_set var_name, block_given? ? yield : raise("no block?")
  #  end
  yield
end