Sha256: 080d26d7aa7b81daee5ce0d3a8d47a129c499d8aefbad35e8ada0088f68dbd46

Contents?: true

Size: 577 Bytes

Versions: 19

Compression:

Stored size: 577 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 is_private?
          private_url == true || (asset.try(:aws_acl) == EffectiveAssets::AWS_PRIVATE)
        end

      end
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
effective_assets-1.9.2 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.1 app/models/effective/snippets/effective_asset.rb
effective_assets-1.9.0 app/models/effective/snippets/effective_asset.rb
effective_assets-1.8.0 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.7 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.6 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.5 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.4 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.3 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.2 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.1 app/models/effective/snippets/effective_asset.rb
effective_assets-1.7.0 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.9 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.8 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.7 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.6 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.5 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.4 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.3 app/models/effective/snippets/effective_asset.rb