Sha256: ce58e88a4542530b28dcf437e694f965cff1f0324cd3d3b106ffd9d6e03a2f03

Contents?: true

Size: 569 Bytes

Versions: 9

Compression:

Stored size: 569 Bytes

Contents

# frozen_string_literal: true

module CloudParty
  module Responses
    module Node
      class Permissions
        def initialize(hsh)
          perms = []
          hsh.each do |name, values|
            perm_values = values.keys.select! { |val| values[val] }
            perms << "#{name} -> #{perm_values.nil? ? 'none' : perm_values.join(', ')}"
          end
          @list = perms
        end

        attr_reader :list

        def to_s
          "#<Permissions: #{list}>"
        end

        def inspect
          to_s
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
cloud_party-0.1.7 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.6 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.5 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.4 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.3 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.2 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.1 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.1.pre.alpha.1 lib/cloud_party/responses/nodes/memberships/permissions.rb
cloud_party-0.1.0.pre.pre.1 lib/cloud_party/responses/nodes/memberships/permissions.rb