Module: Rails3::Assist::Directory::Container::Methods

Included in:
Rails3::Assist::Directory::Container, Rails3::Assist::Directory::Container
Defined in:
lib/rails3_assist/directory/container.rb

Overview

return list of symbols for all kinds of supported Rails 3 containers (those that have a [container]_dir method)

Instance Method Summary collapse

Instance Method Details

#rails_containersObject



8
9
10
11
12
13
14
# File 'lib/rails3_assist/directory/container.rb', line 8

def rails_containers
  app_methods       = Rails3::Assist::Directory.instance_methods
  artifact_methods  = Rails3::Assist::Artifact::Directory.instance_methods
  all_methods = app_methods + artifact_methods
    
  all_methods.grep(/_dir$/).map{|dir| dir.to_s.gsub(/^(.*)_dir/, '\1').to_sym }
end

#valid_container?(type) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/rails3_assist/directory/container.rb', line 16

def valid_container? type
  rails_containers.include?(type)
end