Sha256: 8f02cc4b04f02c4501a98133e0065d76f9848983143c9927c728cfc7e21ed26f

Contents?: true

Size: 802 Bytes

Versions: 108

Compression:

Stored size: 802 Bytes

Contents

require 'fog/core/collection'
require 'fog/linode/models/compute/stack_script'

module Fog
  module Compute
    class Linode
      class StackScripts < Fog::Collection
        model Fog::Compute::Linode::StackScript

        def all
          load stackscripts
        end

        def get(id)
          new stackscripts(id).first
        rescue Fog::Compute::Linode::NotFound
          nil
        end

        private
        def stackscripts(id=nil)
          service.stackscript_list(id).body['DATA'].map { |script| map_stackscript script }
        end

        def map_stackscript(script)
          script = script.each_with_object({}) { |(k, v), h| h[k.downcase.to_sym] = v  }
          script.merge! :id => script[:stackscriptid], :name => script[:label]
        end
      end
    end
  end
end

Version data entries

108 entries across 106 versions & 11 rubygems

Version Path
fog-2.3.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-ifeel-2.2.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-2.2.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-2.1.0 lib/fog/linode/models/compute/stack_scripts.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-1.42.1/lib/fog/linode/models/compute/stack_scripts.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-1.42.1/lib/fog/linode/models/compute/stack_scripts.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-1.42.1/lib/fog/linode/models/compute/stack_scripts.rb
fog-1.42.1 lib/fog/linode/models/compute/stack_scripts.rb
fog-2.0.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.42.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.41.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.40.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.39.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.38.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.37.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.36.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-1.35.0 lib/fog/linode/models/compute/stack_scripts.rb
fog-2.0.0.pre.0 lib/fog/linode/models/compute/stack_scripts.rb
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-1.32.0/lib/fog/linode/models/compute/stack_scripts.rb
fog-1.34.0 lib/fog/linode/models/compute/stack_scripts.rb