module Cxxproject::Context
Public Instance Methods
check_hash(hash,allowed)
click to toggle source
# File lib/cxxproject/context.rb, line 4 def check_hash(hash,allowed) hash.keys.map do |k| error_string = ["error while evaluating \"#{@current_working_dir}/#{@current_project_file}\"", "\"#{k}\" is not a valid specifier!", "allowed specifiers: #{allowed}"].join($/) raise error_string unless allowed.include?(k) end end
get_as_array(hash, s)
click to toggle source
# File lib/cxxproject/context.rb, line 13 def get_as_array(hash, s) res = hash[s] if res.is_a?(Array) return res end return [res] end