Class: Dapp::Dimg::Config::Directive::Mount
- Inherits:
-
Base
- Object
- Config::Directive::Base
- Base
- Dapp::Dimg::Config::Directive::Mount
- Defined in:
- lib/dapp/dimg/config/directive/mount.rb
Instance Attribute Summary collapse
-
#_from ⇒ Object
readonly
Returns the value of attribute _from.
-
#_to ⇒ Object
readonly
Returns the value of attribute _to.
-
#_type ⇒ Object
readonly
Returns the value of attribute _type.
Instance Method Summary collapse
- #from(type) ⇒ Object
- #from_path(path) ⇒ Object
-
#initialize(to, **kwargs, &blk) ⇒ Mount
constructor
A new instance of Mount.
- #validate! ⇒ Object
Methods inherited from Base
Methods inherited from Config::Directive::Base
Constructor Details
#initialize(to, **kwargs, &blk) ⇒ Mount
Returns a new instance of Mount.
10 11 12 13 14 15 |
# File 'lib/dapp/dimg/config/directive/mount.rb', line 10 def initialize(to, **kwargs, &blk) raise Error::Config, code: :mount_to_absolute_path_required unless Pathname((to = to.to_s)).absolute? @_to = path_format(to) super(**kwargs, &blk) end |
Instance Attribute Details
#_from ⇒ Object (readonly)
Returns the value of attribute _from.
7 8 9 |
# File 'lib/dapp/dimg/config/directive/mount.rb', line 7 def _from @_from end |
#_to ⇒ Object (readonly)
Returns the value of attribute _to.
6 7 8 |
# File 'lib/dapp/dimg/config/directive/mount.rb', line 6 def _to @_to end |
#_type ⇒ Object (readonly)
Returns the value of attribute _type.
8 9 10 |
# File 'lib/dapp/dimg/config/directive/mount.rb', line 8 def _type @_type end |
Instance Method Details
#from(type) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/dapp/dimg/config/directive/mount.rb', line 17 def from(type) sub_directive_eval do type = type.to_sym raise Error::Config, code: :mount_from_type_required unless [:tmp_dir, :build_dir].include? type @_type = type end end |
#from_path(path) ⇒ Object
25 26 27 28 29 30 |
# File 'lib/dapp/dimg/config/directive/mount.rb', line 25 def from_path(path) sub_directive_eval do @_from = path_format(path) @_type = :custom_dir end end |