Class: Staticz::Haml

Inherits:
Object
  • Object
show all
Includes:
Compilable
Defined in:
lib/manifest/haml.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Compilable

#build_path, #create_link_function, #exists?, #path, #path_method_name, #print, #source_path, #valid

Constructor Details

#initialize(name) ⇒ Haml

Returns a new instance of Haml.



13
14
15
# File 'lib/manifest/haml.rb', line 13

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/manifest/haml.rb', line 5

def name
  @name
end

Instance Method Details

#buildObject



17
18
19
20
21
22
23
# File 'lib/manifest/haml.rb', line 17

def build
  if exists?
    engine = ::Haml::Engine.new(File.read(source_path))

    File.write build_path, engine.render
  end
end

#build_file_endingObject



9
# File 'lib/manifest/haml.rb', line 9

def build_file_ending = "html"

#source_file_endingObject



7
# File 'lib/manifest/haml.rb', line 7

def source_file_ending = "haml"

#tile_type_nameObject



11
# File 'lib/manifest/haml.rb', line 11

def tile_type_name = "Haml"