Class: SmsSafe::Message

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

Overview

Different texter gems will have different classes for their messages. This is a common class that acts as an impedance adapter. Most of our methods use this class

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attrs) ⇒ Message


17
18
19
# File 'lib/sms_safe/message.rb', line 17

def initialize(attrs)
  attrs.each { |k, v| self.send "#{k.to_s}=".to_sym, v }
end

Instance Attribute Details

#fromString


14
15
16
17
18
19
20
# File 'lib/sms_safe/message.rb', line 14

class Message
  attr_accessor :from, :to, :text, :original_message

  def initialize(attrs)
    attrs.each { |k, v| self.send "#{k.to_s}=".to_sym, v }
  end
end

#original_messageString


14
15
16
17
18
19
20
# File 'lib/sms_safe/message.rb', line 14

class Message
  attr_accessor :from, :to, :text, :original_message

  def initialize(attrs)
    attrs.each { |k, v| self.send "#{k.to_s}=".to_sym, v }
  end
end

#textString


14
15
16
17
18
19
20
# File 'lib/sms_safe/message.rb', line 14

class Message
  attr_accessor :from, :to, :text, :original_message

  def initialize(attrs)
    attrs.each { |k, v| self.send "#{k.to_s}=".to_sym, v }
  end
end

#toString


14
15
16
17
18
19
20
# File 'lib/sms_safe/message.rb', line 14

class Message
  attr_accessor :from, :to, :text, :original_message

  def initialize(attrs)
    attrs.each { |k, v| self.send "#{k.to_s}=".to_sym, v }
  end
end