Class: PointRb::LayoutFile
- Inherits:
-
Object
- Object
- PointRb::LayoutFile
- Includes:
- Comparable
- Defined in:
- lib/pointrb/layout_file.rb
Overview
layouts
Instance Attribute Summary collapse
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #content ⇒ Object
-
#initialize(path) ⇒ LayoutFile
constructor
A new instance of LayoutFile.
Constructor Details
#initialize(path) ⇒ LayoutFile
Returns a new instance of LayoutFile.
10 11 12 13 14 |
# File 'lib/pointrb/layout_file.rb', line 10 def initialize(path) raise Exceptions::FileNotFound, "You tell me to use '#{path}' as path to the layout. But this file does not exist." unless File.exists? path @path = path end |
Instance Attribute Details
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/pointrb/layout_file.rb', line 8 def path @path end |
Instance Method Details
#<=>(other) ⇒ Object
20 21 22 |
# File 'lib/pointrb/layout_file.rb', line 20 def <=>(other) self.path <=> other.path end |
#content ⇒ Object
16 17 18 |
# File 'lib/pointrb/layout_file.rb', line 16 def content File.read(@path) end |