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.
24 25 26 27 28 29 30 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 24 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.
16 17 18 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 16 def category @category end |
.default_rule_name ⇒ Object
Returns the value of attribute default_rule_name.
17 18 19 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 17 def default_rule_name @default_rule_name end |
.supported_types ⇒ Object (readonly)
Returns the value of attribute supported_types.
16 17 18 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 16 def supported_types @supported_types end |
Class Method Details
.valid_type?(type) ⇒ Boolean
19 20 21 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 19 def valid_type? type supported_types.include? type.to_sym end |
Instance Method Details
#category ⇒ Object
38 39 40 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 38 def category self.class.category end |
#create ⇒ Object
32 33 34 35 36 |
# File 'lib/card/tasks/card/file_card_creator/abstract_file_card.rb', line 32 def create create_source_file create_ruby_file create_migration_file end |