Class: Pansophy::Local::File
- Inherits:
-
Object
- Object
- Pansophy::Local::File
- Includes:
- Adamantium::Flat
- Defined in:
- lib/pansophy/local/file.rb
Instance Attribute Summary collapse
-
#pathname ⇒ Object
readonly
Returns the value of attribute pathname.
Instance Method Summary collapse
- #body ⇒ Object
-
#initialize(path) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(path) ⇒ File
Returns a new instance of File.
8 9 10 |
# File 'lib/pansophy/local/file.rb', line 8 def initialize(path) @pathname = Pathname.new(path) end |
Instance Attribute Details
#pathname ⇒ Object (readonly)
Returns the value of attribute pathname.
6 7 8 |
# File 'lib/pansophy/local/file.rb', line 6 def pathname @pathname end |
Instance Method Details
#body ⇒ Object
12 13 14 15 |
# File 'lib/pansophy/local/file.rb', line 12 def body return nil unless @pathname.exist? ::File.read(@pathname) end |