Sha256: b6faf4d6b6dfe0cbab566f7ea9f068bfbd8cbe9c9faa4f1a1a0b8ea6b954d6a5

Contents?: true

Size: 414 Bytes

Versions: 2

Compression:

Stored size: 414 Bytes

Contents

require "app_store/base"

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 => @client.get(@url)['item-metadata']
    else
      raise 'unsupported'
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
app_store-0.1.2 lib/app_store/link.rb
app_store-0.1.0 lib/app_store/link.rb