This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Shoutout | |
%w(yo yoyo yoyoma).each do |action| | |
define_method("perform_#{action}") do |argument| | |
"performing #{action.gsub('_', ' ')}" | |
end | |
end | |
end | |
shout = Shoutout.new | |
puts shout.yo() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@alphabet = [" ","a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", | |
"m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"] | |
def encrypt(message) | |
key_length = message.length | |
message.downcase.split("").map! { |x| | |
idx_number = @alphabet.index(x) | |
finish = idx_number.to_i + key_length.to_i | |
unless finish < 27 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module SurveysToBeTaken | |
def survey_index | |
@today = Date.today.strftime("%m/%d/%Y") | |
# Take all surveys and only fetch current_users results. This also checks | |
map_survey_ids = Survey.pluck(:id) | |
user = params[:user_id].present? ? params[:user_id] : current_user.id |