Class: EventMachine::Kannel::Message

Inherits:
Object
  • Object
show all
Includes:
Validations
Defined in:
lib/em-kannel/message.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Validations

#friendly_name, included, #validate!

Constructor Details

#initialize(attributes = {}) ⇒ Message

Returns a new instance of Message.



12
13
14
15
16
17
18
# File 'lib/em-kannel/message.rb', line 12

def initialize(attributes={})
  attributes = attributes.with_indifferent_access

  self.from = attributes[:from]
  self.to   = attributes[:to]
  self.body = attributes[:body]
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



6
7
8
# File 'lib/em-kannel/message.rb', line 6

def body
  @body
end

#fromObject

Returns the value of attribute from.



6
7
8
# File 'lib/em-kannel/message.rb', line 6

def from
  @from
end

#toObject

Returns the value of attribute to.



6
7
8
# File 'lib/em-kannel/message.rb', line 6

def to
  @to
end

Instance Method Details

#as_queryObject



20
21
22
# File 'lib/em-kannel/message.rb', line 20

def as_query
  { from: from, to: to, text: body }
end