Class: ReadableMessage::Message
Instance Method Summary collapse
-
#initialize(str, method) ⇒ Message
constructor
A new instance of Message.
- #to_s ⇒ Object
Constructor Details
#initialize(str, method) ⇒ Message
Returns a new instance of Message.
34 35 36 |
# File 'lib/readable_message.rb', line 34 def initialize(str, method) @str, @method = str, method end |
Instance Method Details
#to_s ⇒ Object
38 39 40 |
# File 'lib/readable_message.rb', line 38 def to_s @str.send(@method).to_s if @str.respond_to?(@method.to_sym) end |