Class: Annotate::Helpers
- Inherits:
-
Object
- Object
- Annotate::Helpers
- Defined in:
- lib/annotate/helpers.rb
Overview
Class for holding helper methods. Done to make lib/annotate.rb less bloated.
Class Method Summary collapse
- .fallback(*args) ⇒ Object
- .include_models? ⇒ Boolean
- .include_routes? ⇒ Boolean
- .reset_options(options) ⇒ Object
- .skip_on_migration? ⇒ Boolean
- .true?(val) ⇒ Boolean
Class Method Details
.fallback(*args) ⇒ Object
24 25 26 |
# File 'lib/annotate/helpers.rb', line 24 def fallback(*args) args.detect(&:present?) end |
.include_models? ⇒ Boolean
16 17 18 |
# File 'lib/annotate/helpers.rb', line 16 def include_models? ENV.fetch('models', nil) =~ Constants::TRUE_RE end |
.include_routes? ⇒ Boolean
12 13 14 |
# File 'lib/annotate/helpers.rb', line 12 def include_routes? ENV.fetch('routes', nil) =~ Constants::TRUE_RE end |
.reset_options(options) ⇒ Object
28 29 30 |
# File 'lib/annotate/helpers.rb', line 28 def () .flatten.each { |key| ENV[key.to_s] = nil } end |