Class: Mattock::Configurable::DirectoryStructure::StructurePath
- Inherits:
-
Object
- Object
- Mattock::Configurable::DirectoryStructure::StructurePath
- Includes:
- Mattock::Configurable
- Defined in:
- lib/mattock/configurable/directory-structure.rb
Constant Summary
Constants included from Mattock::Configurable
Instance Method Summary collapse
-
#initialize(rel_path) ⇒ StructurePath
constructor
A new instance of StructurePath.
- #inspect ⇒ Object
- #pathname ⇒ Object (also: #path_name)
Methods included from Mattock::Configurable
#check_required, #copy_settings, #copy_settings_to, #fail_unless_set, #field_unset?, #proxy_settings, #proxy_settings_to, #proxy_value, #setup_defaults, #to_hash, #unset?, #unset_defaults_guard, unset_defaults_guard
Methods included from ClassMethods
#default_value_for, #default_values, #field_metadata, #field_names, #included, #inspect_instance, #missing_required_fields_on, #nested, #nil_fields, #required_fields, #runtime_required_fields, #runtime_setting, #set_defaults_on, #setting, #settings, #to_hash
Constructor Details
#initialize(rel_path) ⇒ StructurePath
Returns a new instance of StructurePath.
19 20 21 |
# File 'lib/mattock/configurable/directory-structure.rb', line 19 def initialize(rel_path) self.relative_path = rel_path unless rel_path == Configurable::RequiredField end |
Instance Method Details
#inspect ⇒ Object
33 34 35 36 37 38 39 40 41 |
# File 'lib/mattock/configurable/directory-structure.rb', line 33 def inspect "<path: #{ if unset?(:absolute_path) "<<?>>/#{relative_path.inspect}" else absolute_path.inspect end }>" end |
#pathname ⇒ Object Also known as: path_name
23 24 25 26 27 28 29 30 |
# File 'lib/mattock/configurable/directory-structure.rb', line 23 def pathname @pathname ||= begin fail_unless_set(:absolute_path) require 'pathname' Pathname.new(absolute_path) end end |