class Greeter
The Greeter
class represents an object that knows how to greet
with a message in a certain language.
Attributes
language[R]
This greeter's language.
message[R]
This greeter's message.
Public Class Methods
new(language, message)
click to toggle source
Creates a new Greeter
instance. Don't call this method
directly; instead, use the GreeterFactory.create
factory method.
- Parameters
- language
-
The language of the message for this greeter.
- message
-
The message for this greeter.
# File src/models/greeter.rb, line 23 def initialize(language, message) @language = language @message = message end
Public Instance Methods
to_s()
click to toggle source
Get a string containing the representation for this greeter object.
- Returns
-
This greeter's message as a string.
# File src/models/greeter.rb, line 32 def to_s @message.to_s end