module Siamese

Constants

VERSION

Public Class Methods

client() click to toggle source
# File lib/siamese.rb, line 35
def client
  @client ||= Twilio::REST::Client.new(twilio_account_sid, twilio_auth_token)
end
configure() { |self| ... } click to toggle source
# File lib/siamese.rb, line 10
def configure
  yield self
end
deliver(attributes) click to toggle source
# File lib/siamese.rb, line 25
def deliver attributes
  deliveries << attributes
  if Rails.env.production?
    while deliveries.any?
      attributes = deliveries.pop
      client.api.account.messages.create(attributes)
    end
  end
end
method_missing(meth, *args, **kwargs, &block) click to toggle source
Calls superclass method
# File lib/siamese.rb, line 14
def method_missing meth, *args, **kwargs, &block
  template = "sms/#{meth}"
  if ApplicationController.new.lookup_context.exists?(template)
    context = args.first
    options = args.second || {}
    Message.new(template, context, options)
  else
    super
  end
end