Module: Chewy::Index::Witchcraft::ClassMethods
- Defined in:
- lib/chewy/index/witchcraft.rb
Instance Method Summary collapse
- #cauldron(**options) ⇒ Object
- #check_requirements! ⇒ Object
- #witchcraft! ⇒ Object
- #witchcraft? ⇒ Boolean
Instance Method Details
#cauldron(**options) ⇒ Object
38 39 40 |
# File 'lib/chewy/index/witchcraft.rb', line 38 def cauldron(**) (@cauldron ||= {})[] ||= Cauldron.new(self, **) end |
#check_requirements! ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/chewy/index/witchcraft.rb', line 24 def check_requirements! = [] << "MethodSource gem is required for the Witchcraft, please add `gem 'method_source'` to your Gemfile" unless Proc.method_defined?(:source) << "Parser gem is required for the Witchcraft, please add `gem 'parser'` to your Gemfile" unless '::Parser'.safe_constantize << "Unparser gem is required for the Witchcraft, please add `gem 'unparser'` to your Gemfile" unless '::Unparser'.safe_constantize = .join("\n") raise if .present? end |
#witchcraft! ⇒ Object
19 20 21 22 |
# File 'lib/chewy/index/witchcraft.rb', line 19 def witchcraft! self._witchcraft = true check_requirements! end |
#witchcraft? ⇒ Boolean
34 35 36 |
# File 'lib/chewy/index/witchcraft.rb', line 34 def witchcraft? !!_witchcraft end |