Sha256: 720ab4e712df56adff0342f512a12b29e993a42199a7b86cf8cb07efbc2972c1

Contents?: true

Size: 705 Bytes

Versions: 14

Compression:

Stored size: 705 Bytes

Contents

#
# Author:: Matheus Francisco Barra Mina (<mfbmina@gmail.com>)
# © Copyright IBM Corporation 2015.
#
# LICENSE: MIT (http://opensource.org/licenses/MIT)
#

require 'fog/softlayer/models/account/brand'

module Fog
  module Account
    class Softlayer
      class Brands < Fog::Collection
        model Fog::Account::Softlayer::Brand

        def all
          data = service.get_account_owned_brands
          load(data)
        end

        def get(identifier)
          return nil if identifier.nil? || identifier == ""
          data = service.get_brand(identifier).body
          new.merge_attributes(data)
        rescue Excon::Errors::NotFound
          nil
        end
      end
    end
  end
end

Version data entries

14 entries across 12 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/account/brands.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/account/brands.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.1.4 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.1.3 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.1.2 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.1.1 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.1.0 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.0.3 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.0.2 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.0.1 lib/fog/softlayer/models/account/brands.rb
fog-softlayer-1.0.0 lib/fog/softlayer/models/account/brands.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/lib/fog/softlayer/models/account/brands.rb
fog-softlayer-0.4.7 lib/fog/softlayer/models/account/brands.rb