Class: Nwiki::Core::File
- Inherits:
-
Object
- Object
- Nwiki::Core::File
- Defined in:
- lib/nwiki/core/file.rb
Instance Attribute Summary collapse
-
#content_type ⇒ Object
readonly
Returns the value of attribute content_type.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(name, data) ⇒ File
constructor
A new instance of File.
Constructor Details
#initialize(name, data) ⇒ File
Returns a new instance of File.
8 9 10 11 |
# File 'lib/nwiki/core/file.rb', line 8 def initialize name, data @data = data @content_type = Rack::Mime.mime_type(::File.extname(name)) end |
Instance Attribute Details
#content_type ⇒ Object (readonly)
Returns the value of attribute content_type.
6 7 8 |
# File 'lib/nwiki/core/file.rb', line 6 def content_type @content_type end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/nwiki/core/file.rb', line 6 def data @data end |