Class: Effective::Snippets::EffectiveAsset

Inherits:
Snippet
  • Object
show all
Defined in:
app/models/effective/snippets/effective_asset.rb

Instance Method Summary collapse

Instance Method Details

#assetObject



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

Returns:

  • (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

Returns:

  • (Boolean)


22
23
24
# File 'app/models/effective/snippets/effective_asset.rb', line 22

def is_private?
  private_url == true
end

#private_urlObject



18
19
20
# File 'app/models/effective/snippets/effective_asset.rb', line 18

def private_url
  super || aws_private?
end

#snippet_tagObject



14
15
16
# File 'app/models/effective/snippets/effective_asset.rb', line 14

def snippet_tag
  :span
end