Module: Roebe::GUI::InteractiveCaesarCipherModule
Overview
Roebe::GUI::InteractiveCaesarCipherModule
Constant Summary
collapse
- WIDTH =
#
Roebe::GUI::InteractiveCaesarCipherModule::WIDTH
#
'55% or minimum 500px'
- HEIGHT =
#
Roebe::GUI::InteractiveCaesarCipherModule::HEIGHT
#
'15% or minimum 400px'
- CSS_SMALL_BORDER =
#
Roebe::GUI::InteractiveCaesarCipherModule::CSS_SMALL_BORDER
#
'
.small_border {
border-bottom: 4px;
border-width: 5px 0 4px 5px;
color: darkblue;
}
'
- TITLE =
'Interactive Caesar Cipher'
- USE_THIS_FONT =
:dejavu_condensed_21
- LARGER_FONT =
:dejavu_condensed_24
- HELPER_TEXT_FOR_THE_MAIN_HEADER_LABEL =
#
HELPER_TEXT_FOR_THE_MAIN_HEADER_LABEL
#
"The method is named after <b>Julius Caesar</b>, who is said "\
"to have used it in his private correspondence.\n\n"\
"Note that this original cipher refers to shifting each "\
"letter of the message by three letters to the right. "\
"This will then produce the so-called <b>ciphertext</b>."
- ALPHABET =
('A' .. 'Z').to_a
Instance Method Summary
collapse
-
#add_to_array_entries(i) ⇒ Object
# === add_to_array_entries ========================================================================= #.
-
#array_entries? ⇒ Boolean
# === array_entries? ========================================================================= #.
-
#border_size? ⇒ Boolean
# === border_size? ========================================================================= #.
-
#entry2? ⇒ Boolean
# === entry2? ========================================================================= #.
-
#last_entry? ⇒ Boolean
# === last_entry? ========================================================================= #.
-
#padding? ⇒ Boolean
# === padding? ========================================================================= #.
-
#reset_the_shared_module ⇒ Object
# === reset_the_shared_module (reset tag) ========================================================================= #.
-
#return_text1 ⇒ Object
# === return_text1 ========================================================================= #.
-
#return_text2 ⇒ Object
# === return_text2 ========================================================================= #.
-
#return_text3 ⇒ Object
# === return_text3 ========================================================================= #.
-
#set_top_right_entry(i) ⇒ Object
# === set_top_right_entry ========================================================================= #.
-
#title? ⇒ Boolean
# === title? ========================================================================= #.
-
#top_left_entry? ⇒ Boolean
(also: #entry1?)
# === top_left_entry? ========================================================================= #.
Instance Method Details
#add_to_array_entries(i) ⇒ Object
85
86
87
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 85
def add_to_array_entries(i)
@array_entries << i
end
|
#array_entries? ⇒ Boolean
92
93
94
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 92
def array_entries?
@array_entries
end
|
#border_size? ⇒ Boolean
120
121
122
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 120
def border_size?
2
end
|
#entry2? ⇒ Boolean
167
168
169
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 167
def entry2?
@array_entries[1]
end
|
#last_entry? ⇒ Boolean
153
154
155
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 153
def last_entry?
@array_entries.last
end
|
#padding? ⇒ Boolean
113
114
115
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 113
def padding?
6
end
|
#reset_the_shared_module ⇒ Object
#
reset_the_shared_module (reset tag)
#
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 70
def reset_the_shared_module
initialize_various_objects
@array_spin_buttons = []
@array_entries = []
end
|
#return_text1 ⇒ Object
127
128
129
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 127
def return_text1
text('plaintext')
end
|
#return_text2 ⇒ Object
134
135
136
137
138
139
140
141
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 134
def return_text2
text_modifier = text('modifier')
text_modifier.hint = 'Set the modifier variant in the '\
'entry below this text. For instance, a +1 means that all '\
'characters in the entry to the left will be shifted '\
'upwards +1 in the alphabet.'
return text_modifier
end
|
#return_text3 ⇒ Object
146
147
148
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 146
def return_text3
text('ciphertext')
end
|
#set_top_right_entry(i) ⇒ Object
174
175
176
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 174
def set_top_right_entry(i)
@array_entries[1].set_text(i.to_s)
end
|
#title? ⇒ Boolean
106
107
108
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 106
def title?
TITLE
end
|
#top_left_entry? ⇒ Boolean
Also known as:
entry1?
99
100
101
|
# File 'lib/roebe/gui/shared_code/interactive_caesar_cipher/interactive_caesar_cipher_module.rb', line 99
def top_left_entry?
@array_entries.first
end
|