Class: Schienenzeppelin::Context
- Inherits:
-
Object
- Object
- Schienenzeppelin::Context
- Defined in:
- lib/schienenzeppelin/context.rb
Instance Attribute Summary collapse
-
#callbacks ⇒ Object
readonly
Returns the value of attribute callbacks.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #addons ⇒ Object
-
#default_addons ⇒ Object
Skippable parts of the default Rails generator, e.g.
-
#initialize(options = {}) ⇒ Context
constructor
A new instance of Context.
Constructor Details
#initialize(options = {}) ⇒ Context
Returns a new instance of Context.
7 8 9 10 |
# File 'lib/schienenzeppelin/context.rb', line 7 def initialize( = {}) = @callbacks = [] end |
Instance Attribute Details
#callbacks ⇒ Object (readonly)
Returns the value of attribute callbacks.
5 6 7 |
# File 'lib/schienenzeppelin/context.rb', line 5 def callbacks @callbacks end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/schienenzeppelin/context.rb', line 5 def end |
Instance Method Details
#addons ⇒ Object
12 13 14 15 16 17 |
# File 'lib/schienenzeppelin/context.rb', line 12 def addons AddOns.constants .select { |clazz| AddOns.const_get(clazz).is_a?(Class) } .map(&:name) .map(&:underscore) end |
#default_addons ⇒ Object
Skippable parts of the default Rails generator, e.g. active_record, active_job…
20 21 22 23 24 |
# File 'lib/schienenzeppelin/context.rb', line 20 def default_addons = addons.map { |option| "skip_#{option}".to_sym } = Schienenzeppelin::AppGenerator..keys.select { |key| key =~ /skip_/ } ( - ).map { |option| option.to_s.delete_prefix('skip_').to_sym } end |