Class: ReadableMessage::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/readable_message.rb

Instance Method Summary collapse

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_sObject



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