Class: Staticz::Compilable::SimpleFile

Inherits:
Object
  • Object
show all
Includes:
Staticz::Compilable
Defined in:
lib/manifest/compilable/simple_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Staticz::Compilable

#errors, #exists?, #path, #print, #valid?

Constructor Details

#initialize(name) ⇒ SimpleFile

Returns a new instance of SimpleFile.



27
28
29
# File 'lib/manifest/compilable/simple_file.rb', line 27

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/manifest/compilable/simple_file.rb', line 8

def name
  @name
end

Instance Method Details

#buildObject



31
32
33
34
35
# File 'lib/manifest/compilable/simple_file.rb', line 31

def build
  if exists?
    File.write build_path, File.read(source_path)
  end
end

#build_pathObject



14
15
16
# File 'lib/manifest/compilable/simple_file.rb', line 14

def build_path
  "build/#{name}"
end


18
19
# File 'lib/manifest/compilable/simple_file.rb', line 18

def create_link_function
end

#path_method_nameObject



21
22
23
# File 'lib/manifest/compilable/simple_file.rb', line 21

def path_method_name
  "no path created"
end

#source_pathObject



10
11
12
# File 'lib/manifest/compilable/simple_file.rb', line 10

def source_path
  "src/#{name}"
end

#tile_type_nameObject



25
# File 'lib/manifest/compilable/simple_file.rb', line 25

def tile_type_name = "File"