Class: Card::Set::Type

Inherits:
Pattern::Base show all
Defined in:
card/lib/card/set/type.rb,
platypus/tmp/set_pattern/102-type.rb,
platypus/tmp/set/gem-card/mod001-core/type/mod.rb,
platypus/tmp/set/gem-card/mod001-core/type/cardtype.rb,
platypus/tmp/set/gem-defaults/mod005-list/type/list.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set.rb,
platypus/tmp/set/gem-defaults/mod011-edit/type/list.rb,
platypus/tmp/set/gem-defaults/mod022-style/type/css.rb,
platypus/tmp/set/gem-defaults/mod026-date/type/date.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/mod.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/uri.rb,
platypus/tmp/set/gem-defaults/mod018-assets/type/mod.rb,
platypus/tmp/set/gem-defaults/mod022-style/type/scss.rb,
platypus/tmp/set/gem-defaults/mod022-style/type/skin.rb,
platypus/tmp/set/gem-defaults/mod028-follow/type/set.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/html.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/json.rb,
platypus/tmp/set/gem-defaults/mod028-follow/type/user.rb,
platypus/tmp/set/gem-defaults/mod031-layout/type/html.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/basic.rb,
platypus/tmp/set/gem-defaults/mod005-list/type/pointer.rb,
platypus/tmp/set/gem-defaults/mod011-edit/type/pointer.rb,
platypus/tmp/set/gem-defaults/mod014-account/type/role.rb,
platypus/tmp/set/gem-defaults/mod014-account/type/user.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/number.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/phrase.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/toggle.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/setting.rb,
platypus/tmp/set/gem-defaults/mod005-list/type/link_list.rb,
platypus/tmp/set/gem-defaults/mod005-list/type/nest_list.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/cardtype.rb,
platypus/tmp/set/gem-defaults/mod014-account/type/signup.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/cardtype.rb,
platypus/tmp/set/gem-defaults/mod009-search/type/cardtype.rb,
platypus/tmp/set/gem-defaults/mod011-edit/type/plain_text.rb,
platypus/tmp/set/gem-defaults/mod028-follow/type/cardtype.rb,
platypus/tmp/set/gem-defaults/mod029-session/type/session.rb,
platypus/tmp/set/gem-defaults/mod016-carrierwave/type/file.rb,
platypus/tmp/set/gem-defaults/mod004-format/type/plain_text.rb,
platypus/tmp/set/gem-defaults/mod006-markdown/type/markdown.rb,
platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image.rb,
platypus/tmp/set/gem-defaults/mod023-bar_and_box/type/image.rb,
platypus/tmp/set/gem-defaults/mod009-search/type/search_type.rb,
platypus/tmp/set/gem-defaults/mod019-script/type/java_script.rb,
platypus/tmp/set/gem-defaults/mod031-layout/type/layout_type.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set/html_views.rb,
platypus/tmp/set/gem-defaults/mod012-email/type/email_template.rb,
platypus/tmp/set/gem-defaults/mod014-account/type/signup/views.rb,
platypus/tmp/set/gem-defaults/mod019-script/type/coffee_script.rb,
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set/setting_categories.rb,
platypus/tmp/set/gem-defaults/mod016-carrierwave/type/image/html_views.rb,
platypus/tmp/set/gem-defaults/mod018-assets/type/remote_manifest_group.rb,
platypus/tmp/set/gem-defaults/mod028-follow/type/notification_template.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set/html_views/template.rb,
platypus/tmp/set/gem-defaults/mod022-style/type/local_style_folder_group.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set/html_views/rule_lists.rb,
platypus/tmp/set/gem-defaults/mod019-script/type/local_script_folder_group.rb,
platypus/tmp/set/gem-defaults/mod022-style/type/local_style_manifest_group.rb,
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/events.rb,
platypus/tmp/set/gem-defaults/mod012-email/type/email_template/email_config.rb,
platypus/tmp/set/gem-defaults/mod019-script/type/local_script_manifest_group.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set/html_views/setting_filter.rb,
platypus/tmp/set/gem-defaults/mod024-bootstrap/type/bootswatch_skin/html_views.rb,
platypus/tmp/set/gem-defaults/mod010-rules/type/set/html_views/filtered_rule_lists.rb

Overview

Set Pattern: Type

Defined Under Namespace

Modules: Basic, BootswatchSkin, Cardtype, CoffeeScript, Css, Date, EmailTemplate, File, Html, Image, JavaScript, Json, LayoutType, LinkList, List, LocalScriptFolderGroup, LocalScriptManifestGroup, LocalStyleFolderGroup, LocalStyleManifestGroup, Markdown, Mod, NestList, NotificationTemplate, Number, Phrase, PlainText, Pointer, RemoteManifestGroup, Role, Scss, SearchType, Session, Set, Setting, Signup, Skin, Toggle, Uri, User

Instance Attribute Summary

Attributes included from Pattern::ClassMethods

#anchor_parts_count, #anchorless, #assigns_type, #compound_only, #pattern_code

Class Method Summary collapse

Methods inherited from Pattern::Base

#anchor_codenames, #anchor_parts, #find_anchor_id, #format_module_list, #initialize, #inspect, #lookup_module_list, #module_key, #module_list, #rule_lookup_key, #safe_key, #to_s

Methods included from Pattern::ClassMethods

#anchorless?, #compound_only?, #generic_label, #module_key, #new, #pattern, #pattern_applies?, #pattern_id, #register

Constructor Details

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

Class Method Details

.anchor_id(card) ⇒ Object



33
34
35
# File 'platypus/tmp/set_pattern/102-type.rb', line 33

def anchor_id card
  card.type_id
end

.anchor_name(card) ⇒ Object



29
30
31
# File 'platypus/tmp/set_pattern/102-type.rb', line 29

def anchor_name card
  card.type_name
end

.generic_labelObject



17
18
19
# File 'platypus/tmp/set_pattern/102-type.rb', line 17

def generic_label
  "cards of a given type"
end

.label(name) ⇒ Object



9
10
11
# File 'platypus/tmp/set_pattern/102-type.rb', line 9

def label name
  %(All "#{name}" cards)
end

.pattern_applies?(card) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'platypus/tmp/set_pattern/102-type.rb', line 25

def pattern_applies? card
  !!card.type_id
end

.prototype_args(anchor) ⇒ Object



21
22
23
# File 'platypus/tmp/set_pattern/102-type.rb', line 21

def prototype_args anchor
  { type: anchor }
end

.short_label(name) ⇒ Object



13
14
15
# File 'platypus/tmp/set_pattern/102-type.rb', line 13

def short_label name
  %(all "#{name}s")
end