Sha256: a0096ed8e1bf74c62563a732dbac3bf62860bf58e262de06c52c7ab217afa548

Contents?: true

Size: 691 Bytes

Versions: 41

Compression:

Stored size: 691 Bytes

Contents

require 'fog/core/collection'
require 'fog/rackspace/models/load_balancers/access_rule'

module Fog
  module Rackspace
    class LoadBalancers
      class AccessRules < Fog::Collection
        model Fog::Rackspace::LoadBalancers::AccessRule

        attr_accessor :load_balancer

        def all
          load(all_raw)
        end

        def get(access_rule_id)
          data = all_raw.select { |access_rule| access_rule['id'] == access_rule_id }.first
          data && new(data)
        end

        private
        def all_raw
          requires :load_balancer
          data = connection.list_access_rules(load_balancer.id).body['accessList']
        end
      end
    end
  end
end

Version data entries

41 entries across 41 versions & 13 rubygems

Version Path
fog-1.2.0 lib/fog/rackspace/models/load_balancers/access_rules.rb
ktheory-fog-1.1.2 lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.17.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.17.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
fog-1.1.2 lib/fog/rackspace/models/load_balancers/access_rules.rb
fog_tractical-1.1.4 lib/fog/rackspace/models/load_balancers/access_rules.rb
fog_tractical-1.1.3 lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.16.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
fog-1.1.1 lib/fog/rackspace/models/load_balancers/access_rules.rb
fog-1.1.0 lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.15.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
tag-fog-1.0.1 lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.14.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.14.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
fog-1.0.0 lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.13.1 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb
brightbox-cli-0.13.0 lib/brightbox-cli/vendor/fog/lib/fog/rackspace/models/load_balancers/access_rules.rb