Class: Web::Wiki::Page::Asset
Overview
:nodoc:
Instance Attribute Summary collapse
-
#owner ⇒ Object
Returns the value of attribute owner.
Instance Method Summary collapse
-
#initialize(newowner, newpath) ⇒ Asset
constructor
A new instance of Asset.
- #size ⇒ Object
- #thumbnail ⇒ Object
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
#owner ⇒ Object
Returns the value of attribute owner.
128 129 130 |
# File 'lib/web/wiki/page.rb', line 128 def owner @owner end |
Instance Method Details
#size ⇒ Object
134 135 136 |
# File 'lib/web/wiki/page.rb', line 134 def size File.size( File.join( owner.dir, self ) ) end |
#thumbnail ⇒ Object
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 |