Sha256: 9ca085349fc1033a4071630d22c7ec29604a54a54151bca8c15a1f4564854be0

Contents?: true

Size: 783 Bytes

Versions: 3

Compression:

Stored size: 783 Bytes

Contents

require 'nugrant'
require 'nugrant/bag'
require 'nugrant/vagrant/v2/config/user'

module Nugrant
  module Vagrant
    module V2
      module Command
        class Helper
          def self.get_restricted_keys()
            bag_methods = Nugrant::Bag.instance_methods
            parameters_methods = V2::Config::User.instance_methods

            (bag_methods | parameters_methods).map(&:to_s)
          end

          def self.get_used_restricted_keys(hash, restricted_keys)
            keys = []
            hash.each do |key, value|
              keys << key if restricted_keys.include?(key)
              keys += get_used_restricted_keys(value, restricted_keys) if value.kind_of?(Hash)
            end

            keys.uniq
          end
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
nugrant-2.0.0.rc1 lib/nugrant/vagrant/v2/command/helper.rb
nugrant-2.0.0.pre2 lib/nugrant/vagrant/v2/command/helper.rb
nugrant-2.0.0.pre1 lib/nugrant/vagrant/v2/command/helper.rb