Sha256: 9d9f1ef44e0b477a7b17b0d8185f71a40d5755442c828ece2737bcd4bba07c51

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 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.1.0 lib/cellular/models/sms.rb