Module: Card::Set::All::ActiveCard
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod001-core/all/active_card.rb
Instance Method Summary collapse
-
#format(opts = {}) ⇒ Object
FIXME: -this needs a better home!.
-
#trait_var(_var_name, &_block) ⇒ Object
following may be useful, but is neither tested nor in use.
Methods included from I18nScope
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_template, #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, #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
Instance Method Details
#format(opts = {}) ⇒ Object
FIXME: -this needs a better home!
34 35 36 37 38 |
# File 'tmpsets/set/mod001-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/mod001-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 |