Sha256: 7115bd20c1acfd755603ba990296c1994db35dcb31233f82f4bf796878aca4fe

Contents?: true

Size: 691 Bytes

Versions: 14

Compression:

Stored size: 691 Bytes

Contents

if defined?(EffectiveRegions)
  module Effective
    module Snippets
      class EffectiveAsset < Snippet
        attribute :asset_id, Integer
        attribute :html_class, String
        attribute :link_title, String
        attribute :private_url, Boolean

        def asset
          @asset ||= (Effective::Asset.where(:id => asset_id).first if asset_id)
        end

        def snippet_tag
          :span
        end

        def private_url
          super || aws_private?
        end

        def is_private?
          private_url == true
        end

        def aws_private?
          (asset.try(:aws_acl) == EffectiveAssets::AWS_PRIVATE)
        end

      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
effective_assets-1.10.1 app/models/effective/snippets/effective_asset.rb
effective_assets-1.10.0 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.14 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.13 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.12 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.11 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.10 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.9 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.8 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.7 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.6 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.5 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.4 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.3 app/models/effective/snippets/effective_asset.rb