Sha256: 81c5d4071920e99bb0e36dddcf810b56a0f3a7c462aca120cb8c1d22f7ce2798

Contents?: true

Size: 950 Bytes

Versions: 10

Compression:

Stored size: 950 Bytes

Contents

module PortaText
  module Command
    module Api
      # The sms endpoint.
      # https://github.com/PortaText/docs/wiki/REST-API#api_sms
      #
      # Author::    Marcelo Gornstein (mailto:marcelog@portatext.com)
      # Copyright:: Copyright (c) 2015 PortaText
      # License::   Apache-2.0
      class Sms < Base
        def id(id)
          set :id, id
        end

        def to(to)
          set :to, to
        end

        def from(from)
          set :from, from
        end

        def use_template(id, variables = {})
          set :template_id, id
          set :variables, variables
        end

        def text(text)
          set :text, text
        end

        def client_ref(client_ref)
          set :client_ref, client_ref
        end

        def endpoint(_method)
          return 'sms' if @args[:id].nil?
          id = @args[:id]
          @args.delete :id
          "sms/#{id}"
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
portatext-1.1.7 lib/portatext/command/api/sms.rb
portatext-1.1.6 lib/portatext/command/api/sms.rb
portatext-1.1.5 lib/portatext/command/api/sms.rb
portatext-1.1.4 lib/portatext/command/api/sms.rb
portatext-1.1.3 lib/portatext/command/api/sms.rb
portatext-1.1.2 lib/portatext/command/api/sms.rb
portatext-1.1.1 lib/portatext/command/api/sms.rb
portatext-1.1.0 lib/portatext/command/api/sms.rb
portatext-1.0.0 lib/portatext/command/api/sms.rb
portatext-1.0.0.pre lib/portatext/command/api/sms.rb