Class: Potion::Layout

Inherits:
Object
  • Object
show all
Defined in:
lib/potion/layout.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, site) ⇒ Layout

Returns a new instance of Layout.



5
6
7
8
9
10
# File 'lib/potion/layout.rb', line 5

def initialize(path, site)
  @path     = path
  @site     = site
  @name     = File.split(@path)[1].gsub(File.extname(@path), "")
  @content  = File.open(@path) {|stream| stream.read }
end

Instance Attribute Details

#contentObject

Returns the value of attribute content.



3
4
5
# File 'lib/potion/layout.rb', line 3

def content
  @content
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/potion/layout.rb', line 3

def name
  @name
end

#pathObject

Returns the value of attribute path.



3
4
5
# File 'lib/potion/layout.rb', line 3

def path
  @path
end

#siteObject

Returns the value of attribute site.



3
4
5
# File 'lib/potion/layout.rb', line 3

def site
  @site
end

Instance Method Details

#==(other) ⇒ Object



12
13
14
15
# File 'lib/potion/layout.rb', line 12

def ==(other)
  @path == other.path &&
  @site == other.site
end