Sha256: 4b8577f661ed4c38bc133c49fede86035cde96b6bda89f9b8327708f03c6c0ce
Contents?: true
Size: 960 Bytes
Versions: 3
Compression:
Stored size: 960 Bytes
Contents
# # Author:: Celso Fernandes (<fernandes@zertico.com>) # © Copyright IBM Corporation 2015. # # LICENSE: MIT (http://opensource.org/licenses/MIT) # require 'fog/core/collection' module Fog module Softlayer class Product class Items < Fog::Collection attribute :package_id, :type => :integer model Fog::Softlayer::Product::Item def initialize(attributes = {}) super(attributes) end def all requires :package_id data = service.get_package_items(package_id).body load(data) end def get(identifier) requires :package_id return nil if identifier.nil? || identifier == "" data = service.get_package_item(package_id, identifier).body.first new.merge_attributes(data) rescue Excon::Errors::NotFound nil end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems