Sha256: 2ffa6460ad650106705cd1203ecc68ecfbc505a94dfed44772ccc468630b8a24

Contents?: true

Size: 452 Bytes

Versions: 3

Compression:

Stored size: 452 Bytes

Contents

require "app_store/base"
require "app_store/caller"

class AppStore::Link < AppStore::Base
  plist :mapping => {
    'link-type'   => :item_type,
    'item-id'     => :item_id,
    'title'       => :title,
    'url'         => :url
  }
  
  def destination
    @destination ||= case @item_type
    when 'software'
      AppStore::Application.new :plist => AppStore::Caller.get(@url)['item-metadata']
    else
      raise 'unsupported'
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
app_store-0.0.4 lib/app_store/link.rb
app_store-0.0.3 lib/app_store/link.rb
app_store-0.0.1 lib/app_store/link.rb