Module: Incept::Package

Included in:
MultipleOptionPackage, SingleOptionPackage
Defined in:
lib/incept/package.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(other) ⇒ Object



4
5
6
7
8
# File 'lib/incept/package.rb', line 4

def self.included(other)
  other.class_eval do
    attr_reader :selection
  end
end

Instance Method Details

#command_optionsObject



27
28
29
# File 'lib/incept/package.rb', line 27

def command_options
  template.render(:options)
end

#initialize(type, options) ⇒ Object



10
11
12
13
# File 'lib/incept/package.rb', line 10

def initialize(type, options)
  @type    = type
  @options = options
end

#render(type) ⇒ Object



23
24
25
# File 'lib/incept/package.rb', line 23

def render(type)
  template.render(type)
end

#templateObject



19
20
21
# File 'lib/incept/package.rb', line 19

def template
  @template ||= Template.new(template_path)
end

#template_pathObject



15
16
17
# File 'lib/incept/package.rb', line 15

def template_path
  File.expand_path("../../../templates/#{@type}/#{selected_package_name.downcase}", __FILE__)
end