Class: Lotus::Config::Mapper Private

Inherits:
Object
  • Object
show all
Defined in:
lib/lotus/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.

Define a mapping for Lotus::Model

Since:

  • 0.1.0

Direct Known Subclasses

Configure, Mapping, Routes

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.

Since:

  • 0.1.0

'.rb'

Instance Method Summary collapse

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.

Since:

  • 0.1.0



12
13
14
15
# File 'lib/lotus/config/mapper.rb', line 12

def initialize(root, path, &blk)
  @path, @blk = path, blk
  @path = root.join(path) if root && path
end

Instance Method Details

#to_procObject

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.

Since:

  • 0.1.0



17
18
19
20
21
22
# File 'lib/lotus/config/mapper.rb', line 17

def to_proc
  return @blk if @blk

  code = realpath.read
  Proc.new { eval(code) }
end