Class: Amiba::Source::Partial

Inherits:
Object
  • Object
show all
Includes:
Amiba::Source
Defined in:
lib/amiba/source/partial.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Amiba::Source

included

Constructor Details

#initialize(path) ⇒ Partial

Returns a new instance of Partial.



9
10
11
# File 'lib/amiba/source/partial.rb', line 9

def initialize(path)
  self.dir, self.name = File.split path
end

Instance Attribute Details

#dirObject

Returns the value of attribute dir.



8
9
10
# File 'lib/amiba/source/partial.rb', line 8

def dir
  @dir
end

#nameObject

Returns the value of attribute name.



8
9
10
# File 'lib/amiba/source/partial.rb', line 8

def name
  @name
end

Instance Method Details

#filenameObject Also known as: output_filename



13
14
15
# File 'lib/amiba/source/partial.rb', line 13

def filename 
  @filename ||= File.join("pages", @dir, "_#{@name}.haml")
end