Class: Assets::Evaluator
- Inherits:
-
Object
- Object
- Assets::Evaluator
- Includes:
- Adamantium
- Defined in:
- lib/assets/evaluator.rb
Overview
Rule evaluator
Instance Method Summary collapse
-
#asset ⇒ Asset
private
Return asset.
-
#body ⇒ String
private
Return body.
-
#mime ⇒ Mime
private
Return mime.
-
#sha1 ⇒ String
private
Return sha1 hexdigest of body.
-
#size ⇒ Fixnum
private
Return size in bytes.
Instance Method Details
#asset ⇒ Asset
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return asset
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/assets/evaluator.rb', line 13 def asset rule = self.rule Asset.new( :name => rule.name, :mime => rule.mime, :created_at => Time.now, :body => body, :size => size, :sha1 => sha1 ) end |
#body ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return body
41 42 43 |
# File 'lib/assets/evaluator.rb', line 41 def body rule.body end |
#mime ⇒ Mime
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return mime
62 63 64 |
# File 'lib/assets/evaluator.rb', line 62 def mime rule.mime end |
#sha1 ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return sha1 hexdigest of body
31 32 33 |
# File 'lib/assets/evaluator.rb', line 31 def sha1 Digest::SHA1.hexdigest(body) end |
#size ⇒ Fixnum
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Return size in bytes
52 53 54 |
# File 'lib/assets/evaluator.rb', line 52 def size body.bytesize end |