Class: Siamese::Message

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#contextObject

Returns the value of attribute context

Returns:

  • (Object)

    the current value of context



2
3
4
# File 'lib/siamese/message.rb', line 2

def context
  @context
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



2
3
4
# File 'lib/siamese/message.rb', line 2

def options
  @options
end

#templateObject

Returns the value of attribute template

Returns:

  • (Object)

    the current value of template



2
3
4
# File 'lib/siamese/message.rb', line 2

def template
  @template
end

Instance Method Details

#deliver_nowObject



3
4
5
6
7
8
9
# File 'lib/siamese/message.rb', line 3

def deliver_now
  Siamese.deliver({
    from: options[:from] || Siamese.defaults[:from],
    to: options[:to] || context.phone || Siamese.defaults[:to],
    body: options[:body] || render,
  })
end