Class: Dev::Template::BaseInterface
- Includes:
- Rake::DSL
- Defined in:
- lib/firespring_dev_commands/templates/base_interface.rb
Overview
Base interface template takes a custom arg for the initializer and requires the user to implement the create_tasks! method
Direct Known Subclasses
ApplicationInterface, Aws, Aws::Ci, Aws::Services::Route53, Certificate, Docker::Default, Eol, Git
Instance Attribute Summary collapse
-
#exclude ⇒ Object
readonly
Returns the value of attribute exclude.
Instance Method Summary collapse
-
#create_tasks! ⇒ Object
This method executes all instance methods which match “create_.*_task!” This way a user can easily add new methods to the default template simply by defining new create methods on the class which follow the naming convention.
-
#initialize(exclude: []) ⇒ BaseInterface
constructor
A new instance of BaseInterface.
Constructor Details
#initialize(exclude: []) ⇒ BaseInterface
Returns a new instance of BaseInterface.
12 13 14 15 |
# File 'lib/firespring_dev_commands/templates/base_interface.rb', line 12 def initialize(exclude: []) @exclude = Array(exclude).map(&:to_sym) create_tasks! end |
Instance Attribute Details
#exclude ⇒ Object (readonly)
Returns the value of attribute exclude.
10 11 12 |
# File 'lib/firespring_dev_commands/templates/base_interface.rb', line 10 def exclude @exclude end |
Instance Method Details
#create_tasks! ⇒ Object
This method executes all instance methods which match “create_.*_task!” This way a user can easily add new methods to the default template simply by defining new create methods on the class which follow the naming convention
20 21 22 23 24 25 26 |
# File 'lib/firespring_dev_commands/templates/base_interface.rb', line 20 def create_tasks! self.class.instance_methods(false).sort.each do |method| next unless /create_.*_task!/.match?(method) send(method) end end |