Class: Thor::Tree::Directory

Inherits:
Thor
  • Object
show all
Includes:
Actions
Defined in:
lib/thor/tree/directory.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args, options = {}, config = {}) ⇒ Directory

Returns a new instance of Directory.



15
16
17
18
19
# File 'lib/thor/tree/directory.rb', line 15

def initialize(args, options = {}, config = {})
  @path = Path.new args.first.to_s
  super
  self.destination_root = Writer.root_path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



6
7
8
# File 'lib/thor/tree/directory.rb', line 6

def path
  @path
end

Class Method Details

.===(args) ⇒ Object



9
10
11
12
# File 'lib/thor/tree/directory.rb', line 9

def ===(args)
  args.is_a?(Hash) &&
  (args.empty? || args.keys.all? { |key| key.start_with?(':') == false })
end