Class: PointRb::LayoutFile

Inherits:
Object
  • Object
show all
Includes:
Comparable
Defined in:
lib/pointrb/layout_file.rb

Overview

layouts

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#pathObject (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

#contentObject



16
17
18
# File 'lib/pointrb/layout_file.rb', line 16

def content
  File.read(@path)
end