class |
Create a Ruby class with an initialize method. |
def |
Define a Ruby method. |
if |
Create an if statement. |
while |
Create a while loop. |
each |
Iterate over a collection using each. |
case |
Create a case statement. |
module |
Create a Ruby module. |
const |
Define a constant in Ruby. |
begin |
Create a begin-rescue block for exception handling. |
lambda |
Create a Ruby lambda. |
arr |
Declare a Ruby array. |
hash |
Declare a Ruby hash. |
getter |
Create a getter method. |
setter |
Create a setter method. |
initialize |
Initialize method with arguments. |
inherit |
Create a subclass in Ruby. |
time_now |
Get the current time. |
interpolate |
String interpolation in Ruby. |
puts |
Print a message to the console. |
read_file |
Read the entire contents of a file. |
read_file_lines |
Read a file line by line. |
write_file |
Write content to a file. |
append_file |
Append content to a file. |
file_exists |
Check if a file exists. |
mkdir |
Create a new directory. |
delete_file |
Delete a file. |
read_json |
Read a JSON file. |
write_json |
Write data as JSON to a file. |
copy_file |
Copy a file to a new location. |
move_file |
Move a file to a new location. |
read_csv |
Read a CSV file. |
write_csv |
Write data to a CSV file. |
read_text |
Read a text file. |
write_text |
Write content to a text file. |
file_size |
Get the size of a file. |
find_by_id |
Find a record by its ID. |
find_by |
Find a record by a specific attribute. |
where |
Query records with a where clause. |
update_attr |
Update an attribute of a record. |
destroy |
Destroy a record. |
create |
Create a new record. |
all_records |
Fetch all records of a model. |
count |
Count the number of records. |
first |
Fetch the first record of a model. |
last |
Fetch the last record of a model. |
find_by_ids |
Find records by an array of IDs. |
order |
Order records by a specific attribute. |
limit |
Limit the number of records fetched. |
group |
Group records by a specific attribute. |
pluck |
Select a specific attribute from records. |
find_or_create |
Find a record or create it if it doesn't exist. |
associations |
Define associations between models. |
regex_email |
Regular expression to match an email address. |
regex_phone |
Regular expression to match a phone number. |
regex_url |
Regular expression to match a URL. |
regex_date |
Regular expression to match a date in YYYY-MM-DD format. |
regex_time |
Regular expression to match time in HH:MM or HH:MM:SS format. |
regex_hex |
Regular expression to match a hex color code. |
regex_ip |
Regular expression to match an IP address. |
regex_alphanumeric |
Regular expression to match alphanumeric strings. |
regex_non_whitespace |
Regular expression to match non-whitespace characters. |
regex_word |
Regular expression to match words. |
regex_digits |
Regular expression to match digits. |
regex_not_digits |
Regular expression to match non-digits. |
regex_sentence |
Regular expression to match a sentence. |
regex_leading_spaces |
Regular expression to match leading spaces. |
regex_trailing_spaces |
Regular expression to match trailing spaces. |
regex_multiple_spaces |
Regular expression to match multiple consecutive spaces. |
describe |
RSpec describe block. |
it |
RSpec it block. |
expect |
RSpec expectation syntax. |
let |
Define a let method in RSpec. |
before |
RSpec before hook. |
after |
RSpec after hook. |
shared_examples |
Define shared examples in RSpec. |
describe_minitest |
Minitest describe block. |
it_minitest |
Minitest it block. |
gem_info |
Get information about a gem. |
gem_spec |
Get the specification of a gem. |
update_bundler |
Update Bundler gem. |
gem_build |
Build a gem from the gemspec file. |
gem_push |
Push a gem to RubyGems. |
gem_create |
Create a new gem. |
gem_specification |
Template for a gem specification. |
gem_update_all |
Update all installed gems. |
gem_env |
Show gem environment. |
gem_cleanup |
Cleanup old versions of installed gems. |
gem_lock |
Lock the gems to specific versions. |
linked_list_node |
Define a node for a linked list. |
linked_list_class |
Define a linked list class. |
stack_class |
Define a stack class. |
queue_class |
Define a queue class. |
binary_tree_node |
Define a node for a binary tree. |
binary_tree_class |
Define a binary tree class. |
hash_table_class |
Define a hash table class. |
graph_node |
Define a node for a graph. |
graph_class |
Define a graph class. |
set_class |
Define a set class. |