Class: Passifier::StaticFile
- Inherits:
-
Object
- Object
- Passifier::StaticFile
- Defined in:
- lib/passifier/static_file.rb
Overview
A single local static file asset
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#name ⇒ Object
(also: #filename)
readonly
Returns the value of attribute name.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
Instance Method Summary collapse
-
#initialize(name, path_to_file) ⇒ StaticFile
constructor
A new instance of StaticFile.
Constructor Details
#initialize(name, path_to_file) ⇒ StaticFile
Returns a new instance of StaticFile.
13 14 15 16 17 |
# File 'lib/passifier/static_file.rb', line 13 def initialize(name, path_to_file) @name = name @path = path_to_file @content = File.open(@path, 'rb') {|file| file.read } end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
8 9 10 |
# File 'lib/passifier/static_file.rb', line 8 def content @content end |
#name ⇒ Object (readonly) Also known as: filename
Returns the value of attribute name.
8 9 10 |
# File 'lib/passifier/static_file.rb', line 8 def name @name end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
8 9 10 |
# File 'lib/passifier/static_file.rb', line 8 def path @path end |