Class: Templater::Actions::Action

Inherits:
Object
  • Object
show all
Defined in:
lib/templater/actions/action.rb

Direct Known Subclasses

EmptyDirectory, File, Template

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#destinationObject

Returns the value of attribute destination.



5
6
7
# File 'lib/templater/actions/action.rb', line 5

def destination
  @destination
end

#generatorObject

Returns the value of attribute generator.



5
6
7
# File 'lib/templater/actions/action.rb', line 5

def generator
  @generator
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/templater/actions/action.rb', line 5

def name
  @name
end

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/templater/actions/action.rb', line 5

def options
  @options
end

#sourceObject

Returns the value of attribute source.



5
6
7
# File 'lib/templater/actions/action.rb', line 5

def source
  @source
end

Instance Method Details

#relative_destinationObject

Returns the destination path relative to Dir.pwd. This is useful for prettier output in interfaces where the destination root is Dir.pwd.

Returns

String

The destination relative to Dir.pwd



24
25
26
# File 'lib/templater/actions/action.rb', line 24

def relative_destination
  @destination.relative_path_from(@generator.destination_root)
end