Class: Nwiki::Core::File

Inherits:
Object
  • Object
show all
Defined in:
lib/nwiki/core/file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_typeObject (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

#dataObject (readonly)

Returns the value of attribute data.



6
7
8
# File 'lib/nwiki/core/file.rb', line 6

def data
  @data
end