Class: Effective::Snippets::EffectiveAsset
- Inherits:
-
Snippet
- Object
- Snippet
- Effective::Snippets::EffectiveAsset
- Defined in:
- app/models/effective/snippets/effective_asset.rb
Instance Method Summary collapse
- #asset ⇒ Object
- #aws_private? ⇒ Boolean
- #is_private? ⇒ Boolean
- #private_url ⇒ Object
- #snippet_tag ⇒ Object
Instance Method Details
#asset ⇒ Object
10 11 12 |
# File 'app/models/effective/snippets/effective_asset.rb', line 10 def asset @asset ||= (Effective::Asset.where(:id => asset_id).first if asset_id) end |
#aws_private? ⇒ Boolean
26 27 28 |
# File 'app/models/effective/snippets/effective_asset.rb', line 26 def aws_private? (asset.try(:aws_acl) == EffectiveAssets::AWS_PRIVATE) end |
#is_private? ⇒ Boolean
22 23 24 |
# File 'app/models/effective/snippets/effective_asset.rb', line 22 def is_private? private_url == true end |
#private_url ⇒ Object
18 19 20 |
# File 'app/models/effective/snippets/effective_asset.rb', line 18 def private_url super || aws_private? end |
#snippet_tag ⇒ Object
14 15 16 |
# File 'app/models/effective/snippets/effective_asset.rb', line 14 def snippet_tag :span end |