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 |
# File 'lib/assets/evaluator.rb', line 13 def asset 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
40 41 42 |
# File 'lib/assets/evaluator.rb', line 40 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
61 62 63 |
# File 'lib/assets/evaluator.rb', line 61 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
30 31 32 |
# File 'lib/assets/evaluator.rb', line 30 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
51 52 53 |
# File 'lib/assets/evaluator.rb', line 51 def size body.bytesize end |