Class: Hanami::Config::Mapper Private
- Inherits:
-
Object
- Object
- Hanami::Config::Mapper
- Defined in:
- lib/hanami/config/mapper.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Block or file mapper
Direct Known Subclasses
Constant Summary collapse
- EXTNAME =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
'.rb'
Instance Method Summary collapse
-
#initialize(root, path, &blk) ⇒ Mapper
constructor
private
A new instance of Mapper.
- #to_proc ⇒ Object private
Constructor Details
#initialize(root, path, &blk) ⇒ Mapper
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Mapper.
17 18 19 20 |
# File 'lib/hanami/config/mapper.rb', line 17 def initialize(root, path, &blk) @path, @blk = path, blk @path = root.join(path) if root && path end |
Instance Method Details
#to_proc ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 27 28 29 |
# File 'lib/hanami/config/mapper.rb', line 24 def to_proc return @blk if @blk code = realpath.read Proc.new { eval(code) } end |