Class: Card::FileCardCreator::AbstractFileCard
- Inherits:
-
Object
- Object
- Card::FileCardCreator::AbstractFileCard
- Includes:
- MigrationFile, RubyFile, SourceFile, OutputHelper
- Defined in:
- lib/card/tasks/card/file_card_creator/abstract_file_card.rb,
lib/card/tasks/card/file_card_creator/abstract_file_card/ruby_file.rb,
lib/card/tasks/card/file_card_creator/abstract_file_card/source_file.rb,
lib/card/tasks/card/file_card_creator/abstract_file_card/migration_file.rb
Overview
A template class for generating cards that are linked to source files.
Direct Known Subclasses
Defined Under Namespace
Modules: MigrationFile, RubyFile, SourceFile
Class Attribute Summary collapse
-
.category ⇒ Object
readonly
Returns the value of attribute category.
-
.default_rule_name ⇒ Object
Returns the value of attribute default_rule_name.
-
.supported_types ⇒ Object
readonly
Returns the value of attribute supported_types.
Class Method Summary collapse
Instance Method Summary collapse
- #category ⇒ Object
- #create ⇒ Object
-
#initialize(mod, name, type, codename: nil, force: false) ⇒ AbstractFileCard
constructor
A new instance of AbstractFileCard.
Methods included from RubyFile
Methods included from MigrationFile
Methods included from SourceFile
Methods included from OutputHelper
#color_puts, #log_file_action, #write_at, #write_to_mod
Constructor Details
#initialize(mod, name, type, codename: nil, force: false) ⇒ AbstractFileCard
Returns a new instance of AbstractFileCard.
19 20 21 22 23 24 25 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 19 def initialize mod, name, type, codename: nil, force: false @mod = mod @type = type.to_sym @name = name @force = force @codename = codename || name.underscore.tr(" ", "_") end |
Class Attribute Details
.category ⇒ Object (readonly)
Returns the value of attribute category.
11 12 13 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 11 def category @category end |
.default_rule_name ⇒ Object
Returns the value of attribute default_rule_name.
12 13 14 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 12 def default_rule_name @default_rule_name end |
.supported_types ⇒ Object (readonly)
Returns the value of attribute supported_types.
11 12 13 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 11 def supported_types @supported_types end |
Class Method Details
.valid_type?(type) ⇒ Boolean
14 15 16 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 14 def valid_type? type supported_types.include? type.to_sym end |
Instance Method Details
#category ⇒ Object
33 34 35 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 33 def category self.class.category end |
#create ⇒ Object
27 28 29 30 31 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 27 def create create_source_file create_ruby_file create_migration_file end |