Sha256: fc12be89c58e1fe7120e93d87833d6035341978b5f8f4cd4c075e0304cf3ce4c

Contents?: true

Size: 815 Bytes

Versions: 1

Compression:

Stored size: 815 Bytes

Contents

module Cellular
  class SMS

    attr_accessor :recipient, :sender, :message, :price, :country

    def initialize(options = {})
      @backend = Cellular.config.backend

      @recipient = options[:recipient]
      @sender = options[:sender]
      @message = options[:message]
      @price = options[:price]
      @country = options[:country]

      @delivered = false
    end

    def deliver
      @delivery_status, @delivery_message = @backend.deliver(
        recipient: @recipient,
        sender: @sender,
        price: @price,
        country: @country,
        message: @message
      )

      @delivered = true
    end

    def save(options)
      raise NotImplementedError
    end

    def receive(options)
      raise NotImplementedError
    end

    def delivered?
      @delivered
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cellular-1.0.0 lib/cellular/models/sms.rb