Module: RailsAssist::Artifact::Methods
- Included in:
- RailsAssist::Artifact, RailsAssist::Artifact
- Defined in:
- lib/rails_assist/artifact.rb
Instance Method Summary collapse
- #app_artifacts ⇒ Object
- #helper_list ⇒ Object
- #rails_artifacts ⇒ Object
- #valid_artifact?(type) ⇒ Boolean
Instance Method Details
#app_artifacts ⇒ Object
7 8 9 |
# File 'lib/rails_assist/artifact.rb', line 7 def app_artifacts [:controller, :mailer, :helper, :view, :model, :permit, :license, :validator, :asset] end |
#helper_list ⇒ Object
3 4 5 |
# File 'lib/rails_assist/artifact.rb', line 3 def helper_list RailsAssist.artifacts + [:view, :asset] end |
#rails_artifacts ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/rails_assist/artifact.rb', line 11 def rails_artifacts @rails_artifacts ||= begin files_methods = RailsAssist::Artifact::Files.instance_methods files_symbols = files_methods.grep(/_files$/).map{|f| f.to_s.gsub(/^(.*)_files/, '\1').to_sym } # dir_methods = RailsAssist::Artifact::Directory.instance_methods # dir_symbols = dir_methods.map{|dir| dir.to_s.gsub(/^(.*)_dir/, '\1').to_sym } dir_symbols = [] (files_symbols + dir_symbols).uniq end end |
#valid_artifact?(type) ⇒ Boolean
24 25 26 |
# File 'lib/rails_assist/artifact.rb', line 24 def valid_artifact? type rails_artifacts.include?(type) end |