Module: PathMapper::Node::Base
- Includes:
- Helpers, File, Grep, Representation
- Included in:
- Dir, Dir::Inheritance, File, Null
- Defined in:
- lib/path_mapper/node/base.rb,
lib/path_mapper/node/base/file.rb,
lib/path_mapper/node/base/grep.rb,
lib/path_mapper/node/base/representation.rb
Defined Under Namespace
Modules: File, Grep, Representation
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Attributes included from File
Instance Method Summary collapse
Methods included from Helpers
Methods included from Helper::Storage
#delete_storage_branch, #deleted_files, #storage, #storage_file_delete, #storage_file_tree, #storage_tree
Methods included from Helper::Logger
#logger, #logger=, #with_logger
Methods included from Helper::Debug
#dry_run, #dry_run=, #with_dry_run
Methods included from Representation
#any?, #bool, #dir?, #empty?, #file?, #float, #inspect, #int, #json, #lines, #nil?, #node?, #raw_value, #to_pathname, #to_s, #to_str, #value
Methods included from File
#_append!, #_create!, #_delete!, #_override!, #_put!, #_remove_line!, #_rename!, #_safe_put!, #check, #compare_with, #custom_diff, #diff, #md5, #method_missing
Methods included from Grep
#grep, #grep_dirs, #grep_files
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class PathMapper::Node::Base::File
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/path_mapper/node/base.rb', line 10 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
9 10 11 |
# File 'lib/path_mapper/node/base.rb', line 9 def path @path end |
Instance Method Details
#initialize(path, **kwargs) ⇒ Object
12 13 14 15 |
# File 'lib/path_mapper/node/base.rb', line 12 def initialize(path, **kwargs) @path = Pathname.new(path) @name = @path.basename.to_s end |
#parent ⇒ Object
17 18 19 |
# File 'lib/path_mapper/node/base.rb', line 17 def parent self._create_node(@path.parent) end |