Module: Card::Set::All::Subcards
- Extended by:
- Card::Set
- Defined in:
- tmpsets/set/mod002-core/all/subcards.rb
Constant Summary
Constants included from Format
Instance Method Summary collapse
-
#attach_subcard(name_or_card, args = {}) ⇒ Object
(also: #add_subcard)
phase_method :add_subcard, before: :store do |name_or_card, args=nil| TODO: handle differently in different stages.
- #attach_subcard!(name_or_card, args = {}) ⇒ Object
-
#attach_subfield(name_or_card, args = {}) ⇒ Object
(also: #add_subfield)
phase_method :add_subfield, before: :approve do |name_or_card, args=nil|.
- #attach_subfield!(name_or_card, args = {}) ⇒ Object
- #clear_subcards ⇒ Object
- #deep_clear_subcards ⇒ Object
- #detach_subcard(name_or_card) ⇒ Object (also: #remove_subcard)
- #detach_subfield(name_or_card) ⇒ Object (also: #remove_subfield)
-
#field(tag, opts = {}) ⇒ Object
~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/subcards.rb ~~.
- #subcard(card_name) ⇒ Object
- #subfield(field_name) ⇒ Object
- #unfilled? ⇒ Boolean
Methods included from I18nScope
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
Instance Method Details
#attach_subcard(name_or_card, args = {}) ⇒ Object Also known as: add_subcard
phase_method :add_subcard, before: :store do |name_or_card, args=nil| TODO: handle differently in different stages
18 19 20 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 18 def attach_subcard name_or_card, args={} subcards.add name_or_card, args end |
#attach_subcard!(name_or_card, args = {}) ⇒ Object
23 24 25 26 27 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 23 def attach_subcard! name_or_card, args={} subcard = subcards.add name_or_card, args subcard.director.reset_stage subcard end |
#attach_subfield(name_or_card, args = {}) ⇒ Object Also known as: add_subfield
phase_method :add_subfield, before: :approve do |name_or_card, args=nil|
30 31 32 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 30 def attach_subfield name_or_card, args={} subcards.add_field name_or_card, args end |
#attach_subfield!(name_or_card, args = {}) ⇒ Object
35 36 37 38 39 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 35 def attach_subfield! name_or_card, args={} subcard = subcards.add_field name_or_card, args subcard.director.reset_stage subcard end |
#clear_subcards ⇒ Object
51 52 53 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 51 def clear_subcards subcards.clear end |
#deep_clear_subcards ⇒ Object
55 56 57 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 55 def deep_clear_subcards subcards.deep_clear end |
#detach_subcard(name_or_card) ⇒ Object Also known as: remove_subcard
41 42 43 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 41 def detach_subcard name_or_card subcards.remove name_or_card end |
#detach_subfield(name_or_card) ⇒ Object Also known as: remove_subfield
46 47 48 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 46 def detach_subfield name_or_card subcards.remove_field name_or_card end |
#field(tag, opts = {}) ⇒ Object
~~ above autogenerated; below pulled from /Users/ethan/dev/wagn/gem/card/mod/core/set/all/subcards.rb ~~
4 5 6 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 4 def field tag, opts={} Card.fetch cardname.field(tag), opts end |
#subcard(card_name) ⇒ Object
8 9 10 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 8 def subcard card_name subcards.card card_name end |
#subfield(field_name) ⇒ Object
12 13 14 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 12 def subfield field_name subcards.field field_name end |
#unfilled? ⇒ Boolean
59 60 61 62 63 |
# File 'tmpsets/set/mod002-core/all/subcards.rb', line 59 def unfilled? (content.empty? || content.strip.empty?) && (comment.blank? || comment.strip.blank?) && !subcards.present? end |