Skip to content

Instantly share code, notes, and snippets.

class Claim
attr_accessor :claim_array
def initialize(claim_array, claim_ext)
@claim_array = claim_array
@claim_ext = claim_ext
@replacement_first_name = "JOHN"
@replacement_last_name = "DOE"
@replacement_full_name = "DOE, JOHN"
require 'uri'
puts "What is the string to encode?"
encode_string = URI.escape(gets)
puts encode_string
insurance_hash = {'Select Health' => 'Select'}
insurance_array = ["Select Health", "Select Health New York", "Select Health Colorado"]
insurance_hash.fetch(insurance_array[3], "unknown")
#I want it to return "Select", not unknown, without specifically adding it to the hash..
# (to check for anything that ever says 'Select Health' in the name, and always return that 'Select')
puts("What is the first number?")
first_num = gets.to_f
puts("What is the second number?")
second_num = gets.to_f
puts("What is the max number?")
max_num = gets.to_f
puts "\n"
puts "Your values are:"
sum = 0
sum = 0
(1...1000).each do |i|
if i % 3 == 0 || i % 5 == 0
sum += i
puts sum
end
end
def dir_rename
dir = Dir.open(__dir__)
puts "Renaming folders..."
dir.each do |file|
next if File.file?(file)
if File.directory?(file)
base_name = File.basename(file)
next if base_name.start_with?('11')
next if base_name.start_with?('--')
if base_name.include?(" ")
def dir_rename
dir = Dir.open(__dir__)
puts "Renaming folders..."
dir.each do |file|
next if File.file?(file)
if File.directory?(file)
base_name = File.basename(file)
next if base_name.start_with?('11')
next if base_name.start_with?('--')
if base_name.include?(" ")
num1 = 3
num2 = 5
sum = 0
while sum < 99999
sum = num1 + num2
print sum
num1 += 3
num2 += 5
require 'pp'
test1 = "ABCDXYZ"
test2 = "ZYXDCBA"
if test1.length == test2.length
puts "Wrong" if test1.chars.sort.join != b.chars.sort.join
else
pp "not the same length"
exit
class Email
attr_accessor :is_set,
:alert_name,
:from,
:to,
:subject,
:priority,
:include_trigger,
:include_trigger_time,