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
21 22 23 |
# File 'lib/annotate/helpers.rb', line 21 def fallback(*args) args.detect(&:present?) end |
.include_models? ⇒ Boolean
13 14 15 |
# File 'lib/annotate/helpers.rb', line 13 def include_models? ENV['models'] =~ Constants::TRUE_RE end |
.include_routes? ⇒ Boolean
9 10 11 |
# File 'lib/annotate/helpers.rb', line 9 def include_routes? ENV['routes'] =~ Constants::TRUE_RE end |
.reset_options(options) ⇒ Object
25 26 27 |
# File 'lib/annotate/helpers.rb', line 25 def () .flatten.each { |key| ENV[key.to_s] = nil } end |