Class: Potion::Layout
- Inherits:
-
Object
- Object
- Potion::Layout
- Defined in:
- lib/potion/layout.rb
Instance Attribute Summary collapse
-
#content ⇒ Object
Returns the value of attribute content.
-
#name ⇒ Object
Returns the value of attribute name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#site ⇒ Object
Returns the value of attribute site.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(path, site) ⇒ Layout
constructor
A new instance of Layout.
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
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/potion/layout.rb', line 3 def content @content end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/potion/layout.rb', line 3 def name @name end |
#path ⇒ Object
Returns the value of attribute path.
3 4 5 |
# File 'lib/potion/layout.rb', line 3 def path @path end |
#site ⇒ Object
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 |