Class: Ambient::Init

Inherits:
Object
  • Object
show all
Defined in:
lib/ambient/init.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path = nil, project_name = nil, project_prefix = nil) ⇒ Init

Returns a new instance of Init.



7
8
9
10
11
# File 'lib/ambient/init.rb', line 7

def initialize(path = nil, project_name = nil, project_prefix = nil)
  @path = path || Dir.pwd
  @project_name = project_name || "MyProject"
  @project_prefix = project_prefix || "com.#{@project_name.downcase}."
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/ambient/init.rb', line 3

def path
  @path
end

#project_nameObject (readonly)

Returns the value of attribute project_name.



3
4
5
# File 'lib/ambient/init.rb', line 3

def project_name
  @project_name
end

#project_prefixObject (readonly)

Returns the value of attribute project_prefix.



3
4
5
# File 'lib/ambient/init.rb', line 3

def project_prefix
  @project_prefix
end

Instance Method Details

#create_ambientfileObject



13
14
15
16
17
# File 'lib/ambient/init.rb', line 13

def create_ambientfile
  puts "# Creating Ambientfile..."
  write_file
  puts "File created at #{filepath}"
end