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

Extended by:
Card::Set
Defined in:
tmpsets/set/mod002-core/all/active_card.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, 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

#format(opts = {}) ⇒ Object

FIXME: -this needs a better home!



34
35
36
37
38
# File 'tmpsets/set/mod002-core/all/active_card.rb', line 34

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



25
26
27
28
29
30
31
# File 'tmpsets/set/mod002-core/all/active_card.rb', line 25

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