Class: Ro::Node::Asset
- Inherits:
-
String
- Object
- String
- Ro::Node::Asset
- Defined in:
- lib/ro/node.rb
Constant Summary collapse
- IMAGE_RE =
%r/[.](jpg|jpeg|png|gif|tif|tiff)$/i
Instance Method Summary collapse
- #basename ⇒ Object
- #extension ⇒ Object (also: #ext)
- #image? ⇒ Boolean
-
#initialize(name, options = {}) ⇒ Asset
constructor
A new instance of Asset.
- #name ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ Asset
Returns a new instance of Asset.
157 158 159 160 161 162 163 164 165 166 167 168 |
# File 'lib/ro/node.rb', line 157 def initialize(name, = {}) super(name) ensure = Map.for() Asset.fattrs.each do |attr| if .has_key?(attr) value = [attr] send(attr, value) end end end |
Instance Method Details
#basename ⇒ Object
186 187 188 |
# File 'lib/ro/node.rb', line 186 def basename File.basename(path.to_s) end |
#extension ⇒ Object Also known as: ext
180 181 182 183 |
# File 'lib/ro/node.rb', line 180 def extension base, ext = basename.split('.', 2) ext end |
#name ⇒ Object
170 171 172 |
# File 'lib/ro/node.rb', line 170 def name self end |