Class: Xing::CLI::Templaters::Templater

Inherits:
Object
  • Object
show all
Includes:
Architecture
Defined in:
lib/xing/cli/templaters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(target_name, context, guard = false) ⇒ Templater

Returns a new instance of Templater.



9
10
11
12
13
# File 'lib/xing/cli/templaters.rb', line 9

def initialize(target_name, context, guard = false)
  @target_name = target_name
  @context = context
  @guard = guard
end

Instance Attribute Details

#contextObject (readonly)

Returns the value of attribute context.



15
16
17
# File 'lib/xing/cli/templaters.rb', line 15

def context
  @context
end

#guardObject (readonly)

Returns the value of attribute guard.



15
16
17
# File 'lib/xing/cli/templaters.rb', line 15

def guard
  @guard
end

#target_nameObject (readonly)

Returns the value of attribute target_name.



15
16
17
# File 'lib/xing/cli/templaters.rb', line 15

def target_name
  @target_name
end

Instance Method Details

#templateObject



17
18
19
20
21
22
23
24
# File 'lib/xing/cli/templaters.rb', line 17

def template
  if !guard
    architecture source: File.expand_path('../../../../default_configuration/templates/', __FILE__),
      destination: target_name  do |arc|
      template_files(arc)
    end
  end
end