Class: RoRoSupport::Req
- Inherits:
-
Object
- Object
- RoRoSupport::Req
- Defined in:
- lib/roro_support/req.rb
Instance Attribute Summary collapse
-
#files ⇒ Object
Returns the value of attribute files.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Req
constructor
list all files in dir.
- #that(dir) ⇒ Object
Constructor Details
#initialize ⇒ Req
list all files in dir
6 7 8 |
# File 'lib/roro_support/req.rb', line 6 def initialize @files = {} end |
Instance Attribute Details
#files ⇒ Object
Returns the value of attribute files.
3 4 5 |
# File 'lib/roro_support/req.rb', line 3 def files @files end |
Class Method Details
.all_files_in(dir_path) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/roro_support/req.rb', line 15 def self.all_files_in(dir_path) dirname = dir_path.split('/').last.gsub(/\.rb/, '') Dir[File.("../#{dirname}/**", dir_path)].each do |file| require file end end |
Instance Method Details
#that(dir) ⇒ Object
10 11 12 13 |
# File 'lib/roro_support/req.rb', line 10 def that(dir) dir_load dir self end |