Sha256: b1db95209294a3649e72956375b92d1dc5275196b65ec94fd6583e9fc07f73f2

Contents?: true

Size: 569 Bytes

Versions: 31

Compression:

Stored size: 569 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) == 'authenticated-read')
        end

      end
    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
effective_assets-1.6.2 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.1 app/models/effective/snippets/effective_asset.rb
effective_assets-1.6.0 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.9 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.8 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.7 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.6 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.5 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.4 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.3 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.2 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.1 app/models/effective/snippets/effective_asset.rb
effective_assets-1.5.0 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.9 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.8 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.7 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.6 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.5 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.4 app/models/effective/snippets/effective_asset.rb
effective_assets-1.4.3 app/models/effective/snippets/effective_asset.rb