Class: LHS::RequireLhsRecords
- Inherits:
-
Object
- Object
- LHS::RequireLhsRecords
- Defined in:
- lib/lhs.rb
Class Method Summary collapse
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ RequireLhsRecords
constructor
A new instance of RequireLhsRecords.
Constructor Details
#initialize(app) ⇒ RequireLhsRecords
Returns a new instance of RequireLhsRecords.
7 8 9 |
# File 'lib/lhs.rb', line 7 def initialize(app) @app = app end |
Class Method Details
.require_records ⇒ Object
16 17 18 19 20 |
# File 'lib/lhs.rb', line 16 def self.require_records Dir.glob(Rails.root.join('app/models/**/*.rb')).each do |file| require_dependency file if File.read(file).match('LHS::Record') end end |
Instance Method Details
#call(env) ⇒ Object
11 12 13 14 |
# File 'lib/lhs.rb', line 11 def call(env) self.class.require_records @app.call(env) end |