Class: Card::Set::TypePlusRight

Inherits:
Pattern::Base show all
Extended by:
Pattern::Helper
Defined in:
card/tmpsets/set_pattern/107-type_plus_right.rb,
card/tmpsets/set/mod011-card-mod-account/type_plus_right/user/email.rb,
card/tmpsets/set/mod025-card-mod-follow/type_plus_right/user/follow.rb,
card/tmpsets/set/mod025-card-mod-follow/type_plus_right/user/follow/follow_editor_helper.rb,
card/tmpsets/set/mod021-card-mod-bootstrap/type_plus_right/customized_bootswatch_skin/colors.rb,
card/tmpsets/set/mod010-card-mod-account/type_plus_right/user/email.rb,
card/tmpsets/set/mod026-card-mod-follow/type_plus_right/user/follow.rb,
card/tmpsets/set/mod026-card-mod-follow/type_plus_right/user/follow/follow_editor_helper.rb,
card/tmpsets/set/mod022-card-mod-bootstrap/type_plus_right/customized_bootswatch_skin/colors.rb

Overview

Set Pattern: TypePlusRight

Patterned field names on a specific type

Defined Under Namespace

Modules: CustomizedBootswatchSkin, User

Constant Summary collapse

@@options =
{
  junction_only: true,
  assigns_type: true,
  anchor_parts_count: 2
}

Instance Attribute Summary

Attributes included from Pattern::ClassMethods

#anchor_parts_count, #anchorless, #assigns_type, #junction_only, #pattern_code, #pattern_id

Class Method Summary collapse

Methods inherited from Pattern::Base

#anchor_codenames, #anchor_parts, #anchor_parts_count, #find_anchor_id, #format_module_list, #initialize, #inspect, #lookup_module_list, #module_key, #module_list, #pattern, #rule_set_key, #safe_key, #to_s

Methods included from Pattern::ClassMethods

#anchorless?, #generic_label, #junction_only?, #module_key, #new, #pattern, #pattern_applies?, #register

Constructor Details

This class inherits a constructor from Card::Set::Pattern::Base

Class Method Details

.anchor_name(card) ⇒ Object



37
38
39
# File 'card/tmpsets/set_pattern/107-type_plus_right.rb', line 37

def anchor_name card
  "#{left_type(card)}+#{card.name.tag}"
end

.generic_labelObject



26
27
28
# File 'card/tmpsets/set_pattern/107-type_plus_right.rb', line 26

def generic_label
  "given field cards on a given type"
end

.label(name) ⇒ Object



16
17
18
19
# File 'card/tmpsets/set_pattern/107-type_plus_right.rb', line 16

def label name
  name = name.to_name
  %(All "+#{name.tag}" cards on "#{name.left}" cards)
end

.prototype_args(anchor) ⇒ Object



30
31
32
33
34
35
# File 'card/tmpsets/set_pattern/107-type_plus_right.rb', line 30

def prototype_args anchor
  {
    name: "+#{anchor.tag}",
    supercard: Card.new(name: "*dummy", type: anchor.trunk_name)
  }
end

.short_label(name) ⇒ Object



21
22
23
24
# File 'card/tmpsets/set_pattern/107-type_plus_right.rb', line 21

def short_label name
  name = name.to_name
  %(all "+#{name.tag}" on "#{name.left}s")
end