Higher Test Marks with Free Online Ruby-Programmer-Gold Exam Practice

Assess the CertsIQ’s updated Ruby-Programmer-Gold exam questions for free online practice of your Ruby Association Certified Ruby Programmer Gold version 3 test. Our Ruby Programmer Gold dumps questions will enhance your chances of passing the Ruby Association Certified certification exam with higher marks.

Exam Code: Ruby-Programmer-Gold
Exam Questions: 160
Ruby Association Certified Ruby Programmer Gold version 3
Updated: 25 Nov, 2025
Question 1

Review the following Ruby code snippet in the context of class inheritance and method access control:

class Product
  def initialize(name, price)
    @name = name
    @price = price
  end
  private
  def price
    @price
  end
end
class Electronic < Product
  def discount_amount(discount_percentage)
    price * discount_percentage / 100.0
  end
  def discounted_price(discount_percentage)
    price - discount_amount(discount_percentage)
  end
end
electronic_item = Electronic.new("Laptop", 1000)
result = electronic_item.discounted_price(20)
What will be the value of result?

Options :
Answer: B

Question 2

Analyze the following Ruby code snippet in the context of class design and instance variable management:

class Book
  attr_reader :title, :author
  @@total_books = 0
  def self.total_books
    @@total_books
  end
  def initialize(title, author)
    @title = title
    @author = author
    @@total_books += 1
  end
end
class Library
  attr_reader :books
 
  def initialize
    @books = []
  end
  def add_book(book)
    @books << book
  end
  def total_books_in_library
    @books.size
  end
end
library = Library.new
library.add_book(Book.new("1984", "George Orwell"))
library.add_book(Book.new("To Kill a Mockingbird", "Harper Lee"))
result1 = Library.total_books
result2 = library.total_books_in_library
What will be the values of result1 and result2, respectively?

Options :
Answer: C

Question 3

Analyze the following Ruby code snippet that utilizes regular expressions for string processing:

class EmailExtractor EMAIL_REGEX = /(\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}\b)/  def self.extract_from(text) text.scan(EMAIL_REGEX).flatten endend text1 = "Contact us at [email protected] for assistance"text2 = "Send your feedback to: [email protected] and [email protected]"text3 = "No emails here!" result1 = EmailExtractor.extract_from(text1)result2 = EmailExtractor.extract_from(text2)result3 = EmailExtractor.extract_from(text3) What will be the values of result1, result2, and result3, respectively?

Options :
Answer: A

Question 4

Evaluate the following Ruby code snippet that involves the forwardable and date modules:

require 'forwardable'require 'date' class Project extend Forwardable def_delegators :@deadline, :month, :day  attr_accessor :name attr_reader :deadline  def initialize(name, deadline) @name = name @deadline = Date.parse(deadline) endend project = Project.new("Ruby Exam Prep", "2024-06-30")result1 = project.monthresult2 = project.dayproject.deadline = Date.parse("2024-07-15")result3 = project.month What will be the values of result1, result2, and result3, respectively?

Options :
Answer: A

Question 5

Examine the following Ruby code snippet:

a = 2
b = 3
c = '4'
result1 = a * b
result2 = a * c
result3 = c * b
result4 = c + a

Options :
Answer: B

Viewing Page : 1 - 16
Practicing : 1 - 5 of 160 Questions

© Copyrights CertsIQ 2025. All Rights Reserved

We use cookies to ensure that we give you the best experience on our website (CertsIQ). If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the CertsIQ.