Class: Web::Wiki::Page::Asset

Inherits:
String
  • Object
show all
Defined in:
lib/web/wiki/page.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(newowner, newpath) ⇒ Asset

Returns a new instance of Asset.



129
130
131
132
# File 'lib/web/wiki/page.rb', line 129

def initialize(newowner, newpath)
  self.owner = newowner
  super( newpath )
end

Instance Attribute Details

#ownerObject

Returns the value of attribute owner.



128
129
130
# File 'lib/web/wiki/page.rb', line 128

def owner
  @owner
end

Instance Method Details

#sizeObject



134
135
136
# File 'lib/web/wiki/page.rb', line 134

def size
  File.size( File.join( owner.dir, self ) )
end

#thumbnailObject



138
139
140
141
142
143
144
# File 'lib/web/wiki/page.rb', line 138

def thumbnail
  if (size > 102400)
    "#{self} (<i>#{size} bytes</i>)"
  else
    "<img src='#{owner.download_link}#{self}' border=0 width=100><br>#{self}"
  end
end